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

项目: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("");
        }

    });
}
项目: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();
            }
        }
    });
}
项目: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    文件: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);
        }
    });

}
项目: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;
}
项目: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;
    }
}
项目: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();
            }
        });
    }
}
项目: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 ();
        }
    } );
}
项目:neoscada    文件:LinkComposite.java   
public LinkComposite ( final Composite parent, final int style, final String format )
{
    super ( parent, style );

    final RowLayout layout = new RowLayout ();
    layout.wrap = false;
    layout.center = true;
    layout.spacing = 7;
    layout.pack = true;
    setLayout ( layout );

    this.textLabel = new Link ( this, SWT.NONE );
    this.textLabel.setText ( format );

    this.textLabel.addSelectionListener ( new SelectionAdapter () {

        @Override
        public void widgetSelected ( final SelectionEvent event )
        {
            logger.info ( "LinkComponent selected: {}", event.text ); //$NON-NLS-1$
            Program.launch ( event.text );
        }
    } );
}
项目:neoscada    文件:LoginDialog.java   
private Composite createAdvancedContent ( final Composite advWrapper )
{
    final Composite advContent = new Composite ( advWrapper, SWT.NONE );
    advContent.setLayout ( new GridLayout ( 1, false ) );

    final Button credentialsAsProperties = new Button ( advContent, SWT.CHECK );
    credentialsAsProperties.setText ( Messages.LoginDialog_CredentialsButtons_Text );
    credentialsAsProperties.setToolTipText ( Messages.LoginDialog_CredentialsButtons_ToolTip );

    credentialsAsProperties.setSelection ( this.flagCredentialsAsProperties );
    credentialsAsProperties.addSelectionListener ( new SelectionAdapter () {
        @Override
        public void widgetSelected ( final SelectionEvent e )
        {
            LoginDialog.this.flagCredentialsAsProperties = credentialsAsProperties.getSelection ();
        }
    } );

    return advContent;
}
项目:Hydrograph    文件:LoadTypeConfigurationDialog.java   
/**
 * The Function will cal on update and primary key button selection listener
 * @param butoon
 * @param textBox
 * @return Selection Adapter
 */
private SelectionAdapter updateAndPrimaryWidgetSelection(Button butoon, Text textBox){
    SelectionAdapter adapter = new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            String buttonText;
            //TODO as above
            /*if(StringUtils.equalsIgnoreCase(butoon.getText(), Messages.UPDATE_BY_KEYS)){
                buttonText = Messages.UPDATE_KEYS_WINDOW_LABEL;
            }else{*/
            buttonText = Messages.PRIMARY_KEYS_WINDOW_LABEL;
            FieldDialog fieldDialog = new FieldDialog(new Shell(), propertyDialogButtonBar);
            fieldDialog.setComponentName(buttonText);
            fieldDialog.setSourceFieldsFromPropagatedSchema(schemaFields);
            if(StringUtils.isNotBlank(textBox.getText())){
                fieldDialog.setPropertyFromCommaSepratedString(textBox.getText());
            }
            fieldDialog.open();
            String valueForNewTableTextBox = fieldDialog.getResultAsCommaSeprated();
            if(valueForNewTableTextBox !=null){
                textBox.setText(valueForNewTableTextBox);
            }
        }
    };
    return adapter; 
}
项目: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);

        }
}
项目: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();
    }
});
}
项目:pgcodekeeper    文件:FilterDialog.java   
@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    Button btnReset = createButton(parent, IDialogConstants.NO_ID, Messages.FilterDialog_reset, false);
    createButton(parent, IDialogConstants.CANCEL_ID, Messages.FilterDialog_cancel, false);

    btnReset.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            text.setText(""); //$NON-NLS-1$
            btnRegEx.setSelection(false);
            objViewer.setAllChecked(false);
            chgViewer.setAllChecked(false);
        }
    });
}
项目: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    文件: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();
            }
        });
    }
}
项目:time4sys    文件:GeneralPropertiesEditionPartForm.java   
protected Composite createIsStaticCheckbox(FormToolkit widgetFactory, Composite parent) {
    isStatic = widgetFactory.createButton(parent, getDescription(HrmViewsRepository.General.Properties.isStatic,
            HrmMessages.GeneralPropertiesEditionPart_IsStaticLabel), SWT.CHECK);
    isStatic.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,
                                HrmViewsRepository.General.Properties.isStatic, PropertiesEditionEvent.COMMIT,
                                PropertiesEditionEvent.SET, null, new Boolean(isStatic.getSelection())));
        }

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

    // End of user code
    return parent;
}
项目:time4sys    文件:OtherPropertiesEditionPartForm.java   
protected Composite createIsMaskableCheckbox(FormToolkit widgetFactory, Composite parent) {
    isMaskable = widgetFactory.createButton(parent, getDescription(SrmViewsRepository.Other.Properties.isMaskable,
            SrmMessages.OtherPropertiesEditionPart_IsMaskableLabel), SWT.CHECK);
    isMaskable.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(OtherPropertiesEditionPartForm.this,
                                SrmViewsRepository.Other.Properties.isMaskable, PropertiesEditionEvent.COMMIT,
                                PropertiesEditionEvent.SET, null, new Boolean(isMaskable.getSelection())));
        }

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

    // 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;
}
项目: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;
}
项目:time4sys    文件:GeneralPropertiesEditionPartImpl.java   
protected Composite createIsPeriodicCheckbox(Composite parent) {
    isPeriodic = new Button(parent, SWT.CHECK);
    isPeriodic.setText(getDescription(GrmViewsRepository.General.Properties.isPeriodic,
            GrmMessages.GeneralPropertiesEditionPart_IsPeriodicLabel));
    isPeriodic.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,
                                GrmViewsRepository.General.Properties.isPeriodic, PropertiesEditionEvent.COMMIT,
                                PropertiesEditionEvent.SET, null, new Boolean(isPeriodic.getSelection())));
        }

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

    // End of user code
    return parent;
}
项目:Hydrograph    文件:JDBCDriverClassWidget.java   
private boolean addComboSelectionListner() {
    combo.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
            String str = ((Combo)event.getSource()).getText();
            if(dropDownConfig.getItems().contains(str)){
                jdbcDriverClassTextBoxDecorator.hide();
                jdbcDriverClassTextBox.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
                if(str.equalsIgnoreCase(Messages.ORACLE)){
                    jdbcDriverClassTextBox.setText(Messages.ORACLE_DRIVER_CLASS);
                }else if(str.equalsIgnoreCase(Messages.REDSHIFT)){
                    jdbcDriverClassTextBox.setText(Messages.REDSHIFT_DRIVER_CLASS);
                }else if(str.equalsIgnoreCase(Messages.MYSQL)){
                    jdbcDriverClassTextBox.setText(Messages.MYSQL_DRIVER_CLASS);
                }else if(str.equalsIgnoreCase(Messages.TERADATA)){
                    jdbcDriverClassTextBox.setText(Messages.TERADATA_DRIVER_CLASS);
                }else if(str.equalsIgnoreCase(Messages.OTHERS)){
                    jdbcDriverClassTextBox.setText("");
                    jdbcDriverClassTextBox.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
                    jdbcDriverClassTextBoxDecorator.setMarginWidth(3);
                    jdbcDriverClassTextBoxDecorator.show();
                }
            }
        }

    });
    return true;
}
项目:pmTrans    文件:BarManager.java   
private ToolItem addItemToToolBar(ToolBar bar, String text, String toolTip,
        int type, SelectionAdapter listener, Image icon) {
    ToolItem item = addItemToToolBar(bar, text, toolTip, type);

    if (listener != null)
        item.addSelectionListener(listener);
    if (icon != null)
        item.setImage(icon);

    return item;
}
项目:pmTrans    文件:MenuManager.java   
private void createRecentAudiosMenu() {
    for (MenuItem mi : recentAudiosM.getItems())
        mi.dispose();

    CacheList<File> audioFilesCache = pmTrans.getRecentAudios();
    for (int i = 0; i < audioFilesCache.size(); i++)
        addMenuItem(recentAudiosM, audioFilesCache.get(i).getName(),
                SWT.NONE, audioFilesCache.get(i), new SelectionAdapter() {
                    @Override
                    public void widgetSelected(SelectionEvent e) {
                        pmTrans.openAudioFile((File) ((MenuItem) e
                                .getSource()).getData());
                    }
                });
}
项目:time4sys    文件:GeneralPropertiesEditionPartForm.java   
protected Composite createIsProtectedCheckbox(FormToolkit widgetFactory, Composite parent) {
    isProtected = widgetFactory.createButton(parent,
            getDescription(GrmViewsRepository.General.Properties.isProtected,
                    GrmMessages.GeneralPropertiesEditionPart_IsProtectedLabel),
            SWT.CHECK);
    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(GeneralPropertiesEditionPartForm.this,
                                GrmViewsRepository.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, GrmViewsRepository.General.Properties.isProtected);
    EditingUtils.setEEFtype(isProtected, "eef::Checkbox"); //$NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent
            .getHelpContent(GrmViewsRepository.General.Properties.isProtected, GrmViewsRepository.FORM_KIND), null); // $NON-NLS-1$
    // Start of user code for createIsProtectedCheckbox

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

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

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

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

    // End of user code
    return parent;
}
项目:Hydrograph    文件:WorksheetWidget.java   
private void attachSelectionListener(Button isFieldCheckBox) {
    isFieldCheckBox.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            propDialogButtonBar.enableApplyButton(true);
        }
    });
}
项目:neoscada    文件:CheckProfileEntry.java   
public CheckProfileEntry ( 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.CHECK );
    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 ( CheckProfileEntry.this.widget.getSelection () );
        };
    } );
}
项目:neoscada    文件:RadioProfileEntry.java   
public RadioProfileEntry ( 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.RADIO );
    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 ( RadioProfileEntry.this.widget.getSelection () );
        };
    } );
}
项目:neoscada    文件:TimeShiftActionController.java   
public TimeShiftActionController ( final ControllerManager controllerManager, final ChartContext chartContext, final TimeShiftAction controller )
{
    super ( controllerManager.getContext (), chartContext, controller );

    final DataBindingContext ctx = controllerManager.getContext ();

    final Composite space = chartContext.getExtensionSpaceProvider ().getExtensionSpace ();
    if ( space != null )
    {
        this.button = new Button ( space, SWT.PUSH );
        this.button.addSelectionListener ( new SelectionAdapter () {
            @Override
            public void widgetSelected ( final SelectionEvent e )
            {
                action ();
            };
        } );
        addBinding ( ctx.bindValue ( PojoObservables.observeValue ( this, "milliseconds" ), EMFObservables.observeValue ( controller, ChartPackage.Literals.TIME_SHIFT_ACTION__DIFF ) ) ); //$NON-NLS-1$
        addBinding ( ctx.bindValue ( SWTObservables.observeText ( this.button ), EMFObservables.observeValue ( controller, ChartPackage.Literals.TIME_SHIFT_ACTION__LABEL ) ) );
        addBinding ( ctx.bindValue ( SWTObservables.observeTooltipText ( this.button ), EMFObservables.observeValue ( controller, ChartPackage.Literals.TIME_SHIFT_ACTION__DESCRIPTION ) ) );

        this.layoutListener = new IValueChangeListener () {

            @Override
            public void handleValueChange ( final ValueChangeEvent event )
            {
                space.layout ();
            }
        };

        this.labelProperty = EMFObservables.observeValue ( controller, ChartPackage.Literals.TIME_SHIFT_ACTION__LABEL );
        this.labelProperty.addValueChangeListener ( this.layoutListener );

        space.layout ();
    }
    else
    {
        this.button = null;
    }
}
项目:Hydrograph    文件:ELTRetentionLogicWidget.java   
@Override
public void attachToPropertySubGroup(AbstractELTContainerWidget container) {

    ELTDefaultSubgroupComposite eltSuDefaultSubgroupComposite = new ELTDefaultSubgroupComposite(container.getContainerControl());
    eltSuDefaultSubgroupComposite.createContainerWidget();
    eltSuDefaultSubgroupComposite.numberOfBasicWidgets(4);

    AbstractELTWidget eltDefaultLable = new ELTDefaultLable("Retain");
    eltSuDefaultSubgroupComposite.attachWidget(eltDefaultLable);
    setPropertyHelpWidget((Control) eltDefaultLable.getSWTWidgetControl());

    SelectionListener selectionListener = new SelectionAdapter () {

         @Override
        public void widgetSelected(SelectionEvent event) {
             Button button = ((Button) event.widget);
           properties = button.getText();
           propertyDialogButtonBar.enableApplyButton(true);
            logger.debug( "Radio Button Value",button.getText());
           // button.getSelection();
         };
      };

    First = new ELTRadioButton("First");
    eltSuDefaultSubgroupComposite.attachWidget(First);
    ((Button) First.getSWTWidgetControl()).addSelectionListener(selectionListener);
    //button=(Button) First.getSWTWidgetControl();

    Last = new ELTRadioButton("Last");
    eltSuDefaultSubgroupComposite.attachWidget(Last);
    ((Button) Last.getSWTWidgetControl()).addSelectionListener(selectionListener);

    Unique = new ELTRadioButton("Unique");
    eltSuDefaultSubgroupComposite.attachWidget(Unique);
    ((Button) Unique.getSWTWidgetControl()).addSelectionListener(selectionListener);

    populateWidget();

}
项目:Hydrograph    文件:ExcelFormattingDialog.java   
private void attachDeleteButtonListener(Button deleteButton) {
    deleteButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            setValueForCellEditor();
            TableItem[] selection = targetTableViewer.getTable().getSelection();
            String comboValue = combo.getText();
            for(TableItem item : selection){
                if(item != null){
                    for(String listvalue : new ArrayList<>(draggedFields)){
                        if(StringUtils.equals(listvalue, item.getText())){
                            draggedFields.remove(listvalue);
                        }
                    }
                }

                combo.setItems(convertToArray(draggedFields));
                if(StringUtils.equals(comboValue, item.getText())){
                    combo.select(0);
                }else{
                    combo.setText(comboValue);
                }

            }

            top_composite.layout();
            top_composite.getParent().layout();

            WidgetUtility.setCursorOnDeleteRow(targetTableViewer, listOfExcelConfiguration);
            targetTableViewer.refresh();
            if (listOfExcelConfiguration.size() < 1) {
                deleteButton.setEnabled(false);
            }

            highlightDropFields();
        }
    });
}
项目:neoscada    文件:FilterAdvancedComposite.java   
private Button createAddButton ()
{
    final Button b = new Button ( this, SWT.PUSH );
    b.setText ( Messages.add_assertion );
    b.addSelectionListener ( new SelectionAdapter () {
        @Override
        public void widgetSelected ( final SelectionEvent e )
        {
            AddAssertionComposite.this.orCondition.addAssertion ();
        }
    } );
    return b;
}
项目:Hydrograph    文件:TransformDialog.java   
private void addSelectionListenerToBrowseButton(
        final OperationClassComposite operationClassComposite) {
    operationClassComposite.getBrowseButton().addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                MappingSheetRow orignalMappingSheetRow = (MappingSheetRow) ((Button) e.widget).getData(Messages.MAPPING_SHEET);
                Text operationClassTextBox=(Text)((Button)e.widget).getData(OPERATION_CLASS_TEXT_BOX);
                MappingSheetRow oldMappingSheetRow = (MappingSheetRow) orignalMappingSheetRow.clone();
                OperationClassDialog operationClassDialog = new OperationClassDialog(operationClassComposite.getBrowseButton().getShell(), component
                        .getComponentName(), orignalMappingSheetRow, propertyDialogButtonBar, widgetConfig,
                        transformDialog);
                operationClassDialog.open();
                orignalMappingSheetRow.setComboBoxValue(operationClassDialog.getMappingSheetRow().getComboBoxValue());
                orignalMappingSheetRow.setOperationClassPath(operationClassDialog.getMappingSheetRow()
                        .getOperationClassPath());
                orignalMappingSheetRow.setClassParameter(operationClassDialog.getMappingSheetRow().isClassParameter());

                orignalMappingSheetRow.setOperationClassFullPath(operationClassDialog.getMappingSheetRow()
                        .getOperationClassFullPath());
                operationClassTextBox.setText(operationClassDialog.getMappingSheetRow().getOperationClassPath());

                if (operationClassDialog.isCancelPressed() && (!(operationClassDialog.isApplyPressed()))) {
                    orignalMappingSheetRow.setNameValueProperty(oldMappingSheetRow.getNameValueProperty());
                }
                if (operationClassDialog.isNoPressed())
                    pressCancel();
                if (operationClassDialog.isYesPressed())
                    pressOK();
                super.widgetSelected(e);
            }

        });
}
项目: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;
}
项目:neoscada    文件:FilterAdvancedComposite.java   
private Button createRemoveButton ()
{
    final Button b = new Button ( this, SWT.PUSH );
    b.setText ( Messages.remove );
    b.addSelectionListener ( new SelectionAdapter () {
        @Override
        public void widgetSelected ( final SelectionEvent e )
        {
            AssertionComposite.this.orCondition.removeAssertion ( AssertionComposite.this );
        }
    } );
    return b;
}
项目:neoscada    文件:FileSelectionPage.java   
@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 ();
}
项目:neoscada    文件:DefinitionContributionItem.java   
@Override
public void fill ( final org.eclipse.swt.widgets.Menu menu, final int index )
{
    final MenuItem item = new MenuItem ( menu, SWT.NONE, index );

    final Profile profile = getProfile ();

    final String name = this.definition.getName () == null ? "<unnamed>" : this.definition.getName ();
    String profileName = profile != null ? profile.getName () : "default";
    if ( profileName == null )
    {
        profileName = "<unnamed>";
    }

    item.setText ( String.format ( "Run %s (%s)", name, profileName ) );

    item.addSelectionListener ( new SelectionAdapter () {
        @Override
        public void widgetSelected ( final SelectionEvent evt )
        {
            try
            {
                run ( name );
            }
            catch ( final Exception e )
            {
                logger.warn ( "Failed to run", e );
                StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, e ), StatusManager.BLOCK );
            }
        }
    } );
}