本文整理汇总了Java中org.eclipse.swt.SWT.SINGLE属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.SINGLE属性的具体用法?Java SWT.SINGLE怎么用?Java SWT.SINGLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.SINGLE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDialogArea
@Override
protected Control createDialogArea(Composite parent) {
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
GridLayout layout = new GridLayout(2, false);
container.setLayout(layout);
Label lbtOcciServerUrl = new Label(container, SWT.NONE);
lbtOcciServerUrl.setText(Messages.OcciActionDialog_Label);
final List listOcciActions = new List (container, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL);
listOcciActions.addSelectionListener(
new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
selectedAction = listOcciActions.getSelection()[0];
}
}
);
listOcciActions.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
for(Action action : actions) {
listOcciActions.add(action.getScheme() + action.getTerm());
}
return area;
}
示例2: createProjectSection
/**
* Create the element that allow to select a project See the GraphWalker
* offline command for more information
*/
private void createProjectSection(Composite parent) {
fProjLabel = new Label(parent, SWT.NONE);
fProjLabel.setText(MessageUtil.getString("label_project"));
GridData gd = new GridData();
gd.horizontalIndent = 25;
fProjLabel.setLayoutData(gd);
fProjText = new Text(parent, SWT.SINGLE | SWT.BORDER);
fProjText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
fProjText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent evt) {
validatePage();
updateConfigState();
}
});
fProjText.setData(GW4E_LAUNCH_CONFIGURATION_CONTROL_ID, GW4E_LAUNCH_CONFIGURATION_TEXT_ID_PROJECT);
}
示例3: IntListParameter
public IntListParameter(Composite composite, final String name,
int defaultValue, final String labels[], final int values[]) {
super(name);
this.name = name;
this.values = values;
if(labels.length != values.length)
return;
int value = COConfigurationManager.getIntParameter(name,defaultValue);
int index = findIndex(value,values);
list = new Combo(composite,SWT.SINGLE | SWT.READ_ONLY);
for(int i = 0 ; i < labels.length ;i++) {
list.add(labels[i]);
}
setIndex(index);
list.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event e) {
setIndex(list.getSelectionIndex());
}
});
}
示例4: createStartElementSection
/**
* Create the element that allow to select a start element See the
* GraphWalker offline command for more information
*/
private void createStartElementSection(Composite parent) {
Label fGeneratorLabel = new Label(parent, SWT.NONE);
fGeneratorLabel.setText("Start Element");
gd = new GridData();
gd.horizontalSpan = 1;
gd.horizontalIndent = 25;
fGeneratorLabel.setLayoutData(gd);
fStartNodeText = new Text(parent, SWT.SINGLE | SWT.BORDER);
fStartNodeText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
fStartNodeText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent evt) {
validatePage();
updateConfigState();
fStartNodeText.setFocus();
}
});
fStartNodeText.setData(GW4E_LAUNCH_CONFIGURATION_CONTROL_ID, GW4E_LAUNCH_CONFIGURATION_TEXT_ID_START_ELEMENT);
}
示例5: createPartControl
/**
* Create contents of the view part.
* @param parent
*/
public void createPartControl(Composite parent) {
viewer = new TableViewer(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.SINGLE);
viewer.getTable().setLinesVisible(true);
viewer.getTable().setHeaderVisible(true);
viewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
createColumns(viewer, "Name", "Value", "Type");
viewer.setContentProvider(new ScannableContentProvider(cservice));
try {
viewer.setInput(getMonitors());
} catch (Exception e) {
logger.error("Cannot find selected monitors");
}
}
示例6: createDialogArea
@Override
protected Control createDialogArea( Composite parent ) {
Composite comp = (Composite) super.createDialogArea( parent );
GridLayout layout = (GridLayout) comp.getLayout();
layout.numColumns = 2;
Label usernameLabel = new Label( comp, SWT.RIGHT );
usernameLabel.setText( "Username: " );
usernameText = new Text( comp, SWT.SINGLE | SWT.BORDER );
usernameText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
Label passwordLabel = new Label( comp, SWT.RIGHT );
passwordLabel.setText( "Password: " );
passwordText = new Text( comp, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD );
passwordText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
return comp;
}
示例7: createDestinationGroup
/**
* Create the export destination specification widgets
*/
protected void createDestinationGroup(Composite parent) {
Font font = parent.getFont();
// destination specification group
Composite destinationSelectionGroup = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 3;
destinationSelectionGroup.setLayout(layout);
destinationSelectionGroup.setLayoutData(new GridData(
GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
destinationSelectionGroup.setFont(font);
Label destinationLabel = new Label(destinationSelectionGroup, SWT.NONE);
destinationLabel.setText(getTargetLabel());
destinationLabel.setFont(font);
// destination name entry field
destinationNameField = new Combo(destinationSelectionGroup, SWT.SINGLE
| SWT.BORDER);
destinationNameField.addListener(SWT.Modify, this);
destinationNameField.addListener(SWT.Selection, this);
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
| GridData.GRAB_HORIZONTAL);
data.widthHint = SIZING_TEXT_FIELD_WIDTH;
destinationNameField.setLayoutData(data);
destinationNameField.setFont(font);
// destination browse button
destinationBrowseButton = new Button(destinationSelectionGroup,
SWT.PUSH);
destinationBrowseButton.setText(N4ExportMessages.DataTransfer_browse);
destinationBrowseButton.addListener(SWT.Selection, this);
destinationBrowseButton.setFont(font);
setButtonLayoutData(destinationBrowseButton);
// new Label(parent, SWT.NONE); // vertical spacer
}
示例8: createNameText
private void createNameText(Composite parent) {
this.nameText = new Text(parent, SWT.SINGLE | SWT.BORDER);
FormData data = new FormData();
data.top = new FormAttachment(0, 5);
data.left = new FormAttachment(0, STANDARD_LABEL_WIDTH);
data.right = new FormAttachment(100, 0);
this.nameText.setLayoutData(data);
}
示例9: createOptionsGroupButtons
@Override
protected void createOptionsGroupButtons(Group optionsGroup) {
npmGoalSelection = new Combo(optionsGroup, SWT.SINGLE
| SWT.BORDER);
npmGoalSelection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
npmGoalSelection.addListener(SWT.Modify, this);
npmGoalSelection.addListener(SWT.Selection, this);
}
示例10: createLanguageLayout
/***
* Create the Field where user enters the language used to execute
*
* @param parent container composite
* @param font used font
* @return the created composite containing the fields
*/
public Composite createLanguageLayout(Composite parent, Font font) {
// Language
createTextLabelLayout(parent, "Melange languages");
_languageCombo = new Combo(parent, SWT.NONE);
_languageCombo.setLayoutData(createStandardLayout());
List<String> languagesNames = MelangeHelper.getAllLanguages();
String[] empty = {};
_languageCombo.setItems(languagesNames.toArray(empty));
_languageCombo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
//String selection = _languageCombo.getText();
//List<String> modelTypeNames = MelangeHelper.getModelTypes(selection);
updateLaunchConfigurationDialog();
}
});
createTextLabelLayout(parent, "");
createTextLabelLayout(parent, "Melange resource adapter query");
_melangeQueryText = new Text(parent, SWT.SINGLE | SWT.BORDER);
_melangeQueryText.setLayoutData(createStandardLayout());
_melangeQueryText.setFont(font);
_melangeQueryText.setEditable(false);
createTextLabelLayout(parent, "");
return parent;
}
示例11: createControl
@Override
public void createControl ( final Composite parent )
{
final Composite wrapper = new Composite ( parent, SWT.NONE );
wrapper.setLayout ( new GridLayout ( 3, false ) );
final Label label = new Label ( wrapper, SWT.NONE );
label.setText ( Messages.FileSelectionPage_Label_OutputFile );
label.setLayoutData ( new GridData ( SWT.CENTER, SWT.CENTER, false, false ) );
this.text = new Text ( wrapper, SWT.SINGLE | SWT.BORDER );
this.text.setLayoutData ( new GridData ( SWT.FILL, SWT.CENTER, true, false ) );
final Button button = new Button ( wrapper, SWT.PUSH );
button.setText ( Messages.FileSelectionPage_Button_Browse );
button.addSelectionListener ( new SelectionAdapter () {
@Override
public void widgetSelected ( final SelectionEvent e )
{
updateFile ();
}
} );
setControl ( wrapper );
update ();
}
示例12: TimeZoneCellEditor
public TimeZoneCellEditor ( final Composite composite )
{
super ( composite, TimeZoneWrapper.getAvailable (), new LabelProvider () {
@Override
public String getText ( final Object element )
{
final TimeZoneWrapper tzw = (TimeZoneWrapper)element;
final TimeZone tz = tzw.getTimeZone ();
return String.format ( "%s (%s)", tz.getID (), tz.getDisplayName () );
}
}, true, SWT.SINGLE );
}
示例13: createLabelText
private void createLabelText(Composite parent) {
this.labelText = new Text(parent, SWT.SINGLE | SWT.BORDER);
FormData data = new FormData();
data.top = new FormAttachment(nameText, 5);
data.left = new FormAttachment(0, STANDARD_LABEL_WIDTH);
data.right = new FormAttachment(100, 0);
this.labelText.setLayoutData(data);
}
示例14: createPartControl
@Override
public void createPartControl(Composite parent) {
viewer = new TableViewer(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.SINGLE);
viewer.getTable().setLinesVisible(true);
viewer.getTable().setHeaderVisible(false);
viewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
createColumns(viewer, "", "Name");
try {
this.dservice = ServiceHolder.getEventService().createRemoteService(getUri(), IRunnableDeviceService.class);
viewer.setContentProvider(new DetectorContentProvider(dservice));
} catch (Exception e) {
logger.error("Cannot create content provider", e);
}
viewer.setInput(new Object());
selectionProvider = new DelegatingSelectionProvider(viewer);
getSite().setSelectionProvider(selectionProvider);
createActions();
initializeToolBar();
initializeMenu();
}
示例15: DirBrowseComposite
public DirBrowseComposite(Composite composite) {
super(composite, SWT.NONE);
this.setSize(this.getParent().getBounds().width,
this.getParent().getBounds().height /* buttonHeight*/ );
this.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
GridLayout gridLayout = new GridLayout(3, true);
gridLayout.makeColumnsEqualWidth = false;
this.setLayout(gridLayout);
Label labelDirPath = new Label(this, SWT.NONE);
// gridDateLabel.widthHint = labelWidth;
// gridDateLabel.heightHint = buttonHeight;
labelDirPath.setLayoutData(new GridData(labelWidth, SWT.DEFAULT));
labelDirPath.setText("Template Directory");
final Text dirPathValue = new Text(this, SWT.SINGLE | SWT.BORDER);
GridData gridDateDirPathValue = new GridData(GridData.FILL,
GridData.CENTER, true, false);
gridDateDirPathValue.widthHint = this.getBounds().width - 70;
gridDateDirPathValue.heightHint = buttonHeight;
dirPathValue.setLayoutData(gridDateDirPathValue);
final Button buttonDirBrowse = new Button(this, SWT.PUSH);
GridData gridDataButtonDirBrowse = new GridData(GridData.FILL,
GridData.CENTER, false, false);
gridDataButtonDirBrowse.widthHint = 70;
gridDataButtonDirBrowse.heightHint = buttonHeight;
buttonDirBrowse.setLayoutData(gridDataButtonDirBrowse);
buttonDirBrowse.setText("Browse");
buttonDirBrowse.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
DirectoryDialog dlg = new DirectoryDialog(composite.getShell());
dlg.setFilterPath(dirPathValue.getText());
dlg.setText("Template Directory Dialog");
dlg.setMessage("Select a directory");
String dir = dlg.open();
if (dir != null) {
dirPathValue.setText(dir);
}
}
});
}