Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.SelectionListener


        label.setText(Messages.LocationView_prompt);

        text = new Text(aParent, SWT.BORDER);
        text.setText(Messages.LocationView_default);
        text.setEditable(true);
        text.addSelectionListener(new SelectionListener(){
            public void widgetDefaultSelected( SelectionEvent e ) {
                search(createQuery()); // search according to filter
            }
            public void widgetSelected( SelectionEvent e ) {
                quick(text.getText());
View Full Code Here


        sclScaleFactor.setMaximum(100);
        sclScaleFactor.setIncrement(1);
        sclScaleFactor.setPageIncrement(10);
        sclScaleFactor.setSelection(50);
        sclScaleFactor.setLayoutData(new RowData(400, 30));
        sclScaleFactor.addSelectionListener(new SelectionListener() {

            public void widgetDefaultSelected(SelectionEvent arg0) {}

            public void widgetSelected(SelectionEvent event) {
                updateScaleFactorValue();
View Full Code Here

     * @param parent
     * @return
     */
    public Composite createControl(Composite parent){
       
        SelectionListener listener = new SelectionListener(){

            public void widgetDefaultSelected( SelectionEvent e ) {
            }

            public void widgetSelected( SelectionEvent e ) {
View Full Code Here

       
        btnZoomOut = new Button(composite, SWT.PUSH);
        btnZoomOut.setImage(imageCache.get(ICON_ZOOM_OUT));
        btnZoomOut.setToolTipText(Messages.ZoomLevelSwitcher_ZoomOut);
       
        btnZoomOut.addSelectionListener(new SelectionListener() {

            public void widgetSelected( SelectionEvent e ) {
                zoomOut();
            }

            public void widgetDefaultSelected( SelectionEvent e ) {}
        });
       
        btnZoomIn = new Button(composite, SWT.PUSH);
        btnZoomIn.setImage(imageCache.get(ICON_ZOOM_IN));
        btnZoomIn.setToolTipText(Messages.ZoomLevelSwitcher_ZoomIn);
       
        btnZoomIn.addSelectionListener(new SelectionListener() {

            public void widgetSelected( SelectionEvent e ) {
                zoomIn();
            }
View Full Code Here

        txtMiddle.setText("0"); //$NON-NLS-1$
        Label txtRight = new Label(grp, SWT.RIGHT);
        txtRight.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
        txtRight.setText("255"); //$NON-NLS-1$
       
        sliderConst.addSelectionListener(new SelectionListener(){

            public void widgetDefaultSelected( SelectionEvent e ) {
            }

            public void widgetSelected( SelectionEvent e ) {
View Full Code Here

        gd.grabExcessHorizontalSpace = true;
        gd.grabExcessVerticalSpace = true;
        gd.verticalAlignment = GridData.FILL;
        gd.horizontalAlignment = GridData.FILL;
        table.setLayoutData(gd);
        table.addSelectionListener(new SelectionListener() {
            public void widgetDefaultSelected(SelectionEvent e) {
                removeButton.setEnabled(table.getSelectionIndex() != -1);
            }
            public void widgetSelected(SelectionEvent e) {
                removeButton.setEnabled(table.getSelectionIndex() != -1);
View Full Code Here

        DroolsRuntime defaultRuntime = DroolsRuntimeManager.getDefaultDroolsRuntime();
        projectSpecificRuntime = createCheckBox(composite,
            "Use default Drools Runtime (currently "
                + (defaultRuntime == null ? "undefined)" : defaultRuntime.getName() + ")"));
        projectSpecificRuntime.setSelection(true);
        projectSpecificRuntime.addSelectionListener(new SelectionListener() {
            public void widgetDefaultSelected(SelectionEvent e) {
                // do nothing
            }
            public void widgetSelected(SelectionEvent e) {
                isDefaultRuntime = ((Button) e.widget).getSelection();
                droolsRuntimeCombo.setEnabled(!isDefaultRuntime);
            }
        });
        GridData gridData = new GridData();
        gridData.horizontalSpan = 2;
        gridData.grabExcessHorizontalSpace = true;
        gridData.horizontalAlignment = GridData.FILL;
        projectSpecificRuntime.setLayoutData(gridData);
       
        Label nameLabel = new Label(composite, SWT.NONE);
        nameLabel.setText("Drools Runtime:");
        droolsRuntimeCombo = new Combo(composite, SWT.READ_ONLY);
        droolsRuntimeCombo.setEnabled(false);
        droolsRuntimeCombo.addSelectionListener(new SelectionListener() {
            public void widgetDefaultSelected(SelectionEvent e) {
                selectedRuntime = droolsRuntimeCombo.getText();
            }
            public void widgetSelected(SelectionEvent e) {
                selectedRuntime = droolsRuntimeCombo.getText();
            }
        });
        DroolsRuntime[] runtimes = DroolsRuntimeManager.getDroolsRuntimes();
        if (runtimes.length == 0) {
            setErrorMessage("No Drools Runtimes have been defined, configure workspace settings first");
        } else {
            setErrorMessage(null);
            for (int i = 0; i < runtimes.length; i++) {
                droolsRuntimeCombo.add(runtimes[i].getName());
            }
            droolsRuntimeCombo.select(0);
            selectedRuntime = droolsRuntimeCombo.getText();
        }
        gridData = new GridData();
        gridData.grabExcessHorizontalSpace = true;
        gridData.horizontalAlignment = GridData.FILL;
        droolsRuntimeCombo.setLayoutData(gridData);
        Link changeWorkspaceSettingsLink = createLink(composite, "Configure Workspace Settings...");
        changeWorkspaceSettingsLink.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));

        Composite subPanel = new Composite(composite, SWT.NONE);
        gridLayout = new GridLayout();
        gridLayout.numColumns = 2;
        subPanel.setLayout(gridLayout);
        gridData = new GridData();
        gridData.grabExcessHorizontalSpace = true;
        gridData.horizontalAlignment = GridData.FILL;
        gridData.horizontalSpan = 2;
        subPanel.setLayoutData(gridData);

        Label generateLabel = new Label(subPanel, SWT.NONE);
        generateLabel.setText("Generate code compatible with:");
        droolsGenerateCombo = new Combo(subPanel, SWT.READ_ONLY);
        droolsGenerateCombo.add(DROOLS4);
        droolsGenerateCombo.add(DROOLS5);
        droolsGenerateCombo.add(DROOLS5_1);
        droolsGenerateCombo.add(DROOLS6);
        droolsGenerateCombo.addSelectionListener(new SelectionListener() {
            public void widgetDefaultSelected(SelectionEvent e) {
                generationType = droolsGenerateCombo.getText();
              gavPanel.setVisible(getGenerationType().equals(DROOLS6));
              setComplete();
            }
View Full Code Here

    private Link createLink(Composite composite, String text) {
        Link link= new Link(composite, SWT.NONE);
        link.setFont(composite.getFont());
        link.setText("<A>" + text + "</A>")//$NON-NLS-1$//$NON-NLS-2$
        link.addSelectionListener(new SelectionListener() {
            public void widgetSelected(SelectionEvent e) {
                openLink();
            }
            public void widgetDefaultSelected(SelectionEvent e) {
                openLink();
View Full Code Here

        final Composite composite = new Composite(container, SWT.NONE);
        composite.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
        composite.setLayout(new RowLayout());
        final Button addButton = new Button(composite, SWT.NONE);
        addButton.setText("Add");
        addButton.addSelectionListener(new SelectionListener() {
            public void widgetDefaultSelected(SelectionEvent e) {
                Reassignment reassignment = new Reassignment();
                reassignments.add(reassignment);
                tableViewer.add(reassignment);
                tableViewer.refresh();
            }
            public void widgetSelected(SelectionEvent e) {
              Reassignment reassignment = new Reassignment();
                reassignments.add(reassignment);
                tableViewer.add(reassignment);
                tableViewer.refresh();
            }
        });
        final Button deleteButton = new Button(composite, SWT.NONE);
        deleteButton.setText("Remove");
        deleteButton.addSelectionListener(new SelectionListener() {
            public void widgetSelected(SelectionEvent event) {
                TableItem[] items = table.getSelection();
                if (items != null && items.length > 0) {
                  reassignments.remove((Reassignment) items[0].getData());
                    tableViewer.remove(items[0]);
View Full Code Here

        gd_table.heightHint = 100;
        table.setLayoutData(gd_table);
        table.setLinesVisible(true);
        table.setHeaderVisible(true);
       
        table.addSelectionListener(new SelectionListener() {
     
      public void widgetSelected(SelectionEvent e) {
        TableItem[] items = table.getSelection();
                if (items != null && items.length > 0) {
                  int index = notifications.indexOf((Notification) items[0].getData());
                  Notification notification = notifications.get(index);
                 
                    notifyFromText.setText(notification.getFrom());
                    notifyToText.setText(notification.getTo());
                    notifyToGroupsText.setText(notification.getToGroups());
                    notifyReplyToText.setText(notification.getReplyTo());
                    notifySubjectText.setText(notification.getSubject());
                    notifyBodyText.setText(notification.getBody());
                    notifyTypeText.setText(notification.getType());
                    notifyExpiresAtText.setText(notification.getExpiresAt());
                } else {
                  notifyFromText.setText("");
                    notifyToText.setText("");
                    notifyToGroupsText.setText("");
                    notifyReplyToText.setText("");
                    notifySubjectText.setText("");
                    notifyBodyText.setText("");
                    notifyTypeText.setText("");
                    notifyExpiresAtText.setText("");
                }
       
      }
     
      public void widgetDefaultSelected(SelectionEvent e) {
        TableItem[] items = table.getSelection();
                if (items != null && items.length > 0) {
                  int index = notifications.indexOf((Notification) items[0].getData());
                  Notification notification = notifications.get(index);
                 
                    notifyFromText.setText(notification.getFrom());
                    notifyToText.setText(notification.getTo());
                    notifyToGroupsText.setText(notification.getToGroups());
                    notifyReplyToText.setText(notification.getReplyTo());
                    notifySubjectText.setText(notification.getSubject());
                    notifyBodyText.setText(notification.getBody());
                    notifyTypeText.setText(notification.getType());
                    notifyExpiresAtText.setText(notification.getExpiresAt());
                } else {
                  notifyFromText.setText("");
                    notifyToText.setText("");
                    notifyToGroupsText.setText("");
                    notifyReplyToText.setText("");
                    notifySubjectText.setText("");
                    notifyBodyText.setText("");
                    notifyTypeText.setText("");
                    notifyExpiresAtText.setText("");
                }
      }
    });

        tableViewer.setContentProvider(new NotificationsContentProvider());
        tableViewer.setInput(notifications);
        // add/delete buttons
        final Composite composite = new Composite(container, SWT.NONE);
        composite.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
        composite.setLayout(new RowLayout());
        final Button addButton = new Button(composite, SWT.NONE);
        addButton.setText("Add");
        addButton.addSelectionListener(new SelectionListener() {
            public void widgetDefaultSelected(SelectionEvent e) {
                Notification notification = new Notification();
                notification.setFrom(notifyFromText.getText());
                notification.setTo(notifyToText.getText());
                notification.setToGroups(notifyToGroupsText.getText());
                notification.setReplyTo(notifyReplyToText.getText());
                notification.setSubject(notifySubjectText.getText());
                notification.setBody(notifyBodyText.getText());
                notification.setType(notifyTypeText.getText());
                notification.setExpiresAt(notifyExpiresAtText.getText());
                notifications.add(notification);
                tableViewer.add(notification);
                tableViewer.refresh();
                // clear fields after add operation
                notifyFromText.setText("");
                notifyToText.setText("");
                notifyToGroupsText.setText("");
                notifyReplyToText.setText("");
                notifySubjectText.setText("");
                notifyBodyText.setText("");
                notifyTypeText.setText("");
                notifyExpiresAtText.setText("");
               
            }
            public void widgetSelected(SelectionEvent e) {
              Notification notification = new Notification();
                notification.setFrom(notifyFromText.getText());
                notification.setTo(notifyToText.getText());
                notification.setToGroups(notifyToGroupsText.getText());
                notification.setReplyTo(notifyReplyToText.getText());
                notification.setSubject(notifySubjectText.getText());
                notification.setBody(notifyBodyText.getText());
                notification.setType(notifyTypeText.getText());
                notification.setExpiresAt(notifyExpiresAtText.getText());
                notifications.add(notification);
                tableViewer.add(notification);
                tableViewer.refresh();
                // clear fields after add operation
                notifyFromText.setText("");
                notifyToText.setText("");
                notifyToGroupsText.setText("");
                notifyReplyToText.setText("");
                notifySubjectText.setText("");
                notifyBodyText.setText("");
                notifyTypeText.setText("");
                notifyExpiresAtText.setText("");
            }
        });
        final Button deleteButton = new Button(composite, SWT.NONE);
        deleteButton.setText("Remove");
        deleteButton.addSelectionListener(new SelectionListener() {
            public void widgetSelected(SelectionEvent event) {
                TableItem[] items = table.getSelection();
                if (items != null && items.length > 0) {
                  notifications.remove((Notification) items[0].getData());
                    tableViewer.remove(items[0]);
                    tableViewer.refresh();
                }
            }
            public void widgetDefaultSelected(SelectionEvent event) {
                TableItem[] items = table.getSelection();
                if (items != null && items.length > 0) {
                  notifications.remove((Notification) items[0].getData());
                    tableViewer.remove(items[0]);
                    tableViewer.refresh();
                }
            }
        });
       
        final Button updateButton = new Button(composite, SWT.NONE);
        updateButton.setText("Update");
        updateButton.addSelectionListener(new SelectionListener() {
            public void widgetSelected(SelectionEvent event) {
                TableItem[] items = table.getSelection();
                if (items != null && items.length > 0) {
                  int index = notifications.indexOf((Notification) items[0].getData());
                  Notification notification = notifications.get(index);
                  notification.setFrom(notifyFromText.getText());
                    notification.setTo(notifyToText.getText());
                    notification.setToGroups(notifyToGroupsText.getText());
                    notification.setReplyTo(notifyReplyToText.getText());
                    notification.setSubject(notifySubjectText.getText());
                    notification.setBody(notifyBodyText.getText());
                    notification.setType(notifyTypeText.getText());
                    notification.setExpiresAt(notifyExpiresAtText.getText());
                    tableViewer.refresh();
                    // clear fields after add operation
                    notifyFromText.setText("");
                    notifyToText.setText("");
                    notifyToGroupsText.setText("");
                    notifyReplyToText.setText("");
                    notifySubjectText.setText("");
                    notifyBodyText.setText("");
                    notifyTypeText.setText("");
                    notifyExpiresAtText.setText("");
                }
            }
            public void widgetDefaultSelected(SelectionEvent event) {
                TableItem[] items = table.getSelection();
                if (items != null && items.length > 0) {
                  int index = notifications.indexOf((Notification) items[0].getData());
                  Notification notification = notifications.get(index);
                  notification.setFrom(notifyFromText.getText());
                    notification.setTo(notifyToText.getText());
                    notification.setToGroups(notifyToGroupsText.getText());
                    notification.setReplyTo(notifyReplyToText.getText());
                    notification.setSubject(notifySubjectText.getText());
                    notification.setBody(notifyBodyText.getText());
                    notification.setType(notifyTypeText.getText());
                    notification.setExpiresAt(notifyExpiresAtText.getText());
                    tableViewer.refresh();
                    // clear fields after add operation
                    notifyFromText.setText("");
                    notifyToText.setText("");
                    notifyToGroupsText.setText("");
                    notifyReplyToText.setText("");
                    notifySubjectText.setText("");
                    notifyBodyText.setText("");
                    notifyTypeText.setText("");
                    notifyExpiresAtText.setText("");
                }
            }
        });
       
        final Button clearButton = new Button(composite, SWT.NONE);
        clearButton.setText("Clear");
        clearButton.addSelectionListener(new SelectionListener() {
            public void widgetSelected(SelectionEvent event) {
              // clear fields after add operation
                notifyFromText.setText("");
                notifyToText.setText("");
                notifyToGroupsText.setText("");
View Full Code Here

TOP

Related Classes of org.eclipse.swt.events.SelectionListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.