本文整理汇总了Java中org.eclipse.swt.custom.CCombo.setLayoutData方法的典型用法代码示例。如果您正苦于以下问题:Java CCombo.setLayoutData方法的具体用法?Java CCombo.setLayoutData怎么用?Java CCombo.setLayoutData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.custom.CCombo
的用法示例。
在下文中一共展示了CCombo.setLayoutData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initServerCombo
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void initServerCombo(Composite container) {
Label serverLabel = new Label(container, SWT.FLAT);
serverLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true, 1, 1));
serverLabel.setText("Server: ");
serverCombo = new CCombo(container, SWT.DROP_DOWN);
serverCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true, 1, 1));
for (String s : serverProposals)
serverCombo.add(s);
if (serverProposals.length > 0)
serverCombo.select(0);
if (defaultUriIndex >= 0 && defaultUriIndex < serverProposals.length)
serverCombo.select(defaultUriIndex);
// serverCombo.pack();
}
示例2: createCombo
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
protected CCombo createCombo(Composite parent, String label, IJSONPath path, String[] values, String defaultValue) {
FormToolkit toolkit = getToolkit();
Composite composite = toolkit.createComposite(parent, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
GridLayout layout = new GridLayout(2, false);
layout.marginWidth = 0;
layout.marginBottom = 0;
layout.marginTop = 0;
layout.marginHeight = 0;
layout.verticalSpacing = 0;
composite.setLayout(layout);
toolkit.createLabel(composite, label);
CCombo combo = new CCombo(composite, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER);
combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
combo.setItems(values);
toolkit.adapt(combo, true, false);
bind(combo, path, defaultValue);
return combo;
}
示例3: createMatchModeCombo
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void createMatchModeCombo(Composite parent) {
// draw label
Label comboLabel = new Label(parent,SWT.LEFT);
comboLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
comboLabel.setText(LogViewerPlugin.getResourceString("preferences.ruleseditor.dialog.matchmode.label")); //$NON-NLS-1$
// draw combo
matchModeCombo = new CCombo(parent,SWT.BORDER);
matchModeCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
matchModeCombo.setEditable(false);
String[] matchModes = {LogViewerPlugin.getResourceString("preferences.ruleseditor.dialog.matchmode.entry.find"), LogViewerPlugin.getResourceString("preferences.ruleseditor.dialog.matchmode.entry.match")};
matchModeCombo.setItems(matchModes);
if(edit) {
String[] items = matchModeCombo.getItems();
for(int i = 0 ; i < items.length ; i++) {
if(items[i].toLowerCase().indexOf(this.data.getMatchMode())!=-1) {
matchModeCombo.select(i);
return;
}
}
}
}
示例4: createLabelledCombo
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private CCombo createLabelledCombo(Composite content, String slabel) {
Label label = new Label(content, SWT.NONE);
label.setBackground(content.getDisplay().getSystemColor(SWT.COLOR_WHITE));
label.setText(" "+slabel+" ");
label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true));
CCombo ret = new CCombo(content, SWT.READ_ONLY|SWT.BORDER);
ret.setItems(getNames());
GridData fill = new GridData(SWT.FILL, SWT.CENTER, true, true);
fill.widthHint=100;
ret.setLayoutData(fill);
return ret;
}
示例5: createTopComposite
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void createTopComposite(Composite main_composite) {
top_composite = new Composite(main_composite, SWT.NONE);
top_composite.setLayout(new GridLayout(4, false));
GridData gd_composite_1 = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
gd_composite_1.heightHint = 45;
top_composite.setLayoutData(gd_composite_1);
Label applyAllLabel = new Label(top_composite, SWT.NONE);
applyAllLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
applyAllLabel.setText(Messages.REMAINING_FIELDS);
applyAllLabel.setToolTipText(Messages.REMAINING_FIELDS_TOOLTIP);
combo = new CCombo(top_composite, SWT.NONE);
GridData gd_combo = new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1);
gd_combo.widthHint = 143;
combo.setLayoutData(gd_combo);
draggedFields.add(0,"Select");
combo.setItems(convertToArray(draggedFields));
combo.select(0);
Composite composite_2 = new Composite(top_composite, SWT.NONE);
composite_2.setLayout(new GridLayout(3, false));
composite_2.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, true, true, 1, 1));
deleteButton = new Button(composite_2, SWT.NONE);
deleteButton.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, true, false, 1, 1));
deleteButton.setImage(ImagePathConstant.DELETE_BUTTON.getImageFromRegistry());
attachDeleteButtonListener(deleteButton);
deleteButton.setEnabled(false);
}
示例6: createLogLevelGroup
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
/**
* @param logLevel
*
*/
private void createLogLevelGroup(String logLevel) {
HydroGroup hydroGroup = new HydroGroup(this, SWT.NONE);
hydroGroup.setHydroGroupText(Messages.LOG_LEVEL_PREF_MESSAGE);
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.LOG_LEVEL_CONSOLE_PREF_MESSAGE);
ccLogLevels=new CCombo(hydroGroup.getHydroGroupClientArea(), SWT.BORDER);
GridData gd_ccLogLevels = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_ccLogLevels.widthHint = 300;
if(OSValidator.isMac()){
gd_ccLogLevels.heightHint=20;
}
ccLogLevels.setLayoutData(gd_ccLogLevels);
ccLogLevels.setItems(Messages.COMBO_LOG_LEVELS.split(HASH_REGEX));
ccLogLevels.setText(logLevel);
}
示例7: createCCombo
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private CCombo createCCombo(Composite parent, String[] values, TabbedPropertySheetWidgetFactory factory, Control top) {
CCombo combo = factory.createCCombo(parent, SWT.NONE);
combo.setItems(values);
FormData data = new FormData();
data.left = new FormAttachment(0, 160);
data.right = new FormAttachment(100, 0);
if(top == null) {
data.top = new FormAttachment(0, VSPACE);
} else {
data.top = new FormAttachment(top, VSPACE);
}
combo.setLayoutData(data);
combo.addFocusListener(listener);
return combo;
}
示例8: createDialogArea
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
protected Control createDialogArea(Composite parent) {
// create composite
Composite composite = (Composite) super.createDialogArea(parent);
// create message
if (message != null) {
Label label = new Label(composite, SWT.WRAP);
label.setText(message);
GridData data = new GridData(GridData.GRAB_HORIZONTAL
| GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL
| GridData.VERTICAL_ALIGN_CENTER);
data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
label.setLayoutData(data);
label.setFont(parent.getFont());
}
combo = new CCombo(composite, getInputComboStyle());
combo.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
| GridData.HORIZONTAL_ALIGN_FILL));
combo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
validateInput();
}
});
errorMessageText = new Text(composite, SWT.READ_ONLY | SWT.WRAP);
errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
| GridData.HORIZONTAL_ALIGN_FILL));
errorMessageText.setBackground(errorMessageText.getDisplay()
.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
errorMessageText.setForeground(errorMessageText.getDisplay()
.getSystemColor(SWT.COLOR_RED));
// Set the error message text
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=66292
setErrorMessage(errorMessage);
applyDialogFont(composite);
return composite;
}
示例9: createDialogArea
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
GridLayout gridLayout = (GridLayout) container.getLayout();
gridLayout.numColumns = 2;
Label lblNewAlternativeName = new Label(container, SWT.NONE);
lblNewAlternativeName.setText("New alternative name:");
text = new Text(container, SWT.BORDER);
text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
Label lblAlternativeType = new Label(container, SWT.NONE);
lblAlternativeType.setText("Alternative type:");
combo = new CCombo(container, SWT.BORDER);
GridData gd_combo = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
gd_combo.widthHint = 115;
combo.setLayoutData(gd_combo);
for(ConfAlternative.Type type : ConfAlternative.Type.values()){
combo.add(type.toString());
}
combo.select(0);
return container;
}
示例10: createLineCombo
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private CCombo createLineCombo(ModifyListener lsMod, String lableText,
Control prevControl)
{
// Value line
Label lable = new Label(shell, SWT.RIGHT);
lable.setText(lableText); //$NON-NLS-1$
props.setLook(lable);
FormData lableFormData = new FormData();
lableFormData.left = new FormAttachment(0, 0);
lableFormData.right = new FormAttachment(props.getMiddlePct(),
-Const.MARGIN);
// In case it is the first control
if (prevControl != null)
lableFormData.top = new FormAttachment(prevControl, Const.MARGIN);
else
lableFormData.top = new FormAttachment(0, Const.MARGIN);
lable.setLayoutData(lableFormData);
CCombo control = new CCombo(shell, SWT.BORDER);
props.setLook(control);
control.addModifyListener(lsMod);
FormData widgetFormData = new FormData();
widgetFormData.left = new FormAttachment(props.getMiddlePct(), 0);
// In case it is the first control
if (prevControl != null)
widgetFormData.top = new FormAttachment(prevControl, Const.MARGIN);
else
widgetFormData.top = new FormAttachment(0, Const.MARGIN);
widgetFormData.right = new FormAttachment(100, 0);
control.setLayoutData(widgetFormData);
return control;
}
示例11: addStandardSelect
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
protected CCombo addStandardSelect(String labelMessageKey, Control prevControl, String[] choices) {
int vertPad = verticalPadding;
addStandardLabel(labelMessageKey, prevControl);
verticalPadding = vertPad;
CCombo combo = new CCombo(shell, SWT.BORDER);
combo.setItems(choices);
combo.addModifyListener(lsMod);
combo.setLayoutData(standardInputSpacing(prevControl));
return combo;
}
示例12: createJoinTypeWidget
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
/**
* Create widgets for join type selection
* @param lsMod
*/
private void createJoinTypeWidget(final ModifyListener lsMod) {
Label joinTypeLabel=new Label(shell, SWT.LEFT);
joinTypeLabel.setText(BaseMessages.getString(PKG, "MultiMergeJoinDialog.Type.Label")); //$NON-NLS-1$
props.setLook(joinTypeLabel);
FormData fdlType=new FormData();
fdlType.left = new FormAttachment(0, 0);
fdlType.right= new FormAttachment(15, -margin);
if(wInputStepArray.length > 0)
{
fdlType.top = new FormAttachment(wInputStepArray[wInputStepArray.length-1], margin);
}
else
{
fdlType.top = new FormAttachment(wStepname, margin);
}
joinTypeLabel.setLayoutData(fdlType);
joinTypeCombo=new CCombo(shell, SWT.BORDER );
props.setLook(joinTypeCombo);
joinTypeCombo.setItems(MultiMergeJoinMeta.join_types);
joinTypeCombo.addModifyListener(lsMod);
FormData fdType=new FormData();
if(wInputStepArray.length >0)
{
fdType.top = new FormAttachment(wInputStepArray[wInputStepArray.length-1], margin);
}
else
{
fdType.top = new FormAttachment(wStepname, margin);
}
fdType.left = new FormAttachment(15, 0);
fdType.right= new FormAttachment(35, 0);
joinTypeCombo.setLayoutData(fdType);
}
示例13: addStandardSelect
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
protected CCombo addStandardSelect(String labelMessageKey, Control prevControl, String[] choices) {
int vertPad = verticalPadding;
Label label = addStandardLabel(labelMessageKey, prevControl);
verticalPadding = vertPad;
CCombo combo = new CCombo(shell, SWT.BORDER);
combo.setItems(choices);
combo.addModifyListener(lsMod);
combo.setLayoutData(standardInputSpacing(prevControl, label));
return combo;
}
示例14: createCCombo
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private static void createCCombo(final Group group) {
group.setLayout(new GridLayout(2, false));
group.setText("CCombo widget");
final Label lbl0 = new Label(group, SWT.NONE);
lbl0.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
lbl0.setText("No prompt :");
final CCombo combo0 = new CCombo(group, SWT.BORDER);
combo0.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
final Label lbl1 = new Label(group, SWT.NONE);
lbl1.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
lbl1.setText("Simple text prompt :");
final CCombo txt1 = new CCombo(group, SWT.BORDER);
txt1.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
PromptSupport.setPrompt("Type anything you want", txt1);
final Label lbl2 = new Label(group, SWT.NONE);
lbl2.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
lbl2.setText("Other style (bold) :");
final CCombo txt2 = new CCombo(group, SWT.BORDER);
txt2.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
PromptSupport.setPrompt("Type anything you want in bold", txt2);
PromptSupport.setFontStyle(SWT.BOLD, txt2);
final Label lbl3 = new Label(group, SWT.NONE);
lbl3.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
lbl3.setText("Behaviour highlight :");
final CCombo txt3 = new CCombo(group, SWT.BORDER);
txt3.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
PromptSupport.setPrompt("Type anything you want", txt3);
PromptSupport.setFocusBehavior(FocusBehavior.HIGHLIGHT_PROMPT, txt3);
final Label lbl4 = new Label(group, SWT.NONE);
lbl4.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
lbl4.setText("Change colors :");
final CCombo txt4 = new CCombo(group, SWT.BORDER);
txt4.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
PromptSupport.setPrompt("Type anything you want", txt4);
PromptSupport.setForeground(txt4.getDisplay().getSystemColor(SWT.COLOR_YELLOW), txt4);
PromptSupport.setBackground(txt4.getDisplay().getSystemColor(SWT.COLOR_BLACK), txt4);
final Label lbl5 = new Label(group, SWT.NONE);
lbl5.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
lbl5.setText("Change when widget is initialized :");
final CCombo txt5 = new CCombo(group, SWT.BORDER);
txt5.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
txt5.setText("Remove what is typed...");
txt5.setBackground(txt4.getDisplay().getSystemColor(SWT.COLOR_BLACK));
txt5.setForeground(txt4.getDisplay().getSystemColor(SWT.COLOR_YELLOW));
PromptSupport.setPrompt("Type anything you want", txt5);
PromptSupport.setForeground(txt4.getDisplay().getSystemColor(SWT.COLOR_DARK_BLUE), txt5);
PromptSupport.setBackground(txt4.getDisplay().getSystemColor(SWT.COLOR_WHITE), txt5);
}
示例15: ComboVar
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
public ComboVar(VariableSpace space, Composite composite, int flags, String toolTipText,
GetCaretPositionInterface getCaretPositionInterface, InsertTextInterface insertTextInterface) {
super(composite, SWT.NONE);
this.toolTipText = toolTipText;
this.getCaretPositionInterface = getCaretPositionInterface;
this.insertTextInterface = insertTextInterface;
this.variables = space;
//props.setLook(this);
// int margin = Const.MARGIN;
FormLayout formLayout = new FormLayout();
formLayout.marginWidth = 0;
formLayout.marginHeight = 0;
formLayout.marginTop = 0;
formLayout.marginBottom = 0;
this.setLayout(formLayout);
// add a text field on it...
wCombo = new CCombo(this, flags);
controlDecoration = new ControlDecoration(wCombo, SWT.TOP | SWT.RIGHT);
Image image = GUIResource.getInstance().getImageVariable();
controlDecoration.setImage(image);
controlDecoration.setDescriptionText(Messages.getString("TextVar.tooltip.InsertVariable"));
//props.setLook(wText);
wCombo.addModifyListener(getModifyListenerTooltipText(wCombo));
// SelectionAdapter lsVar = null;
// VariableButtonListenerFactory.getSelectionAdapter(this, wText, getCaretPositionInterface,
// insertTextInterface, variables);
//wText.addKeyListener(getControlSpaceKeyListener(variables, wText, lsVar, getCaretPositionInterface,
// insertTextInterface));
controlSpaceKeyAdapter = new ControlSpaceKeyAdapter(variables, wCombo,getCaretPositionInterface, insertTextInterface);
wCombo.addKeyListener(controlSpaceKeyAdapter);
FormData fdText = new FormData();
fdText.top = new FormAttachment(0, 0);
fdText.left = new FormAttachment(0, 0);
fdText.right = new FormAttachment(100, -image.getBounds().width);
wCombo.setLayoutData(fdText);
}