本文整理匯總了Java中org.eclipse.swt.widgets.List.setSize方法的典型用法代碼示例。如果您正苦於以下問題:Java List.setSize方法的具體用法?Java List.setSize怎麽用?Java List.setSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.List
的用法示例。
在下文中一共展示了List.setSize方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initialize
import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
/**
* This method initializes this
*
*/
private void initialize() {
ScreenClassTrigger trigger = (parent.getTrigger() instanceof ScreenClassTrigger) ? (ScreenClassTrigger) parent
.getTrigger() : null;
scrClass_label = new Label(this, SWT.NONE);
scrClass_label.setText("Screen classes");
scrClass_list = new List(this, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
java.util.List<HtmlScreenClass> scList = getScreenClassList();
java.util.List<String> items = new ArrayList<String>();
for (ScreenClass sc : scList) {
String scName = sc.getName();
scrClass_list.add(scName);
if (trigger != null) {
if (trigger.getScreenClasses().contains(scName)) {
items.add(scName);
}
}
}
scrClass_list.setSelection(items.toArray(new String[items.size()]));
GridData gridData2 = new GridData();
gridData2.horizontalAlignment = GridData.FILL;
gridData2.verticalAlignment = GridData.FILL;
gridData2.grabExcessHorizontalSpace = true;
scrClass_list.setLayoutData(gridData2);
scrClass_list.setSize(400, 250);
}
示例2: createContents
import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
@Override
protected Control createContents(Composite parent) {
Composite container = new Composite(parent, SWT.NONE);
GridLayout gridLayout = new GridLayout(2, false);
container.setLayout(gridLayout);
//Initialize and populate list
final List list = new List(container, SWT.NONE);
list.setLayoutData(new GridData(SWT.FILL));
populateList(list);
list.setSelection(0);
list.setSize(10, 20);
list.addSelectionListener(new SomeSelectionListener(list));
Composite selectorContainer = new Composite(container, SWT.NONE);
selectorContainer.setLayout(new GridLayout(1, false));
String selection = options[0];
//Add color editor
Composite colorContainer = new Composite(selectorContainer, SWT.NONE);
color = new ColorFieldEditor(RustConstants.SYNTAXCOLOR_COLOR + selection, "Color", colorContainer);
//Create and add style group
Group styleContainer = new Group(selectorContainer, SWT.NONE);
styleContainer.setText("Style");
GridLayout gridLayout2 = new GridLayout(1, false);
styleContainer.setLayout(gridLayout2);
Composite styleBoldContainer = new Composite(styleContainer, SWT.NONE);
Composite styleItalicContainer = new Composite(styleContainer, SWT.NONE);
Composite styleUnderlineContainer = new Composite(styleContainer, SWT.NONE);
Composite styleStrikethroughContainer = new Composite(styleContainer, SWT.NONE);
styleBold = new BooleanFieldEditor(RustConstants.SYNTAXCOLOR_BOLD + selection, "Bold", styleBoldContainer);
styleItalic = new BooleanFieldEditor(RustConstants.SYNTAXCOLOR_ITALIC + selection, "Italic", styleItalicContainer);
styleUnderline = new BooleanFieldEditor(RustConstants.SYNTAXCOLOR_UNDERLINE + selection, "Underline", styleUnderlineContainer);
styleStrikethrough = new BooleanFieldEditor(RustConstants.SYNTAXCOLOR_STRIKETHROUGH + selection, "Strike through", styleStrikethroughContainer);
//Link editors with the default preferenceStore
color.setPreferenceStore(RustCorePlugin.getDefaultPreferenceStore());
styleBold.setPreferenceStore(RustCorePlugin.getDefaultPreferenceStore());
styleItalic.setPreferenceStore(RustCorePlugin.getDefaultPreferenceStore());
styleUnderline.setPreferenceStore(RustCorePlugin.getDefaultPreferenceStore());
styleStrikethrough.setPreferenceStore(RustCorePlugin.getDefaultPreferenceStore());
//Load values for keyword
updateEditors(selection);
return container;
}