Java 类org.eclipse.swt.widgets.Button 实例源码
项目:Hydrograph
文件:FilterHelper.java
/**
* Gets the text box value 1 listener.
*
* @param conditionsList
* the conditions list
* @param fieldsAndTypes
* the fields and types
* @param fieldNames
* the field names
* @param saveButton
* the save button
* @param displayButton
* the display button
* @return the text box value 1 listener
*/
public Listener getTextBoxValue1Listener(final List<Condition> conditionsList,
final Map<String, String> fieldsAndTypes, final String[] fieldNames, final Button saveButton, final Button displayButton) {
Listener listener = new Listener() {
@Override
public void handleEvent(Event event) {
Text text = (Text)event.widget;
int index = (int) text.getData(FilterConstants.ROW_INDEX);
Condition filterConditions = conditionsList.get(index);
filterConditions.setValue1(text.getText());
validateText(text, filterConditions.getFieldName(), fieldsAndTypes, filterConditions.getConditionalOperator());
toggleSaveDisplayButton(conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
}
};
return listener;
}
项目:n4js
文件:PreviewableWizardPage.java
/**
* 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();
}
}
});
}
项目:Open_Source_ECOA_Toolset_AS5
文件:EnumTypesPage.java
@Override
public void mouseUp(MouseEvent e) {
if (((Button) e.getSource()).getText().equalsIgnoreCase("Add")) {
EnumValue val = new EnumValue();
val.setName("");
val.setComment("");
val.setValnum("");
getEnumArr().add(val);
tabValues.refresh();
} else if (((Button) e.getSource()).getText().equalsIgnoreCase("Remove")) {
int[] items = tabValues.getTable().getSelectionIndices();
ArrayList<EnumValue> rem = new ArrayList<EnumValue>();
for (int item : items) {
rem.add(getEnumArr().get(item));
}
getEnumArr().removeAll(rem);
tabValues.refresh();
} else if (((Button) e.getSource()).getText().equalsIgnoreCase("Clear")) {
getEnumArr().clear();
tabValues.refresh();
}
}
项目:Hydrograph
文件:FilterHelper.java
/**
* Gets the text box value 2 listener.
*
* @param conditionsList
* the conditions list
* @param fieldsAndTypes
* the fields and types
* @param fieldNames
* the field names
* @param saveButton
* the save button
* @param displayButton
* the display button
* @return the text box value 2 listener
*/
public Listener getTextBoxValue2Listener(final List<Condition> conditionsList,
final Map<String, String> fieldsAndTypes, final String[] fieldNames, final Button saveButton, final Button displayButton) {
Listener listener = new Listener() {
@Override
public void handleEvent(Event event) {
Text text = (Text)event.widget;
int index = (int) text.getData(FilterConstants.ROW_INDEX);
Condition filterConditions = conditionsList.get(index);
filterConditions.setValue2(text.getText());
validateText(text, filterConditions.getFieldName(), fieldsAndTypes,filterConditions.getConditionalOperator());
toggleSaveDisplayButton(conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
}
};
return listener;
}
项目:Open_Source_ECOA_Toolset_AS5
文件:EventServicePage.java
@Override
public void mouseUp(MouseEvent e) {
if (((Button) e.getSource()).getText().equalsIgnoreCase("Add")) {
Parameter val = new Parameter();
val.setName("");
val.setType("");
getParamArr().add(val);
tabValues.refresh();
} else if (((Button) e.getSource()).getText().equalsIgnoreCase("Remove")) {
int[] items = tabValues.getTable().getSelectionIndices();
ArrayList<Parameter> rem = new ArrayList<Parameter>();
for (int item : items) {
rem.add(getParamArr().get(item));
}
getParamArr().removeAll(rem);
tabValues.refresh();
} else if (((Button) e.getSource()).getText().equalsIgnoreCase("Clear")) {
getParamArr().clear();
tabValues.refresh();
}
}
项目:Open_Source_ECOA_Toolset_AS5
文件:TypesEditor.java
@Override
public void mouseUp(MouseEvent e) {
if (e.getSource() instanceof Button) {
Button sel = (Button) e.getSource();
if (sel.getText().equalsIgnoreCase("Save")) {
try {
String tempText = util.processAdd(isEdit, editName, comp, type, editor.getDocumentProvider().getDocument(getEditorInput()).get());
editor.getDocumentProvider().getDocument(getEditorInput()).set(tempText);
createPage1();
setActivePage(1);
} catch (JAXBException ex) {
ErrorDialog.openError(getSite().getShell(), "Error removing item", null, new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, "Error removing item", null));
}
}
}
}
项目:BiglyBT
文件:BuddyPluginView.java
private void
setupButtonGroup(
final List<Button> buttons )
{
for ( final Button b: buttons ){
b.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if ( !b.getSelection()){
b.setSelection( true );
}
for ( Button b2: buttons ){
if ( b2 != b ){
b2.setSelection( false );
}
}
}});
}
Utils.makeButtonsEqualWidth( buttons );
}
项目:Hydrograph
文件:ELTSchemaGridWidget.java
private void addImportSchemaButton(ELTSchemaSubgroupComposite buttonSubGroup) {
importSchemaButton = new ELTDefaultButton("");
SchemaButtonsSyncUtility.INSTANCE.buttonSize(importSchemaButton, macButtonWidth, macButtonHeight,
windowButtonWidth, windowButtonHeight);
buttonSubGroup.attachWidget(importSchemaButton);
importSchemaButton.setImage(ImagePathConstant.IMPORT_SCHEMA_BUTTON);
importSchemaButton.setToolTipText(Messages.IMPORT_SCHEMA_KEY_SHORTCUT_TOOLTIP);
Button importButton = (Button) importSchemaButton.getSWTWidgetControl();
importButton.addMouseListener(new MouseAdapter() {
@Override
public void mouseDown(MouseEvent e) {
importSchema(importButton);
}
});
}
项目:Hydrograph
文件:ELTSchemaDialogSelectionListener.java
@Override
public Listener getListener(final PropertyDialogButtonBar propertyDialogButtonBar,
ListenerHelper helpers, final Widget... widgets) {
final Button button = ((Button)widgets[0]);
button.getShell();
if(helpers != null){
txtDecorator = (ControlDecoration) helpers.get(HelperType.CONTROL_DECORATION);
file_extension=(String)helpers.get(HelperType.FILE_EXTENSION);
}
Listener listener=new Listener() {
@Override
public void handleEvent(Event event) {
if(event.type==SWT.Selection){
FilterOperationClassUtility.INSTANCE.browseFile(file_extension,((Text) widgets[0]));
propertyDialogButtonBar.enableApplyButton(true);
txtDecorator.hide();
}
}
};
return listener;
}
项目:Hydrograph
文件:HeaderAndDataFormattingDialog.java
private void addSelectionListeneronButton(Button button, TableEditor editor) {
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
ColorDialog dlg = new ColorDialog(Display.getCurrent().getActiveShell());
dlg.setRGB(new RGB(0, 0, 0));
RGB rgb = dlg.open();
if (rgb != null) {
Color color = new Color(shell.getDisplay(), rgb);
String colorValue = convertRGBToHEX(rgb);
editor.getItem().setText(1, colorValue);
color.dispose();
}
}
});
}
项目:Hydrograph
文件:SourceSelectionPage.java
protected void addRadioButton(Composite container) {
Composite composite_1 = new Composite(container, SWT.NONE);
composite_1.setLayout(new GridLayout(1, false));
composite_1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
xmlRadioButton = new Button(composite_1, SWT.RADIO);
xmlRadioButton.setText("XML File");
xmlRadioButton.setEnabled(true);
xmlRadioButton.setSelection(true);
xsdRadioButton = new Button(composite_1, SWT.RADIO);
xsdRadioButton.setText("XSD File");
addSelectionListenerOnXMLRadioBtn();
addSelectionListenerOnXSDRadioBtn();
}
项目:Hydrograph
文件:OutputRecordCountWidget.java
private void attachRadioButtonToComposite(Composite radioButtonsComposite)
{
expressionRadioButton=new Button(radioButtonsComposite, SWT.RADIO);
if(OSValidator.isMac())
{
expressionRadioButton.setText(Messages.MAC_EXPRESSION_EDITIOR_LABEL);
}
else
{
expressionRadioButton.setText(Messages.WINDOWS_EXPRESSION_EDITIOR_LABEL);
}
operationRadioButton = new Button(radioButtonsComposite, SWT.RADIO);
operationRadioButton.setText(Messages.OPERATION_CALSS_LABEL);
addSelectionListenerToExpressionRadioButton(expressionRadioButton);
addSelectionListenerToOperationRadioButton(operationRadioButton);
if(transformMapping.isExpression())
{
expressionRadioButton.setSelection(true);
}
else
{
operationRadioButton.setSelection(true);
}
}
项目:Hydrograph
文件:ELTCheckFileExtensionListener.java
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar,ListenerHelper helpers, Widget... widgets) {
final Widget[] widgetList = widgets;
Listener listener=new Listener() {
@Override
public void handleEvent(Event event) {
if(!((Button)widgetList[1]).getSelection()){
ControlDecoration fieldNameMustJava = WidgetUtility.addDecorator((Text)widgetList[0],Messages.INVALID_FILE);
if(!WidgetUtility.isFileExtention((((Text)widgetList[0]).getText()).trim(), ".java") && !(((Text)widgetList[0]).getText().trim().isEmpty())){
fieldNameMustJava.show();
((Text)widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255,
255, 204));
}
else
{
((Text)widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255,
255, 255));
fieldNameMustJava.hide();
}
}
}
};
return listener;
}
项目:eZooKeeper
文件:ZnodeNewWizardComposite1.java
public Znode getZnode() throws Exception {
byte[] data = getZnodeData();
ZnodeModel parentZnodeModel = getParentZnodeModel();
Text pathText = (Text) getControl(CONTROL_NAME_PATH_TEXT);
String relativePath = pathText.getText();
Znode parentZnode = parentZnodeModel.getData();
String parentPath = parentZnode.getPath();
String absolutePath = Znode.getAbsolutePath(parentPath, relativePath);
Button sequentialCheckbox = (Button) getControl(CONTROL_NAME_CREATE_MODE_SEQUENTIAL_BUTTON);
boolean isSequential = sequentialCheckbox.getSelection();
Button ephemeralRadioButton = (Button) getControl(CONTROL_NAME_CREATE_MODE_EPHEMERAL_BUTTON);
boolean isEphemeral = ephemeralRadioButton.getSelection();
Znode znode = new Znode(absolutePath);
znode.setSequential(isSequential);
znode.setEphemeral(isEphemeral);
znode.setData(data);
return znode;
}
项目:Hydrograph
文件:FTPAuthenticEditorUtility.java
/**
* @param container
* @return
*/
public Control addIdKeyComposite(Composite container, FTPAuthOperationDetails authOperationDetails) {
Composite keyFileComposite = new Composite(container, SWT.BORDER);
keyFileComposite.setLayout(new GridLayout(3, false));
keyFileComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
FTPWidgetUtility ftpWidgetUtility = new FTPWidgetUtility();
ftpWidgetUtility.createLabel(keyFileComposite, "User ID");
ftpWidgetUtility.createText(keyFileComposite, "", SWT.BORDER);
Button keyFileBrwsBtn1 = new Button(keyFileComposite, SWT.NONE);
keyFileBrwsBtn1.setVisible(false);
ftpWidgetUtility.createLabel(keyFileComposite, "Public/Private Key");
Text privateKeyTxt = (Text) ftpWidgetUtility.createText(keyFileComposite, "", SWT.BORDER);
Button keyFileBrwsBtn = new Button(keyFileComposite, SWT.NONE);
keyFileBrwsBtn.setText("...");
selectionListener(keyFileBrwsBtn, privateKeyTxt);
return keyFileComposite;
}
项目:gw4e.project
文件:GW4ELaunchConfigurationTab.java
private void createRemoveBlockedElementGroup (Composite parent) {
Label lfiller = new Label(parent, SWT.NONE);
lfiller.setText("");
Label lblRemoveBlockedElement = new Label(parent, SWT.NONE);
lblRemoveBlockedElement.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblRemoveBlockedElement.setText(MessageUtil.getString("removeBlockedElement"));
removeBockedElementButton = new Button(parent, SWT.CHECK);
removeBockedElementButton.setText("");
removeBockedElementButton.setSelection(true);
removeBockedElementButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
validatePage();
}
});
}
项目:neoscada
文件:DefaultPage.java
@Override
protected Control createContents ( final Composite parent )
{
final Composite wrapper = new Composite ( parent, SWT.NONE );
wrapper.setLayout ( new GridLayout ( 1, false ) );
final Label label = new Label ( wrapper, SWT.NONE );
label.setText ( "Preferences for Eclipse SCADA Security" );
final Button testButton = new Button ( wrapper, SWT.NONE );
testButton.setText ( "Test key selection…" );
testButton.addSelectionListener ( new SelectionAdapter () {
@Override
public void widgetSelected ( final SelectionEvent e )
{
openDialog ();
}
} );
return wrapper;
}
项目:Hydrograph
文件:FilterConditionsDialog.java
private void addButtonInTable(TableViewer tableViewer, TableItem tableItem, String columnName,
String buttonPaneName, String editorName, int columnIndex, SelectionListener buttonSelectionListener,
ImagePathConstant imagePath) {
final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
buttonPane.setLayout(new FillLayout());
final Button button = new Button(buttonPane, SWT.NONE);
//button.setText(columnName);
button.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
tableItem.setData(columnName, button);
tableItem.setData(buttonPaneName, buttonPane);
button.addSelectionListener(buttonSelectionListener);
button.setImage(imagePath.getImageFromRegistry());
final TableEditor editor = new TableEditor(tableViewer.getTable());
editor.grabHorizontal = true;
editor.grabVertical = true;
editor.setEditor(buttonPane, tableItem, columnIndex);
editor.layout();
button.setData(editorName, editor);
}
项目:Hydrograph
文件:JobRunPreferenceComposite.java
/**
* @param selection
*/
private void createSaveJobPromtGroup(String selection) {
HydroGroup hydroGroup = new HydroGroup(this, SWT.NONE);
hydroGroup.setHydroGroupText(Messages.SAVE_JOBS_BEFORE_LAUNCHING_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));
hydroGroup.getHydroGroupClientArea().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
btnRadioButtonAlways = new Button(hydroGroup.getHydroGroupClientArea(), SWT.RADIO);
btnRadioButtonAlways.setText(StringUtils.capitalize((MessageDialogWithToggle.ALWAYS)));
btnRadioButtonPrompt = new Button(hydroGroup.getHydroGroupClientArea(), SWT.RADIO);
btnRadioButtonPrompt.setText(StringUtils.capitalize(MessageDialogWithToggle.PROMPT));
if (StringUtils.equals(selection, MessageDialogWithToggle.ALWAYS)) {
btnRadioButtonAlways.setSelection(true);
} else {
btnRadioButtonPrompt.setSelection(true);
}
}
项目:neoscada
文件:ResetControllerImpl.java
public ResetControllerImpl ( final ControllerManager controllerManager, final ChartContext chartContext, final ResetController controller )
{
final Composite space = chartContext.getExtensionSpaceProvider ().getExtensionSpace ();
this.resetHandler = chartContext.getResetHandler ();
if ( space != null && this.resetHandler != null )
{
this.button = new Button ( space, SWT.PUSH );
this.button.setText ( Messages.ResetControllerImpl_Label );
this.button.addSelectionListener ( new SelectionAdapter () {
@Override
public void widgetSelected ( final SelectionEvent e )
{
action ();
}
} );
space.layout ();
}
else
{
this.button = null;
}
}
项目:OCCI-Studio
文件:LoadExtensionDialog.java
protected void prepareBrowseRegisteredPackagesButton(
Button browseRegisteredPackagesButton) {
browseRegisteredPackagesButton
.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
RegisteredExtensionsDialog registeredExtensionsDialog = new RegisteredExtensionsDialog(
getShell());
registeredExtensionsDialog.open();
Object[] result = registeredExtensionsDialog
.getResult();
if (result != null) {
StringBuffer schemes = new StringBuffer();
for (int i = 0, length = result.length; i < length; i++) {
schemes.append(OcciRegistry.getInstance()
.getExtensionURI(
String.valueOf(result[i])));
schemes.append(" "); //$NON-NLS-1$
}
uriField.setText((uriField.getText() + " " + schemes //$NON-NLS-1$
.toString()).trim());
}
}
});
}
项目:neoscada
文件:TrendControlImage.java
public TrendControlImage ( final Composite parent, final int style, final String connectionId, final String itemId, final String queryString )
{
super ( parent, style );
this.connectionId = connectionId;
this.itemId = itemId;
this.queryString = queryString;
setLayout ( new FillLayout () );
final Button button = new Button ( parent, SWT.PUSH | SWT.FLAT );
button.setImage ( org.eclipse.scada.vi.details.swt.Activator.getDefault ().getImageRegistry ().get ( org.eclipse.scada.vi.details.swt.Activator.IMG_TREND ) );
button.addSelectionListener ( new SelectionAdapter () {
@Override
public void widgetSelected ( final SelectionEvent e )
{
startHdView ();
}
} );
}
项目:Open_Source_ECOA_Toolset_AS5
文件:EventServiceComposite.java
@Override
public void mouseUp(MouseEvent e) {
if (((Button) e.getSource()).getText().equalsIgnoreCase("Add")) {
Parameter val = new Parameter();
val.setName("");
val.setType("");
getParamArr().add(val);
tabValues.refresh();
} else if (((Button) e.getSource()).getText().equalsIgnoreCase("Remove")) {
int[] items = tabValues.getTable().getSelectionIndices();
ArrayList<Parameter> rem = new ArrayList<Parameter>();
for (int item : items) {
rem.add(getParamArr().get(item));
}
getParamArr().removeAll(rem);
tabValues.refresh();
} else if (((Button) e.getSource()).getText().equalsIgnoreCase("Clear")) {
getParamArr().clear();
tabValues.refresh();
}
}
项目:Hydrograph
文件:ParameterGridDialog.java
public void addGridRowSelectionListener(){
for(Composite row: textGrid.getGrid()){
//((Button)row.getChildren()[0]).
((Button)row.getChildren()[0]).addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
// TODO Auto-generated method stub
super.widgetSelected(e);
changeHeaderCheckboxSelection();
}
});
}
}
项目:gw4e.project
文件:LabelizedCheckBoxes.java
/**
* Create the composite.
* @param parent
* @param style
*/
public LabelizedCheckBoxes(Composite parent,
int style,
String [] labels,
boolean [] enabled,
boolean [] checked,
SelectionAdapter [] checkBoxSelectionAdapters) {
super(parent, style);
setLayout(new GridLayout(10, false));
buttons = new Button [labels.length];
for (int i = 0; i < labels.length; i++) {
buttons [i] = new Button(parent, SWT.CHECK);
buttons [i].setEnabled(enabled [i]);
buttons [i].setSelection(checked [i]);
buttons [i].setText(labels [i]);
if (checkBoxSelectionAdapters[i]!=null) {
buttons [i].addSelectionListener(checkBoxSelectionAdapters[i]);
}
buttons [i].setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 6, 1));
buttons [i].setData(PROJECT_PROPERTY_PAGE_WIDGET_ID, BUTTON+"."+i);
}
}
项目:applecommander
文件:DiskImageFormatPane.java
/**
* Create a radio button for the disk image format list.
*/
protected void createRadioButton(Composite composite, String label,
final int format, String helpText) {
Button button = new Button(composite, SWT.RADIO);
button.setText(label);
button.setSelection(wizard.getFormat() == format);
button.setToolTipText(helpText);
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
getWizard().setFormat(format);
}
});
}
项目:time4sys
文件:GeneralPropertiesEditionPartImpl.java
protected Composite createIsAtomicCheckbox(Composite parent) {
isAtomic = new Button(parent, SWT.CHECK);
isAtomic.setText(getDescription(GqamViewsRepository.General.Properties.isAtomic,
GqamMessages.GeneralPropertiesEditionPart_IsAtomicLabel));
isAtomic.addSelectionListener(new SelectionAdapter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*
*/
public void widgetSelected(SelectionEvent e) {
if (propertiesEditionComponent != null)
propertiesEditionComponent
.firePropertiesChanged(new PropertiesEditionEvent(GeneralPropertiesEditionPartImpl.this,
GqamViewsRepository.General.Properties.isAtomic, PropertiesEditionEvent.COMMIT,
PropertiesEditionEvent.SET, null, new Boolean(isAtomic.getSelection())));
}
});
GridData isAtomicData = new GridData(GridData.FILL_HORIZONTAL);
isAtomicData.horizontalSpan = 2;
isAtomic.setLayoutData(isAtomicData);
EditingUtils.setID(isAtomic, GqamViewsRepository.General.Properties.isAtomic);
EditingUtils.setEEFtype(isAtomic, "eef::Checkbox"); //$NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent
.getHelpContent(GqamViewsRepository.General.Properties.isAtomic, GqamViewsRepository.SWT_KIND), null); // $NON-NLS-1$
// Start of user code for createIsAtomicCheckbox
// End of user code
return parent;
}
项目:BiglyBT
文件:BuddyPluginView.java
private void
selectButtonGroup(
List<Button> buttons,
int data )
{
for ( Button b: buttons ){
b.setSelection( (Integer)b.getData() == data );
}
}
项目:n4js
文件:InterfacesComponentProvider.java
/**
* Creates a new interfaces component inside the parent composite using the given model.
*
* @param interfacesContainingModel
* A interface containing model
* @param container
* The component container
*/
public InterfacesComponent(InterfacesContainingModel interfacesContainingModel,
WizardComponentContainer container) {
super(container);
this.model = interfacesContainingModel;
Composite parent = getParentComposite();
Label interfacesLabel = new Label(parent, SWT.NONE);
GridData interfacesLabelGridData = fillLabelDefaults();
interfacesLabelGridData.verticalAlignment = SWT.TOP;
interfacesLabel.setLayoutData(interfacesLabelGridData);
interfacesLabel.setText("Interfaces:");
interfacesTable = new Table(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.VIRTUAL);
interfacesTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
Composite interfacesButtonsComposite = new Composite(parent, SWT.NONE);
interfacesButtonsComposite.setLayoutData(GridDataFactory.fillDefaults().create());
interfacesButtonsComposite.setLayout(GridLayoutFactory.swtDefaults().numColumns(1).margins(0, 0).create());
interfacesAddButton = new Button(interfacesButtonsComposite, SWT.NONE);
interfacesAddButton.setText("Add...");
interfacesAddButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
interfacesRemoveButton = new Button(interfacesButtonsComposite, SWT.NONE);
interfacesRemoveButton.setText("Remove");
interfacesRemoveButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
setupBindings();
}
项目:codelens-eclipse
文件:ViewZoneDemo.java
public static void main(String[] args) throws Exception {
// create the widget's shell
Shell shell = new Shell();
shell.setLayout(new FillLayout());
shell.setSize(500, 500);
Display display = shell.getDisplay();
Composite parent = new Composite(shell, SWT.NONE);
parent.setLayout(new GridLayout(2, false));
ITextViewer textViewer = new TextViewer(parent, SWT.V_SCROLL | SWT.BORDER);
textViewer.setDocument(new Document(""));
StyledText styledText = textViewer.getTextWidget();
styledText.setLayoutData(new GridData(GridData.FILL_BOTH));
ViewZoneChangeAccessor viewZones = new ViewZoneChangeAccessor(textViewer);
Button add = new Button(parent, SWT.NONE);
add.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false, 0, 0));
add.setText("Add Zone");
add.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
InputDialog dlg = new InputDialog(Display.getCurrent().getActiveShell(), "", "Enter view zone content",
"Zone " + viewZones.getSize(), null);
if (dlg.open() == Window.OK) {
int line = styledText.getLineAtOffset(styledText.getCaretOffset());
IViewZone zone = new DefaultViewZone(line, 20, dlg.getValue());
viewZones.addZone(zone);
viewZones.layoutZone(zone);
}
}
});
shell.open();
while (!shell.isDisposed())
if (!display.readAndDispatch())
display.sleep();
}
项目:Hydrograph
文件:ExpressionComposite.java
private void createSwitchToExpressionButton(Composite switchToCompsite) {
expressionRadioButton = new Button(switchToCompsite, SWT.RADIO);
expressionRadioButton.setText("Expression");
expressionRadioButton.setSelection(true);
expressionRadioButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
// dialog.switchToExpression();
// dialog.getDataStructure().setOperation(false);
// dialog.refreshErrorLogs();
}
});
}
项目:convertigo-eclipse
文件:NewProjectWizardComposite6.java
/**
* This method initializes group
*
*/
private void createGroup() {
GridData gridData1 = new GridData();
gridData1.horizontalAlignment = GridData.BEGINNING;
gridData1.grabExcessHorizontalSpace = true;
gridData1.verticalAlignment = GridData.CENTER;
GridData gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.verticalAlignment = GridData.CENTER;
GridLayout gridLayout1 = new GridLayout();
gridLayout1.numColumns = 2;
GridData gridData3 = new GridData();
gridData3.horizontalAlignment = GridData.FILL;
gridData3.horizontalSpan = 2;
gridData3.grabExcessHorizontalSpace = true;
gridData3.grabExcessVerticalSpace = false;
gridData3.verticalAlignment = GridData.FILL;
group = new Group(this, SWT.NONE);
group.setText("Target Server");
group.setLayoutData(gridData3);
group.setLayout(gridLayout1);
label = new Label(group, SWT.NONE);
label.setText("HTTP Server");
httpServer = new Text(group, SWT.BORDER);
httpServer.setLayoutData(gridData);
label2 = new Label(group, SWT.NONE);
label2.setText("HTTP Port");
httpPort = new Text(group, SWT.BORDER);
httpPort.setLayoutData(gridData1);
label3 = new Label(group, SWT.NONE);
label3.setText("SSL");
ssl = new Button(group, SWT.CHECK);
httpServer.addModifyListener(modifyListener);
httpPort.addModifyListener(modifyListener);
ssl.addSelectionListener(selectionListener);
}
项目:Hydrograph
文件:OperationComposite.java
private void createExpressionEditingTextBox(Composite composite_1) {
Composite composite = new Composite(composite_1, SWT.NONE);
composite.setLayout(new GridLayout(2, false));
GridData gd_composite = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
gd_composite.heightHint = 29;
composite.setLayoutData(gd_composite);
logicTextBox = new Text(composite, SWT.BORDER);
logicTextBox.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
logicTextBox.setEditable(false);
logicTextBox.setText(operationDataStructure.getQualifiedOperationClassName());
Button openEditorButton = new Button(composite, SWT.NONE);
openEditorButton.setText("...");
openEditorButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
ELTOperationClassDialog eltOperationClassDialog = new ELTOperationClassDialog(
Display.getCurrent().getActiveShell(), dialog.getPropertyDialogButtonBar(),
createDSForClassWindow(), dialog.getWidgetConfig(), dialog.getComponent().getComponentName());
eltOperationClassDialog.open();
updateOperationDS(eltOperationClassDialog);
if (eltOperationClassDialog.isYesPressed()) {
dialog.pressOK();
} else if (eltOperationClassDialog.isNoPressed()) {
dialog.pressCancel();
}
dialog.refreshErrorLogs();
}
});
}
项目:n4js
文件:N4MFWizardNewProjectCreationPage.java
private Composite initDefaultOptionsUI(DataBindingContext dbc, Composite parent) {
// A group for default options
final Group defaultOptions = new Group(parent, NONE);
defaultOptions.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).create());
final Button createGreeterFileButton = new Button(defaultOptions, CHECK);
createGreeterFileButton.setText("Create a greeter file");
initDefaultCreateGreeterBindings(dbc, createGreeterFileButton);
return defaultOptions;
}
项目:Hydrograph
文件:TransformDialog.java
private void attachListenerOnSwitchToClassButton(
final ExpandItem expandItem,
final OperationClassComposite operationClassComposite,
final AbstractExpressionComposite expressionComposite) {
expressionComposite.getSwitchToClassButton().addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e)
{
Button toggleButton=(Button)e.widget;
if(toggleButton.getSelection())
{
toggleButton.setSelection(false);
expandItem.setControl(operationClassComposite);
expandItem.setText(operationClassComposite.getOperationIdTextBox().getText());
MappingSheetRow mappingSheetRowForExpressionClass=(MappingSheetRow)expressionComposite.getData(Messages.MAPPING_SHEET);
MappingSheetRow mappingSheetRowForOperationClass=
(MappingSheetRow)operationClassComposite.getBrowseButton().getData(Messages.MAPPING_SHEET);
removeExpressionOrOperationOutputFieldFromOutputList(mappingSheetRowForExpressionClass);
transformMapping.getOutputFieldList().addAll(mappingSheetRowForOperationClass.getOutputList());
mappingSheetRowForExpressionClass.setActive(false);
mappingSheetRowForOperationClass.setActive(true);
operationClassComposite.getSwitchToClassButton().setSelection(true);
expressionComposite.setVisible(false);
operationClassComposite.setVisible(true);
setDuplicateOperationInputFieldMap(mappingSheetRowForOperationClass);
refreshOutputTable();
showHideValidationMessage();
if(Constants.AGGREGATE.equalsIgnoreCase(component.getComponentName())||
Constants.TRANSFORM.equalsIgnoreCase(component.getComponentName()) ||
Constants.GROUP_COMBINE.equalsIgnoreCase(component.getComponentName()))
{
// expandItem.setHeight(220);
// middleSashForm.setWeights(new int[] {54, 59, 25});
scrolledComposite.setMinSize(expandBar.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
}
}
});
}
项目:Hydrograph
文件:MultiParameterFileDialog.java
/**
* Create contents of the button bar.
*
* @param parent
*/
@Override
protected void createButtonsForButtonBar(Composite parent) {
Button okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,true);
okButton.setFocus();
applyButton = createButton(parent, IDialogConstants.NO_ID, "Apply", false);
applyButton.setEnabled(false);
createButton(parent, IDialogConstants.CANCEL_ID,IDialogConstants.CANCEL_LABEL, false);
}
项目:Hydrograph
文件:FTPOperationConfigUtility.java
/**
* @param control
* @return
*/
public Control addLocalRemoteRemoveFiles(Composite control){
Composite composite = new Composite(control, SWT.BORDER);
composite.setLayout(new GridLayout(3, false));
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
FTPWidgetUtility ftpWidgetUtility = new FTPWidgetUtility();
ftpWidgetUtility.createLabel(composite, "Local Path");
Text localPathTxt = (Text) ftpWidgetUtility.createText(composite, "", SWT.BORDER);
Button localPathBrwsBtn = new Button(composite, SWT.NONE);
localPathBrwsBtn.setText("...");
selectionListener(localPathBrwsBtn, localPathTxt);
ftpWidgetUtility.createLabel(composite, "File Name");
ftpWidgetUtility.createText(composite, "", SWT.BORDER);
return composite;
}
项目:n4js
文件:N4MFWizardNewProjectCreationPage.java
@SuppressWarnings("unchecked")
private void initTestProjectBinding(DataBindingContext dbc, Button addNormalSourceFolderButton,
Button createTestGreeterFileButton) {
// Bind the "normal source folder"-checkbox
dbc.bindValue(WidgetProperties.selection().observe(addNormalSourceFolderButton),
PojoProperties.value(N4MFProjectInfo.class, N4MFProjectInfo.ADDITIONAL_NORMAL_SOURCE_FOLDER_PROP_NAME)
.observe(projectInfo));
// Bind the "Create greeter file"-checkbox
dbc.bindValue(WidgetProperties.selection().observe(createTestGreeterFileButton),
BeanProperties.value(N4MFProjectInfo.class, N4MFProjectInfo.CREATE_GREETER_FILE_PROP_NAME)
.observe(projectInfo));
}
项目:SimQRI
文件:StoragePropertiesEditionPartImpl.java
protected Composite createOverflowCheckbox(Composite parent) {
overflow = new Button(parent, SWT.CHECK);
overflow.setText(getDescription(MetamodelViewsRepository.Storage.Properties.overflow, MetamodelMessages.StoragePropertiesEditionPart_OverflowLabel));
overflow.addSelectionListener(new SelectionAdapter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*
*/
public void widgetSelected(SelectionEvent e) {
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(StoragePropertiesEditionPartImpl.this, MetamodelViewsRepository.Storage.Properties.overflow, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new Boolean(overflow.getSelection())));
}
});
GridData overflowData = new GridData(GridData.FILL_HORIZONTAL);
overflowData.horizontalSpan = 2;
overflow.setLayoutData(overflowData);
EditingUtils.setID(overflow, MetamodelViewsRepository.Storage.Properties.overflow);
EditingUtils.setEEFtype(overflow, "eef::Checkbox"); //$NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(MetamodelViewsRepository.Storage.Properties.overflow, MetamodelViewsRepository.SWT_KIND), null); //$NON-NLS-1$
// Start of user code for createOverflowCheckbox
// End of user code
return parent;
}
项目:Hydrograph
文件:AggregateCumulateExpressionComposite.java
/**
* @param isParam
* @param isWholeOperationParameter
*/
private void disabledWidgetsifWholeExpressionIsParameterForAggregateCumulate(Button isParam,
boolean isWholeOperationParameter) {
if (isWholeOperationParameter) {
Text textAccumulator = (Text) isParam.getData(Messages.TEXT_ACCUMULATOR);
Button isParamAccumulator = (Button) isParam.getData(Messages.ISPARAM_ACCUMULATOR);
Combo comboDataTypes = (Combo) isParam.getData(Messages.COMBODATATYPES);
textAccumulator.setEnabled(false);
isParamAccumulator.setEnabled(false);
comboDataTypes.setEnabled(false);
super.disabledWidgetsifWholeExpressionIsParameter(isParamAccumulator, isWholeOperationParameter);
}
}