Java 类org.eclipse.swt.events.SelectionEvent 实例源码

项目:Hydrograph    文件:SelectionDatabaseWidget.java   
/**
 * 
 * @param selectionComposite
 * @param layout
 */
private void attachTableButtonListner(final ELTSubGroupCompositeWithStack selectionComposite,
        final StackLayout layout) {
    final Button tableRadioBtn = (Button) tableNameRadioButton.getSWTWidgetControl();
    tableRadioBtn.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            if (tableRadioBtn.getSelection()) {
                unRegisterTableOrSQLQueryTextListner();
                layout.topControl = tableComposite.getContainerControl();
                selectionComposite.getContainerControl().layout();
                if (databaseSelectionConfig != null) {
                    databaseSelectionConfig.setTableNameSelection(true);
                    databaseSelectionConfig.setTableName(textBoxTableName.getText());
                    populateWidget();
                }
                showHideErrorSymbol(widgets);
                propertyDialogButtonBar.enableApplyButton(true);
            }
        }
    });
}
项目:com.onpositive.prefeditor    文件:ViewerPage.java   
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("");
        }

    });
}
项目:Hydrograph    文件:UpdateByKeysWidget.java   
private void attachButtonListner(Button selectKeysButton) {
    selectKeysButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {

            String buttonText = Messages.UPDATE_KEYS_WINDOW_LABEL;
            FieldDialog fieldDialog = new FieldDialog(new Shell(), propertyDialogButtonBar);
            fieldDialog.setComponentName(buttonText);
            fieldDialog.setSourceFieldsFromPropagatedSchema(getPropagatedSchema());
            if(StringUtils.isNotBlank(updateByKeysTextBox.getText())){
                fieldDialog.setPropertyFromCommaSepratedString(updateByKeysTextBox.getText());
            }
            fieldDialog.open();
            String valueForNewTableTextBox = fieldDialog.getResultAsCommaSeprated();
            if(valueForNewTableTextBox !=null){
                updateByKeysTextBox.setText(valueForNewTableTextBox);
            }
            showHideErrorSymbol(widgets);
        }
    });

}
项目:android-uiautomatorviewer    文件:ScreenshotAction.java   
@Override
protected Control createDialogArea(Composite parentShell) {
  Composite parent = (Composite) super.createDialogArea(parentShell);
  Composite c = new Composite(parent, SWT.NONE);

  c.setLayout(new GridLayout(2, false));

  Label l = new Label(c, SWT.NONE);
  l.setText("Select device: ");

  final Combo combo = new Combo(c, SWT.BORDER | SWT.READ_ONLY);
  combo.setItems(mDeviceNames);
  int defaultSelection =
      sSelectedDeviceIndex < mDevices.size() ? sSelectedDeviceIndex : 0;
  combo.select(defaultSelection);
  sSelectedDeviceIndex = defaultSelection;

  combo.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent arg0) {
      sSelectedDeviceIndex = combo.getSelectionIndex();
    }
  });

  return parent;
}
项目:avro-schema-editor    文件:BooleanAttributeControl.java   
@Override
public void createControl(Composite parent, FormToolkit toolkit, AvroAttribute<Boolean> element, AvroContext context) {

    initialize(element, context);

    button = toolkit.createButton(parent, "", SWT.CHECK);   

    update();

    button.addSelectionListener(new SelectionAdapter() {            
        @Override
        public void widgetSelected(SelectionEvent e) {
            changeAttribute(getAttribute().getValue(), button.getSelection());
        }
    });

}
项目:neoscada    文件:ButtonProfileEntry.java   
public ButtonProfileEntry ( final DataBindingContext dbc, final Composite parent, final ProfileManager profileManager, final Profile profile, final ChartContext chartContext )
{
    super ( dbc, profileManager, profile, chartContext );

    this.widget = new Button ( parent, SWT.TOGGLE );

    addBinding ( dbc.bindValue ( SWTObservables.observeText ( this.widget ), EMFObservables.observeValue ( profile, ChartPackage.Literals.PROFILE__LABEL ) ) );

    this.widget.addSelectionListener ( new SelectionAdapter () {
        @Override
        public void widgetSelected ( final SelectionEvent e )
        {
            fireSelection ( ButtonProfileEntry.this.widget.getSelection () );
        };
    } );
}
项目:neoscada    文件:TimeNowActionController.java   
public TimeNowActionController ( final ControllerManager controllerManager, final ChartContext chartContext, final TimeNowAction controller )
{
    super ( controllerManager.getContext (), chartContext, controller );

    final Composite space = chartContext.getExtensionSpaceProvider ().getExtensionSpace ();
    if ( space != null )
    {
        this.button = new Button ( space, SWT.PUSH );
        this.button.setText ( Messages.TimeNowActionController_Label );
        this.button.setToolTipText ( Messages.TimeNowActionController_Description );
        this.button.addSelectionListener ( new SelectionAdapter () {
            @Override
            public void widgetSelected ( final SelectionEvent e )
            {
                action ();
            };

        } );
        space.layout ();
    }
    else
    {
        this.button = null;
    }
}
项目:neoscada    文件:DetailsPart.java   
private void createButton ( final Composite parent )
{
    this.wrapper = new Composite ( parent, SWT.NONE );
    final GridLayout layout = new GridLayout ( 1, true );
    layout.marginHeight = layout.marginWidth = 0;
    this.wrapper.setLayout ( layout );

    this.startButton = new Button ( this.wrapper, SWT.PUSH );
    this.startButton.setLayoutData ( new GridData ( SWT.CENTER, SWT.CENTER, true, true ) );
    this.startButton.setText ( Messages.DetailsPart_startButton_label );
    this.startButton.addSelectionListener ( new SelectionAdapter () {
        @Override
        public void widgetSelected ( final SelectionEvent e )
        {
            try
            {
                start ();
            }
            catch ( final Exception ex )
            {
                logger.error ( "Failed to start chart", ex ); //$NON-NLS-1$
                StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, ex ), StatusManager.BLOCK );
            }
        }
    } );
}
项目:Hydrograph    文件:SelectionDatabaseWidget.java   
private SelectionAdapter buttonWidgetSelectionListener(Text textWidget){
    SelectionAdapter adapter = new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            String text = textWidget.getText();
            SQLQueryStatementDialog sqlQueryStatementDialog = new SQLQueryStatementDialog(
                    Display.getCurrent().getActiveShell(), text);
            sqlQueryStatementDialog.open();
            if(sqlQueryStatementDialog.getStyleTextSqlQuery() != null){
                textWidget.setText(sqlQueryStatementDialog.getStyleTextSqlQuery());
            }
            if(sqlQueryStatementDialog.isTextValueChanged()){
                propertyDialogButtonBar.enableApplyButton(true);
            }
        }
    };
    return adapter;
}
项目:neoscada    文件:FilterAdvancedComposite.java   
private Combo createAssertionCombo ()
{
    final Combo c = new Combo ( this, SWT.NONE );
    for ( final Assertion assertion : Assertion.values () )
    {
        c.add ( assertion.toString () );
    }
    c.select ( 0 );
    c.addSelectionListener ( new SelectionAdapter () {
        @Override
        public void widgetSelected ( final SelectionEvent e )
        {
            AssertionComposite.this.orCondition.updateFilter ();
        }
    } );
    final RowData rowData = new RowData ();
    rowData.width = 75;
    c.setLayoutData ( rowData );
    return c;
}
项目:neoscada    文件:MonitorsViewTable.java   
@Override
public void widgetSelected ( final SelectionEvent e )
{
    final Table table = this.tableViewer.getTable ();
    final TableColumn newColumn = (TableColumn)e.widget;
    final TableColumn currentColumn = table.getSortColumn ();

    final int currentDir = table.getSortDirection ();
    int newDir = SWT.UP;
    if ( newColumn == currentColumn )
    {
        newDir = currentDir == SWT.UP ? SWT.DOWN : SWT.UP;
    }
    else
    {
        table.setSortColumn ( newColumn );
    }
    table.setSortDirection ( newDir );
    this.tableViewer.setSorter ( new Sorter ( (Columns)newColumn.getData ( COLUMN_KEY ), newDir ) );
}
项目:neoscada    文件:EventViewTable.java   
@Override
public void widgetSelected ( final SelectionEvent e )
{
    final Table table = this.tableViewer.getTable ();
    final TableColumn newColumn = (TableColumn)e.widget;
    final TableColumn currentColumn = table.getSortColumn ();

    final EventTableColumn column = (EventTableColumn)newColumn.getData ( COLUMN_KEY );
    if ( column == EventTableColumn.reservedColumnSourceTimestamp || column == EventTableColumn.reservedColumnEntryTimestamp )
    {
        final int currentDir = table.getSortDirection ();
        int newDir = SWT.UP;
        if ( newColumn == currentColumn )
        {
            newDir = currentDir == SWT.UP ? SWT.DOWN : SWT.UP;
        }
        else
        {
            table.setSortColumn ( newColumn );
        }
        table.setSortDirection ( newDir );
        this.tableViewer.setSorter ( new EventTableSorter ( column, newDir ) );
    }
}
项目:applecommander    文件:DropDownSelectionListener.java   
/**
 * Construct the DropDownSelectionListener with the specific menu to be used.
 */
public DropDownSelectionListener(Menu menu) {
    this.menu = menu;

    MenuItem[] menuItems = menu.getItems();
    for (int i=0; i<menuItems.length; i++) {
        /*
         * Add a menu selection listener so that the menu is hidden
         * when the user selects an item from the drop down menu.
         */
        menuItems[i].addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                setMenuVisible(false);
            }
        });
    }
}
项目:convertigo-eclipse    文件:ToggleButton.java   
public ToggleButton(Composite parent, int style) {
    super(parent, style);

    if (colorOn == null) {
        colorOn = getDisplay().getSystemColor(SWT.COLOR_GREEN);
        colorOff = getDisplay().getSystemColor(SWT.COLOR_RED);
    }

    FillLayout layout = new FillLayout();
    layout.marginHeight = layout.marginWidth =  2;
    setLayout(layout);
    button = new Button(this, SWT.TOGGLE);
    button.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            updateColor();
        }
    });
}
项目:time4sys    文件:ShowHideWizardPage.java   
private void createDownButtonListener() {
    if (downButton != null && selectedElementsTableViewer != null) {
        downButton.addSelectionListener(new SelectionAdapter() {
            // event is null when featureTableViewer is double clicked
            @Override
            public void widgetSelected(final SelectionEvent event) {
                final IStructuredSelection selection = (IStructuredSelection) selectedElementsTableViewer.getSelection();
                final Iterator<EObject> i = Iterators.filter(selection.iterator(), EObject.class);
                int maxIndex = selectedElements.size() - selection.size();
                while (i.hasNext()) {
                    final EObject value = i.next();
                    final int index = selectedElements.indexOf(value);
                    selectedElements.move(Math.min(index + 1, maxIndex++), value);
                }
                selectedElementsTableViewer.refresh();
            }
        });
    }
}
项目: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    文件:TransformViewDataDialog.java   
/**
 * Creates the copy button 
 * @param buttonComposite
 */
private void createCopyButton(Composite buttonComposite){
    Button copyButton = new Button(buttonComposite, SWT.PUSH);

        copyButton.setImage(ImagePathConstant.ENABLE_COPY_ICON.getImageFromRegistry());
        copyButton.setToolTipText(COPY_BUTTON_TOOL_TIP);
        copyButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
            if (StringUtils.isNotBlank(styledText.getSelectionText())) {
                styledText.copy();
            } else {
                styledText.selectAll();
                styledText.copy();
                styledText.setSelection(0);
            }

        }
    });
        copyButton.pack();
}
项目: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();
    }
});


}
项目:gw4e.project    文件:GW4ELaunchConfigurationTab.java   
private void createDisplayReportElementGroup (Composite parent) {
Label lfiller = new Label(parent, SWT.NONE);
lfiller.setText("");

Label lblDisplayReporElement = new Label(parent, SWT.NONE);
lblDisplayReporElement.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblDisplayReporElement.setText(MessageUtil.getString("displayReport"));

displayDetailsButton = new Button(parent, SWT.CHECK);
displayDetailsButton.setText("");
displayDetailsButton.setSelection(true);
new Label(parent, SWT.NONE);
displayDetailsButton.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent evt) {
        validatePage();
    }
});
}
项目:gemoc-studio    文件:TemplateListSelectionPage.java   
public void createAbove(Composite container, int span) {
    fUseTemplate = new Button(container, SWT.CHECK);
    fUseTemplate.setText(PDEUIMessages.WizardListSelectionPage_label);
    GridData gd = new GridData();
    gd.horizontalSpan = span;
    fUseTemplate.setLayoutData(gd);

    fUseTemplate.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            wizardSelectionViewer.getControl().setEnabled(fUseTemplate.getSelection());
            if (!fUseTemplate.getSelection())
                setDescription(""); //$NON-NLS-1$
            setDescriptionEnabled(fUseTemplate.getSelection());
            getContainer().updateButtons();
        }
    });
}
项目:Hydrograph    文件:ELTLookupConfigGrid.java   
/**
 * Create contents of the button bar.
 * 
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    Button button = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    button.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {

        }
    });
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}
项目: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();
            }
        });
    }
项目:time4sys    文件:GeneralPropertiesEditionPartForm.java   
protected Composite createIsActiveCheckbox(FormToolkit widgetFactory, Composite parent) {
    isActive = widgetFactory.createButton(parent, getDescription(SrmViewsRepository.General.Properties.isActive,
            SrmMessages.GeneralPropertiesEditionPart_IsActiveLabel), SWT.CHECK);
    isActive.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(GeneralPropertiesEditionPartForm.this,
                                SrmViewsRepository.General.Properties.isActive, PropertiesEditionEvent.COMMIT,
                                PropertiesEditionEvent.SET, null, new Boolean(isActive.getSelection())));
        }

    });
    GridData isActiveData = new GridData(GridData.FILL_HORIZONTAL);
    isActiveData.horizontalSpan = 2;
    isActive.setLayoutData(isActiveData);
    EditingUtils.setID(isActive, SrmViewsRepository.General.Properties.isActive);
    EditingUtils.setEEFtype(isActive, "eef::Checkbox"); //$NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent
            .getHelpContent(SrmViewsRepository.General.Properties.isActive, SrmViewsRepository.FORM_KIND), null); // $NON-NLS-1$
    // Start of user code for createIsActiveCheckbox

    // End of user code
    return parent;
}
项目:n4js    文件:ExternalLibraryPreferencePage.java   
/**
 * Selection handler for adding a new external library location.
 */
private void handleAddButtonSelectionListener(@SuppressWarnings("unused") final SelectionEvent e) {
    final String directoryPath = new DirectoryDialog(viewer.getControl().getShell(), OPEN).open();
    if (null != directoryPath) {
        final File file = new File(directoryPath);
        if (file.exists() && file.isDirectory()) {
            store.add(file.toURI());
            updateInput(viewer, store.getLocations());
        }
    }
}
项目:applecommander    文件:FileViewerWindow.java   
/**
 * Create the copy tool item (button).
 */
protected ToolItem createCopyToolItem() {
    ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
    toolItem.setImage(imageManager.get(ImageManager.ICON_COPY));
    toolItem.setText(textBundle.get("FileViewerWindow.CopyButton")); //$NON-NLS-1$
    toolItem.setToolTipText(textBundle.get("FileViewerWindow.CopyTooltip")); //$NON-NLS-1$
    toolItem.setEnabled(true);
    toolItem.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            getContentTypeAdapter().copy();
        }
    });
    return toolItem;
}
项目:n4js    文件:ExternalLibraryPreferencePage.java   
/**
 * Selection handler for moving up an external library location in the list.
 */
private void handleMoveUpButtonSelection(@SuppressWarnings("unused") final SelectionEvent e) {
    final ISelection selection = viewer.getSelection();
    if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
        final Object element = ((IStructuredSelection) selection).getFirstElement();
        if (element instanceof URI) {
            store.moveUp((URI) element);
            updateInput(viewer, store.getLocations());
        }
    }
}
项目:n4js    文件:ExternalLibraryPreferencePage.java   
/**
 * Selection handler for moving down an external library location in the list.
 */
private void handleMoveDownButtonSelection(@SuppressWarnings("unused") final SelectionEvent e) {
    final ISelection selection = viewer.getSelection();
    if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
        final Object element = ((IStructuredSelection) selection).getFirstElement();
        if (element instanceof URI) {
            store.moveDown((URI) element);
            updateInput(viewer, store.getLocations());
        }
    }
}
项目:n4js    文件:InstallNpmDependencyButtonListener.java   
@Override
public void widgetSelected(final SelectionEvent e) {
    final MultiStatus multistatus = statusHelper.createMultiStatus("Status of installing npm dependencies.");

    InstallNpmDependencyDialog dialog = new InstallNpmDependencyDialog(getShell(),
            packageNameValidator.get(), packageVersionValidator.get());
    dialog.open();
    final String packageName = dialog.getPackageName();
    if (!StringExtensions.isNullOrEmpty(packageName) && dialog.getReturnCode() == Window.OK) {
        try {
            final String packageVersion = dialog.getVersionConstraint();
            new ProgressMonitorDialog(getShell()).run(true, false, monitor -> {
                multistatus
                        .merge(installAction.apply(Collections.singletonMap(packageName, packageVersion), monitor));
            });
        } catch (final InvocationTargetException | InterruptedException exc) {
            multistatus.merge(
                    statusHelper.createError("Error while installing npm dependency: '" + packageName + "'.",
                            exc));
        } finally {
            if (!multistatus.isOK()) {
                N4JSActivator.getInstance().getLog().log(multistatus);
                getDisplay().asyncExec(() -> openError(
                        UIUtils.getShell(),
                        "npm Install Failed",
                        "Error while installing '" + packageName
                                + "' npm package.\nPlease check your Error Log view for the detailed npm log about the failure."));
            }
        }
    }
}
项目:n4js    文件:UninstallNpmDependencyButtonListener.java   
@Override
public void widgetSelected(final SelectionEvent e) {
    final MultiStatus multistatus = statusHelper.createMultiStatus("Status of uninstalling npm dependencies.");

    final InputDialog dialog = new InputDialog(UIUtils.getShell(), "npm Uninstall",
            "Specify an npm package name to uninstall:", initalValue.get(), validator.get());

    dialog.open();
    final String packageName = dialog.getValue();
    if (!StringExtensions.isNullOrEmpty(packageName) && dialog.getReturnCode() == Window.OK) {
        try {
            new ProgressMonitorDialog(UIUtils.getShell()).run(true, false, monitor -> {
                multistatus.merge(uninstallAction.apply(Arrays.asList(packageName), monitor));
            });
        } catch (final InvocationTargetException | InterruptedException exc) {
            multistatus.merge(
                    statusHelper.createError("Error while uninstalling npm dependency: '" + packageName + "'.",
                            exc));
        } finally {
            if (!multistatus.isOK()) {
                N4JSActivator.getInstance().getLog().log(multistatus);
                getDisplay().asyncExec(() -> openError(
                        UIUtils.getShell(),
                        "npm Uninstall Failed",
                        "Error while uninstalling '" + packageName
                                + "' npm package.\nPlease check your Error Log view for the detailed npm log about the failure."));
            }
        }
    }
}
项目:time4sys    文件:EventModelPropertiesEditionPartForm.java   
/**
 * @generated
 */

protected Composite createIsSporadicCheckbox(FormToolkit widgetFactory, Composite parent) {
    isSporadic = widgetFactory.createButton(parent, getDescription(AnalysisViewsRepository.EventModel.Properties.isSporadic, AnalysisMessages.EventModelPropertiesEditionPart_IsSporadicLabel), SWT.CHECK);
    isSporadic.addSelectionListener(new SelectionAdapter() {

        /**
         * {@inheritDoc}
         *
         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
         *  @generated
         */
        public void widgetSelected(SelectionEvent e) {
            if (propertiesEditionComponent != null)
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(EventModelPropertiesEditionPartForm.this, AnalysisViewsRepository.EventModel.Properties.isSporadic, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new Boolean(isSporadic.getSelection())));
        }

    });
    GridData isSporadicData = new GridData(GridData.FILL_HORIZONTAL);
    isSporadicData.horizontalSpan = 2;
    isSporadic.setLayoutData(isSporadicData);
    EditingUtils.setID(isSporadic, AnalysisViewsRepository.EventModel.Properties.isSporadic);
    EditingUtils.setEEFtype(isSporadic, "eef::Checkbox"); //$NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(AnalysisViewsRepository.EventModel.Properties.isSporadic, AnalysisViewsRepository.FORM_KIND), null); //$NON-NLS-1$
    // Start of user code for createIsSporadicCheckbox

    // End of user code
    return parent;
}
项目:time4sys    文件:GeneralPropertiesEditionPartForm.java   
protected Composite createIsSynchronousCheckbox(FormToolkit widgetFactory, Composite parent) {
    isSynchronous = widgetFactory.createButton(parent, getDescription(LibraryViewsRepository.General.Properties.isSynchronous, LibraryMessages.GeneralPropertiesEditionPart_IsSynchronousLabel), SWT.CHECK);
    isSynchronous.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(GeneralPropertiesEditionPartForm.this, LibraryViewsRepository.General.Properties.isSynchronous, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new Boolean(isSynchronous.getSelection())));
        }

    });
    GridData isSynchronousData = new GridData(GridData.FILL_HORIZONTAL);
    isSynchronousData.horizontalSpan = 2;
    isSynchronous.setLayoutData(isSynchronousData);
    EditingUtils.setID(isSynchronous, LibraryViewsRepository.General.Properties.isSynchronous);
    EditingUtils.setEEFtype(isSynchronous, "eef::Checkbox"); //$NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(LibraryViewsRepository.General.Properties.isSynchronous, LibraryViewsRepository.FORM_KIND), null); //$NON-NLS-1$
    // Start of user code for createIsSynchronousCheckbox

    // End of user code
    return parent;
}
项目: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;
}
项目:time4sys    文件:GeneralPropertiesEditionPartImpl.java   
protected Composite createIsProtectedCheckbox(Composite parent) {
    isProtected = new Button(parent, SWT.CHECK);
    isProtected.setText(getDescription(SrmViewsRepository.General.Properties.isProtected,
            SrmMessages.GeneralPropertiesEditionPart_IsProtectedLabel));
    isProtected.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,
                                SrmViewsRepository.General.Properties.isProtected, PropertiesEditionEvent.COMMIT,
                                PropertiesEditionEvent.SET, null, new Boolean(isProtected.getSelection())));
        }

    });
    GridData isProtectedData = new GridData(GridData.FILL_HORIZONTAL);
    isProtectedData.horizontalSpan = 2;
    isProtected.setLayoutData(isProtectedData);
    EditingUtils.setID(isProtected, SrmViewsRepository.General.Properties.isProtected);
    EditingUtils.setEEFtype(isProtected, "eef::Checkbox"); //$NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent
            .getHelpContent(SrmViewsRepository.General.Properties.isProtected, SrmViewsRepository.SWT_KIND), null); // $NON-NLS-1$
    // Start of user code for createIsProtectedCheckbox

    // End of user code
    return parent;
}
项目:Hydrograph    文件:ValidateExpressionToolButton.java   
private void addSelectionListener() {
    addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            validation(expressionEditor);
        }
    });
}
项目:gemoc-studio-modeldebugging    文件:LaunchConfigurationMainTab.java   
/***
 * 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;
}
项目: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));
                        }
                    }   
            }
        });
    }
项目:eZooKeeper    文件:ZnodeAclComposite.java   
@Override
protected GridComposite createGridComposite(Composite parent) {

    GridComposite gridComposite = new GridComposite(parent) {

        @Override
        protected void createContents() {

            GridTextInput userNameGridTextInput = new GridTextInput(this, GridTextInput.Type.VALUE_REQUIRED,
                    CONTROL_NAME_USER_NAME_TEXT, "&User name: ", null);
            addGridTextInput(userNameGridTextInput);

            GridTextInput passwordGridTextInput = new GridTextInput(this, GridTextInput.Type.VALUE_REQUIRED,
                    CONTROL_NAME_PASSWORD_TEXT, "&Password:     ", null);
            addGridTextInput(passwordGridTextInput);
            passwordGridTextInput.getText().setEchoChar('*');

            final Button showPasswordTextCheckBox = new Button(this, SWT.CHECK);
            showPasswordTextCheckBox.setText("Show password text");
            showPasswordTextCheckBox.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
            showPasswordTextCheckBox.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                    Text passwordText = (Text) getControl(CONTROL_NAME_PASSWORD_TEXT);
                    char echoChar = (showPasswordTextCheckBox.getSelection()) ? '\0' : '*';
                    passwordText.setEchoChar(echoChar);
                }

            });

        }
    };

    return gridComposite;

}
项目:eZooKeeper    文件:ZnodeNewWizardComposite1.java   
@Override
public void widgetSelected(SelectionEvent e) {
    Control composite = getControl(_DataCompositeName);
    Composite dataStackComposite = (Composite) getControl(CONTROL_NAME_DATA_STACK_COMPOSITE);
    ((StackLayout) dataStackComposite.getLayout()).topControl = composite;
    dataStackComposite.layout();
    modified(composite);
}
项目:eZooKeeper    文件:ZnodeNewWizardComposite1.java   
@Override
protected void createContents() {

    GridTextInput fileGridTextInput = new GridTextInput(this, GridTextInput.Type.DEFAULT,
            CONTROL_NAME_DATA_FILE_TEXT, null, null);
    addGridTextInput(fileGridTextInput);

    Button browseButton = new Button(this, SWT.PUSH);
    browseButton.setText("&Browse...");
    browseButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {

            Text filePathText = (Text) getControl(CONTROL_NAME_DATA_FILE_TEXT);

            FileDialog fileDialog = new FileDialog(getShell());
            fileDialog.setFileName(filePathText.getText());
            String newPath = fileDialog.open();
            if (newPath != null) {
                filePathText.setText(newPath);
            }

        }

    });
}
项目:pmTrans    文件:MenuManager.java   
private void createRecentTextsMenu() {
    for (MenuItem mi : recentTextsM.getItems())
        mi.dispose();

    CacheList<File> textFilesCache = pmTrans.getRecentTrasncriptions();
    for (int i = 0; i < textFilesCache.size(); i++)
        addMenuItem(recentTextsM, textFilesCache.get(i).getName(),
                SWT.NONE, textFilesCache.get(i), new SelectionAdapter() {
                    @Override
                    public void widgetSelected(SelectionEvent e) {
                        pmTrans.openTranscriptionFile((File) ((MenuItem) e
                                .getSource()).getData());
                    }
                });
}