本文整理汇总了Java中org.eclipse.jface.layout.GridDataFactory类的典型用法代码示例。如果您正苦于以下问题:Java GridDataFactory类的具体用法?Java GridDataFactory怎么用?Java GridDataFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GridDataFactory类属于org.eclipse.jface.layout包,在下文中一共展示了GridDataFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBottomControls
import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
/**
* Creates the bottom controls.
*/
private void createBottomControls(Composite parent) {
Composite bottomControls = new Composite(parent, SWT.NONE);
bottomControls
.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).align(SWT.RIGHT, SWT.CENTER).create());
bottomControls.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).extendedMargins(0, 5, 0, 0).create());
previewToggleButton = new Button(bottomControls, SWT.PUSH);
previewToggleButton.setText(HIDE_PREVIEW_TEXT);
previewToggleButton.setSelection(true);
previewToggleButton.setLayoutData(GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.BOTTOM).create());
previewToggleButton.setToolTipText(PREVIEW_BUTTON_TOOLTIP);
previewToggleButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (!previewVisible) {
showContentPreview();
} else {
hideContentPreview();
}
}
});
}
示例2: createFilterControls
import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
protected void createFilterControls(Composite con) {
Label filterLabel = new Label(con,SWT.NONE);
filterLabel.setText("Filter:");
GridDataFactory.swtDefaults().applyTo(filterLabel);
Text filterText = new Text(con, SWT.BORDER);
filterText.setMessage("(" + PreferenceFilter.MIN_FILTER_CHARS + " chars at least)");
filterText.addModifyListener(event -> {
filterChanged(filterText.getText());
});
GridDataFactory.fillDefaults().grab(true,false).applyTo(filterText);
Button clearBtn = new Button(con, SWT.PUSH);
clearBtn.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(PrefEditorPlugin.PLUGIN_ID,"icons/clear.gif").createImage());
GridDataFactory.swtDefaults().applyTo(clearBtn);
clearBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
filterText.setText("");
filterChanged("");
}
});
}
示例3: CustomElementSelectionForm
import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
/**
* Create the composite.
*/
public CustomElementSelectionForm(Composite parent, int style) {
super(parent, style);
setLayout(new GridLayout(2, false));
treeViewer = new TreeViewer(this, SWT.BORDER);
Tree tree = getTreeViewer().getTree();
// Set a minimum height to prevent weird dialog dimensions
tree.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).span(2, 1).minSize(0, 200).create());
elementLabel = new Label(this, SWT.NONE);
elementLabel.setLayoutData(GridDataFactory.swtDefaults().create());
elementLabel.setText("New Label");
elementInput = new SuffixText(this, SWT.BORDER);// new Text(this, SWT.BORDER);
elementInput.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
}
示例4: createControl
import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
@Override
public void createControl(Composite parent) {
paneComposite = new Composite(parent, SWT.NONE);
paneComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(true).create());
super.createControl(paneComposite);
workspaceWizardControl.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
createPreview(paneComposite);
createBottomControls(paneComposite);
setControl(paneComposite);
boolean hidePreviewSetting = getDialogSettings().getBoolean(DIALOG_SETTING_HIDE_PREVIEW_KEY);
if (hidePreviewSetting) {
hideContentPreview();
} else {
// Otherwise just make sure the shell size is set
getShell().setMinimumSize(PREVIEW_MINIMUM_SHELL_SIZE);
}
}
示例5: createNameArea
import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
private void createNameArea(Composite parent, String areaName, Consumer<String> textHandler) {
final Group area = new Group(parent, SHADOW_ETCHED_IN);
area.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).create());
area.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
area.setText(areaName);
final Text txtPackageName = getSimpleTextArea(area);
txtPackageName.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
Text textWidget = (Text) e.getSource();
textHandler.accept(textWidget.getText());
}
});
}
示例6: build
import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
/**
* Builds the new column viewer instance.
*
* @param parent
* the parent composite for the viewer.
* @return the new new column viewer.
*/
public final CV build(final Composite parent) {
final Composite container = new Composite(parent, NONE);
container.setLayout(GridLayoutFactory.fillDefaults().create());
container.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).align(FILL, FILL).create());
final Composite composite = new Composite(container, NONE);
composite.setLayout(GridLayoutFactory.fillDefaults().create());
composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).align(FILL, FILL).create());
final AbstractColumnLayout layout = createColumnLayout();
composite.setLayout(layout);
final CV viewer = createViewer(composite, layout, NONE | V_SCROLL | H_SCROLL | getStyle());
viewer.setContentProvider(contentProvider);
viewer.setLabelProvider(labelProvider);
viewer.setUseHashlookup(useHashlookup);
return viewer;
}
示例7: createTitleControl
import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
@Override
protected Control createTitleControl(Composite parent) {
text = new Text(parent, SWT.NONE);
GridData textLayoutData = new GridData();
textLayoutData.horizontalAlignment = GridData.FILL;
textLayoutData.verticalAlignment = GridData.FILL;
textLayoutData.grabExcessHorizontalSpace = true;
textLayoutData.grabExcessVerticalSpace = false;
textLayoutData.horizontalSpan = 2;
text.setLayoutData(textLayoutData);
text.addKeyListener(new FilterKeyListener());
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(DO_SHOW_DIALOG ? 1 : 2, 1)
.applyTo(text);
return text;
}
示例8: createControl
import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
@Override
public void createControl(Composite parent) {
Composite comp = new Group(parent, SWT.BORDER);
setControl(comp);
GridLayoutFactory.swtDefaults().numColumns(2).applyTo(comp);
Label label = new Label(comp, SWT.NONE);
label.setText("Console Text:");
GridDataFactory.swtDefaults().applyTo(label);
text = new Text(comp, SWT.BORDER);
text.setMessage("Console Text");
GridDataFactory.fillDefaults().grab(true, false).applyTo(text);
}
示例9: createDialogArea
import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite p = (Composite) super.createDialogArea(parent);
Composite container = new Composite(p, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, true).applyTo(container);
GridLayoutFactory.fillDefaults().margins(10, 10).numColumns(2).applyTo(container);
new Label(container, SWT.NONE).setText("Pipeline name:");
text = new Text(container, SWT.BORDER);
GridDataFactory.fillDefaults().grab(true, false).applyTo(text);
text.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
validate(((Text)e.getSource()).getText());
}
});
return container;
}
示例10: createDialogArea
import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite p = (Composite) super.createDialogArea(parent);
Composite container = new Composite(p, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, true).applyTo(container);
GridLayoutFactory.fillDefaults().margins(10, 10).numColumns(2).applyTo(container);
new Label(container, SWT.NONE).setText("New name:");
text = new Text(container, SWT.BORDER);
text.setText(resourceService.getResourceName(resource));
GridDataFactory.fillDefaults().grab(true, false).applyTo(text);
text.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
validate(((Text)e.getSource()).getText());
}
});
return container;
}
示例11: createDialogArea
import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout(3, false);
layout.marginRight = 5;
layout.marginLeft = 10;
container.setLayout(layout);
Label lblProperties = new Label(container, SWT.NONE);
lblProperties.setText("Properties:");
GridDataFactory.swtDefaults().align(SWT.BEGINNING, SWT.BEGINNING).applyTo(lblProperties);
withContext = new Button(container, SWT.CHECK);
withContext.setText("Store term contexts to the exported file");
withContext.setSelection(jsonOptions.isWithContexts());
GridDataFactory.swtDefaults().span(3, 1).applyTo(withContext);
withOccurrences = new Button(container, SWT.CHECK);
withOccurrences.setText("Store term occurrences to the exported file");
withOccurrences.setSelection(jsonOptions.isEmbeddedOccurrences());
GridDataFactory.swtDefaults().span(3, 1).applyTo(withOccurrences);
return container;
}
示例12: createControls
import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
@PostConstruct
public void createControls(Composite parent) {
final Composite comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout());
final DelayableText text = new DelayableText(DELAY, comp, SWT.SEARCH | SWT.ICON_SEARCH | SWT.CANCEL | SWT.BORDER);
text.setMessage("Search");
GridDataFactory.fillDefaults().hint(130, SWT.DEFAULT).applyTo(text);
text.addDelayedModificationListener(new DelayedModificationListener() {
@Override
public void modifyText(final EventObject e) {
sync.asyncExec(new Runnable() {
@Override
public void run() {
eventBroker.post(TermSuiteEvents.SEARCH_TEXT_MODIFIED, ((DelayableText)e.getSource()).getText());
}
});
}
});
}
示例13: createContents
import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
private void createContents() {
GridLayoutFactory.swtDefaults().numColumns(2).applyTo(this);
text = new Text(this, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).applyTo(text);
Button button = new Button(this, SWT.PUSH);
button.setText("Browse...");
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
DirectoryDialog fileDialog = new DirectoryDialog(getShell());
// Set the text
fileDialog.setText("Select directory");
// Set filter on .txt files
String selection = fileDialog.open();
if (selection != null)
text.setText(selection);
}
});
}
示例14: createControl
import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
public void createControl(Composite parent) {
initializeDialogUnits(parent);
parent = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(1, false);
parent.setLayout(layout);
Composite sourceGroup = new Composite(parent, SWT.NONE);
GridDataFactory.swtDefaults().grab(true, false)
.align(SWT.FILL, SWT.BEGINNING).applyTo(sourceGroup);
GridLayoutFactory.swtDefaults().numColumns(5).applyTo(sourceGroup);
createFileBlock(sourceGroup);
createUrlBlock(sourceGroup);
createAgentBlock(sourceGroup);
createOptionsBlock(parent);
setControl(parent);
ContextHelp.setHelp(parent, ContextHelp.SESSION_IMPORT);
restoreWidgetValues();
updateStatus();
}
示例15: createDialogArea
import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
@Override
protected Control createDialogArea(final Composite parent) {
Composite dialogArea = (Composite) super.createDialogArea(parent);
Composite container = new Composite(dialogArea, SWT.NONE);
Link flexPricing = new Link(container, SWT.WRAP);
flexPricing.setText(Messages.getString("deploy.preferences.dialog.flex.pricing")); //$NON-NLS-1$
flexPricing.addSelectionListener(
new OpenUriSelectionListener(new ErrorDialogErrorHandler(getShell())));
FontUtil.convertFontToItalic(flexPricing);
GridDataFactory.fillDefaults().grab(true, true).applyTo(container);
Point margins = LayoutConstants.getMargins();
GridLayoutFactory.fillDefaults()
.extendedMargins(margins.x, margins.x, 0 /* no upper margin */, margins.y)
.generateLayout(container);
return dialogArea;
}