本文整理汇总了Java中org.eclipse.swt.widgets.Composite.getDisplay方法的典型用法代码示例。如果您正苦于以下问题:Java Composite.getDisplay方法的具体用法?Java Composite.getDisplay怎么用?Java Composite.getDisplay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Composite
的用法示例。
在下文中一共展示了Composite.getDisplay方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTopContent
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
protected void createTopContent(String title, InputStream imageName) {
Composite top = new Composite(composite, SWT.NONE);
top.setLayout(new GridLayout(2, false));
top.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
top.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
final Image image = new Image(top.getDisplay(), imageName);
Image resized = resizeImage(image, 48, 48);
Label labelImage = new Label(top, SWT.CENTER);
labelImage.setImage(resized);
Label label = new Label(top, SWT.NONE);
label.setText(title);
final Font newFont = new Font(display, fontName, getTitleFontSize(), SWT.NORMAL);
label.setFont(newFont);
label.setBackground(rowColorSelection);
createLineContent();
top.addDisposeListener(e -> {
newFont.dispose();
resized.dispose();
});
}
示例2: createFormPart
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
@Override
public void createFormPart ( final Composite parent, final ConfigurationEditorInput input )
{
this.toolkit = new ConfigurationFormToolkit ( parent.getDisplay () );
this.form = this.toolkit.createScrolledForm ( parent, getTitle ( input ) );
this.form.getBody ().setLayout ( new GridLayout ( getColumnCount (), true ) );
// create
populateFormContent ( this.toolkit, this.form, input );
this.toolkit.getDataBindingContext ().updateTargets ();
}
示例3: DetailsViewComposite
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
public DetailsViewComposite ( final Composite parent, final int style )
{
super ( parent, style );
this.display = parent.getDisplay ();
addDisposeListener ( new DisposeListener () {
@Override
public void widgetDisposed ( final DisposeEvent e )
{
handleDispose ();
}
} );
createControls ( parent );
}
示例4: initialize
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
public void initialize(Composite composite, int defaultOrientation) {
display = composite.getDisplay();
composite.addDisposeListener((DisposeListener) this::dispose);
tableViewer = new TableViewer(composite, SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL | SWT.NO_BACKGROUND | SWT.DOUBLE_BUFFERED );
table = tableViewer.getTable();
GridData gridData = new GridData();
gridData.verticalAlignment = GridData.FILL;
gridData.horizontalSpan = 2;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = true;
gridData.horizontalAlignment = GridData.FILL;
tableViewer.getControl().setLayoutData(gridData);
tableViewer.setContentProvider((ILazyContentProvider) rowIndex -> tableViewer.replace(contentProvider().getTableEntries().get(rowIndex), rowIndex));
table.addListener(SWT.Selection, event-> {
TableItem item = (TableItem) event.item;
contentProvider().setCursorIndex(contentProvider().getRowIndex((RankedItem<T>) item.getData()));
handleSelection();
});
composite.getShell().addListener(SWT.Resize, event -> autoAdjustColumnWidths(composite));
// TODO try throttleLast or custom scheduler
//subjectFilter.debounce(0, TimeUnit.MILLISECONDS).subscribe( filter -> handleRefresh(filter));
}
示例5: OldFXCanvas
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
/**
* @inheritDoc
*/
public OldFXCanvas(@NamedArg("parent") Composite parent, @NamedArg("style") int style) {
super(parent, style | SWT.NO_BACKGROUND);
initFx();
hostContainer = new HostContainer();
registerEventListeners();
Display display = parent.getDisplay();
display.addFilter(SWT.Move, moveFilter);
}
示例6: createConsoleBufferWidget
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
/**
* Create console buffer widget
* @param bufferSize
*/
private void createConsoleBufferWidget(String bufferSize){
HydroGroup hydroGroup = new HydroGroup(this, SWT.NONE);
hydroGroup.setHydroGroupText(Messages.HYDROGRAPH_CONSOLE_PREFERANCE_PAGE_GROUP_NAME);
hydroGroup.setLayout(new GridLayout(1, false));
hydroGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
hydroGroup.getHydroGroupClientArea().setLayout(new GridLayout(2, false));
Label label = new Label(hydroGroup.getHydroGroupClientArea(), SWT.NONE);
label.setText(Messages.PREFERANCE_CONSOLE_BUFFER_SIZE);
textWidget = new Text(hydroGroup.getHydroGroupClientArea(), SWT.BORDER);
textWidget.setText(bufferSize);
textWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
textWidget.setTextLimit(6);
attachConsoleBufferValidator();
Composite purgeComposite = new Composite(hydroGroup.getHydroGroupClientArea(), SWT.NONE);
purgeComposite.setLayout(new GridLayout(2, false));
purgeComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1));
Label lblNote = new Label(purgeComposite, SWT.TOP | SWT.WRAP);
lblNote.setText(Messages.PREFERANCE_PAGE_NOTE);
FontData fontData = lblNote.getFont().getFontData()[0];
Font font = new Font(purgeComposite.getDisplay(), new FontData(fontData.getName(), fontData.getHeight(), SWT.BOLD));
lblNote.setFont(font);
Label lblmsg = new Label(purgeComposite, SWT.TOP | SWT.WRAP);
lblmsg.setText(Messages.UI_PERFORMANCE_NOTE_IN_CASE_OF_CHANGE_IN_BUFFER_SIZE);
}
示例7: ProjectCompareTree
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
/**
* Create an instance.
*/
public ProjectCompareTree(Composite parent, int style, ProjectCompareTreeHelper projectCompareTreeHelper) {
super(parent, style);
this.projectCompareTreeHelper = projectCompareTreeHelper;
parent.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
onDispose();
}
});
col_diff_error_fg = new Color(parent.getDisplay(), 255, 40, 40);
col_diff_conformant_fg = new Color(parent.getDisplay(), 60, 127, 95);
col_classifier_bg = new Color(parent.getDisplay(), 200, 220, 250);
final Tree tree = getTree();
for (int n = 0; n < NUM_OF_COLUMNS; n++) {
final TreeColumn colN = new TreeColumn(tree, SWT.LEFT);
if (n == 0)
colN.setWidth(300); // make API column a bit wider
else
colN.setWidth(200);
}
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
setLabelProvider(new MyLabelProvider());
setContentProvider(new MyContentProvider());
setComparison(null, null, null);
}
示例8: ChartAreaRenderer
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
public ChartAreaRenderer ( final Composite control )
{
super ( new LocalResourceManager ( JFaceResources.getResources ( control.getDisplay () ), control ) );
this.realm = new DisplayRealm ( control.getDisplay () );
this.control = control;
}
示例9: createPage
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
@Override
public void createPage ( final Composite parent )
{
this.display = parent.getDisplay ();
}
示例10: createControl
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
@Override
protected Control createControl ( final Composite parent )
{
this.display = parent.getDisplay ();
KeyInstanceManager.getInstance ( parent.getDisplay () ).addStatusListener ( this );
final Composite wrapper = new Composite ( parent, SWT.NONE );
wrapper.setLayout ( new GridLayout ( 1, false ) );
this.label = new Label ( wrapper, SWT.NONE );
final GridData gd = new GridData ( SWT.FILL, SWT.FILL, false, true );
gd.widthHint = 150;
this.label.setLayoutData ( gd );
this.display.timerExec ( 500, this.updateRunner );
updateLabel ();
return wrapper;
}
示例11: createControls
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
super.createControls(parent, aTabbedPropertySheetPage);
formToolkit = new FormToolkit(parent.getDisplay());
Composite composite = getWidgetFactory().createFlatFormComposite(parent);
fillComposite(composite);
}
示例12: createAdvancedControls
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
protected void createAdvancedControls(Composite parent) {
LOGGER.debug("Creating Import Engine XML layout");
Composite fileSelectionArea = new Composite(parent, SWT.NONE);
fileSelectionArea.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL));
GridLayout fileSelectionLayout = new GridLayout();
fileSelectionLayout.makeColumnsEqualWidth = false;
fileSelectionLayout.marginWidth = 0;
fileSelectionLayout.marginHeight = 0;
fileSelectionArea.setLayout(fileSelectionLayout);
editor = new FileFieldEditor("fileSelect", Messages.SELECT_FILE_LABEL_TEXT, fileSelectionArea);
editor.getTextControl(fileSelectionArea).addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
IPath path = new Path(ImportEngineXmlWizardPage.this.editor.getStringValue());
if (path.segment(0) != null) {
targetxmlFilePath = editor.getStringValue();
setFileName(path.lastSegment());
} else {
targetxmlFilePath = null;
displayError();
}
}
});
String[] extensions = new String[] { ALLOWED_EXTENSIONS }; // NON-NLS-1
editor.setFileExtensions(extensions);
fileSelectionArea.moveAbove(null);
Composite fileSelectionArea2 = new Composite(parent, SWT.NONE);
fileSelectionArea2.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL));
GridLayout fileSelectionLayout2 = new GridLayout();
fileSelectionLayout2.numColumns = 2;
fileSelectionLayout2.makeColumnsEqualWidth = false;
fileSelectionLayout2.marginWidth = 0;
fileSelectionLayout2.marginHeight = 0;
fileSelectionArea2.setLayout(fileSelectionLayout2);
Font fontNote = new Font(fileSelectionArea2.getDisplay(), TIMES_NEW_ROMAN_BALTIC_FONT, 9, SWT.BOLD);
Label lblNoteHeader = new Label(fileSelectionArea2, SWT.NONE);
lblNoteHeader.setText(Messages.NOTE_LABEL_HEADER_TEXT);
lblNoteHeader.setFont(fontNote);
Label lblNote = new Label(fileSelectionArea2, SWT.NONE);
GridData gd_lblNote = new GridData(SWT.BOTTOM, SWT.CENTER, false, false, 1, 1);
gd_lblNote.widthHint = 391;
lblNote.setLayoutData(gd_lblNote);
lblNote.setText(Messages.NOTE_MESSAGE_TEXT);
}
示例13: UIAppender
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
public UIAppender(Composite parent, Locale locale) {
this.parent = parent;
this.display = parent.getDisplay();
this.locale = locale;
createControl();
}
示例14: createInfoTextArea
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
/**
* Creates the optional info text area. This method is only called if the
* <code>hasInfoArea()</code> method returns true. Subclasses typically
* need not override this method, but may do so.
*
* <p>
* If this method is overridden, the returned control's layout data must be
* an instance of <code>GridData</code>. This method must not modify the
* parent's layout.
*
*
* @param parent
* The parent composite.
* @return The control representing the info text area.
*
* @see PopupDialog#hasInfoArea()
* @see PopupDialog#createTitleControl(Composite)
*/
protected Control createInfoTextArea(Composite parent) {
// Status label
infoLabel = new Label(parent, SWT.RIGHT);
infoLabel.setText(infoText);
GridDataFactory.fillDefaults().grab(true, false)
.align(SWT.FILL, SWT.BEGINNING).applyTo(infoLabel);
Display display = parent.getDisplay();
infoColor = new Color(display,
blend(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB(),
display.getSystemColor(SWT.COLOR_INFO_FOREGROUND).getRGB(), 0.56f));
infoLabel.setForeground(infoColor);
return infoLabel;
}