Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.SelectionAdapter


      }
    }
   

    // Initialize view when user selects it
    folder.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        folder.getShell().setCursor(e.display.getSystemCursor(SWT.CURSOR_WAIT));
        try {
          // Send one last refresh to previous tab, just in case it
          // wants to do something when view goes invisible
View Full Code Here


    Button off_button = new Button (gRadio, SWT.RADIO);
    Messages.setLanguageText(off_button, "beta.wizard.off");
    final Button on_button = new Button (gRadio, SWT.RADIO);
    Messages.setLanguageText(on_button, "beta.wizard.on");
   
    SelectionAdapter l = new SelectionAdapter()
      {
        public void
        widgetSelected(
          SelectionEvent arg0 )
        {
View Full Code Here

        consoleText.setTabs(areaWidth / 6 / charWidth);
      }
    });

    ScrollBar sb = consoleText.getVerticalBar();
    sb.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        bAutoScroll = false;
        if (buttonAutoScroll != null && !buttonAutoScroll.isDisposed())
          buttonAutoScroll.setSelection(false);
      }
    });

    Composite cLeft = new Composite(panel, SWT.NULL);
    layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = 1;
    cLeft.setLayout(layout);
    gd = new GridData(SWT.TOP, SWT.LEAD, false, false);
    cLeft.setLayoutData(gd);

    Button buttonPause = new Button(cLeft, SWT.CHECK);
    Messages.setLanguageText(buttonPause, "LoggerView.pause");
    gd = new GridData();
    buttonPause.setLayoutData(gd);
    buttonPause.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        if (e.widget == null || !(e.widget instanceof Button))
          return;
        Button btn = (Button) e.widget;
        bPaused = btn.getSelection();
        if (!bPaused && buffer != null) {
          refresh();
        }
      }
    });

    Button buttonRealtime = new Button(cLeft, SWT.CHECK);
    Messages.setLanguageText(buttonRealtime, "LoggerView.realtime");
    gd = new GridData();
    buttonRealtime.setLayoutData(gd);
    buttonRealtime.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        if (e.widget == null || !(e.widget instanceof Button))
          return;
        Button btn = (Button) e.widget;
        bRealtime = btn.getSelection();
      }
    });

    buttonAutoScroll = new Button(cLeft, SWT.CHECK);
    Messages.setLanguageText(buttonAutoScroll, "LoggerView.autoscroll");
    gd = new GridData();
    buttonAutoScroll.setLayoutData(gd);
    buttonAutoScroll.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        if (e.widget == null || !(e.widget instanceof Button))
          return;
        Button btn = (Button) e.widget;
        bAutoScroll = btn.getSelection();
      }
    });
    buttonAutoScroll.setSelection(true);

    Button buttonClear = new Button(cLeft, SWT.PUSH);
    Messages.setLanguageText(buttonClear, "LoggerView.clear");
    gd = new GridData();
    buttonClear.setLayoutData(gd);
    buttonClear.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        consoleText.setText("");
      }
    });

    /** FileLogging filter, consisting of a List of types (info, warning, error)
     * and a checkbox Table of component IDs.
     */
    final String sFilterPrefix = "ConfigView.section.logging.filter";
    Group gLogIDs = new Group(panel, SWT.NULL);
    Messages.setLanguageText(gLogIDs, "LoggerView.filter");
    layout = new GridLayout();
    layout.marginHeight = 0;
    layout.numColumns = 2;
    gLogIDs.setLayout(layout);
    gd = new GridData();
    gLogIDs.setLayoutData(gd);

    Label label = new Label(gLogIDs, SWT.NONE);
    Messages.setLanguageText(label, "ConfigView.section.logging.level");
    label.setLayoutData(new GridData());

    final Label labelCatFilter = new Label(gLogIDs, SWT.NONE);
    labelCatFilter.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

    final List listLogTypes = new List(gLogIDs, SWT.BORDER | SWT.SINGLE
        | SWT.V_SCROLL);
    gd = new GridData(SWT.NULL, SWT.BEGINNING, false, false);
    listLogTypes.setLayoutData(gd);

    final int[] logTypes = { LogEvent.LT_INFORMATION, LogEvent.LT_WARNING,
        LogEvent.LT_ERROR };
    for (int i = 0; i < logTypes.length; i++)
      listLogTypes.add(MessageText.getString("ConfigView.section.logging.log"
          + i + "type"));
    listLogTypes.select(0);

    final LogIDs[] logIDs = FileLogging.configurableLOGIDs;
    //Arrays.sort(logIDs);

    Composite cChecksAndButtons = new Composite(gLogIDs, SWT.NULL);
    layout = new GridLayout(2, false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    cChecksAndButtons.setLayout(layout);
    cChecksAndButtons.setLayoutData(new GridData());

    final Composite cChecks = new Composite(cChecksAndButtons, SWT.NULL);
    RowLayout rowLayout = new RowLayout(SWT.VERTICAL);
    rowLayout.wrap = true;
    rowLayout.marginLeft = 0;
    rowLayout.marginRight = 0;
    rowLayout.marginTop = 0;
    rowLayout.marginBottom = 0;
    cChecks.setLayout(rowLayout);

    SelectionAdapter buttonClickListener = new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        int index = listLogTypes.getSelectionIndex();
        if (index < 0 || index >= logTypes.length)
          return;
        Button item = (Button) e.widget;
        if (item.getSelection())
          ignoredComponents[index].remove(item.getData("LOGID"));
        else
          ignoredComponents[index].add(item.getData("LOGID"));
      }
    };
    for (int i = 0; i < logIDs.length; i++) {
      Button btn = new Button(cChecks, SWT.CHECK);
      btn.setText(MessageText.getString(sFilterPrefix + "." + logIDs[i],
          logIDs[i].toString()));

      btn.setData("LOGID", logIDs[i]);

      btn.addSelectionListener(buttonClickListener);

      if (i == 0) {
        gd = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 2);
        gd.heightHint = (btn.computeSize(SWT.DEFAULT, SWT.DEFAULT).y + 2) * 3;
        cChecks.setLayoutData(gd);
      }
    }

    // Update table when list selection changes
    listLogTypes.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        int index = listLogTypes.getSelectionIndex();
        if (index < 0 || index >= logTypes.length)
          return;

        labelCatFilter.setText(MessageText.getString(
            "ConfigView.section.logging.showLogsFor", listLogTypes
                .getSelection()));

        Control[] items = cChecks.getChildren();
        for (int i = 0; i < items.length; i++) {
          if (items[i] instanceof Button) {
            LogIDs ID = (LogIDs) items[i].getData("LOGID");
            if (ID != null) {
              boolean checked = !ignoredComponents[index].contains(ID);
              ((Button) items[i]).setSelection(checked);
            }
          }
        }
      }
    });

    listLogTypes.notifyListeners(SWT.Selection, null);

    Button btn;
    btn = new Button(cChecksAndButtons, SWT.PUSH);
    gd = new GridData();
    btn.setLayoutData(gd);
    Messages.setLanguageText(btn, "LoggerView.filter.checkAll");
    btn.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        int index = listLogTypes.getSelectionIndex();

        Control[] items = cChecks.getChildren();
        for (int i = 0; i < items.length; i++) {
          if (items[i] instanceof Button) {
            LogIDs ID = (LogIDs) items[i].getData("LOGID");
            if (ID != null && ignoredComponents[index].contains(ID)) {
              ((Button) items[i]).setSelection(true);
              ignoredComponents[index].remove(ID);
            }
          }
        }
      }
    });

    btn = new Button(cChecksAndButtons, SWT.PUSH);
    gd = new GridData();
    btn.setLayoutData(gd);
    Messages.setLanguageText(btn, "LoggerView.filter.uncheckAll");
    btn.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        int index = listLogTypes.getSelectionIndex();

        Control[] items = cChecks.getChildren();
        for (int i = 0; i < items.length; i++) {
View Full Code Here

     
    });
   
    _btnBrowse = new Button(container, SWT.None);
    _btnBrowse.setText("...");
    _btnBrowse.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        handleBrowse();
      }
     
    });
   
   
    Label lblBuild = new Label(container, SWT.None);
    lblBuild.setText("Build:");
   
    _txtBuild = new Text(container, SWT.BORDER);
    _txtBuild.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    _txtBuild.setText(Integer.toString(getModel().getPluginBuild()));   
    _txtBuild.addModifyListener(new ModifyListener() {

      public void modifyText(ModifyEvent e) {
        pageChanged();     
      }
     
    });
    _txtBuild.addVerifyListener(new VerifyListener() {

      public void verifyText(VerifyEvent e) {
        if (!Character.isIdentifierIgnorable(e.character)) {
          if (Character.isDigit(e.character)) {
            e.doit = true;
          } else {
            e.doit = false;
          }
        }
      }
     
    });
    new Label(container, SWT.None);
   
   
    Group optFileNameGroup = new Group(container, SWT.None);
    optFileNameGroup.setText("File name");
    GridLayout groupLayout = new GridLayout();
    groupLayout.numColumns = 1;
    optFileNameGroup.setLayout(groupLayout);
    GridData groupLayoutData = new GridData(GridData.FILL_HORIZONTAL);
    groupLayoutData.horizontalSpan = 3;
    optFileNameGroup.setLayoutData(groupLayoutData);
    _optFileNameShort = new Button(optFileNameGroup, SWT.RADIO);
    _optFileNameShort.setText("Short");
    _optFileNameShort.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
    _optFileNameShort.setSelection(true);
    _optFileNameShort.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        pageChanged();
      }
     
    });
    _optFileNameFQ = new Button(optFileNameGroup, SWT.RADIO);
    _optFileNameFQ.setText("Fully qualified");
    _optFileNameFQ.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
    _optFileNameFQ.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        pageChanged();
      }
View Full Code Here

   
    _txtExportLocation.addModifyListener(this);
   
    _btnBrowse = new Button(container, SWT.None);
    _btnBrowse.setText("...");
    _btnBrowse.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        handleBrowse();
      }
View Full Code Here

      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleRemovePublisherOption();
      }
    });
   
    _tablePublisherOptions.getTable().addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        if (_tablePublisherOptions.getTable().getSelectionCount() > 0) {
          PublisherOption option = (PublisherOption) _tablePublisherOptions.getTable().getSelection()[0].getData();
          if (_publisherOptionsModel.isBeanEditable(option)) {
            _tablePublisherOptions.getButton(EditableTableControl.BUTTON_REMOVE).setEnabled(true);
View Full Code Here

      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleRemove();
      }
    });

    _tableModes.getTable().addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {

        if (_tableModes.getTable().getSelectionCount() > 0) {
          String mode = (String) _tableModes.getTable().getSelection()[0].getData();
View Full Code Here

      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleEdit();
      }
    });
   
    _tableControl.getTable().addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        if (_tableControl.getTable().getSelectionCount() > 0) {
          WGADeployment deployment = (WGADeployment) _tableControl.getTable().getSelection()[0].getData();
//          if (deployment.getName().equals(WGADesignerPlugin.getDefault().getWGADeploymentManager().getDefaultDeploymentName()) ||
//              WGADesignerPlugin.getDefault().getWGADeploymentManager().isProjectDeployment(deployment)) {
View Full Code Here

        handleRemove();
      }
    });
   
   
    _tableControl.getTable().addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
       
       
        if (_tableControl.getTable().getSelectionCount() > 0) {
          DesignTemplate design = (DesignTemplate) _tableControl.getTable().getSelection()[0].getData();         
View Full Code Here

      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleEdit();
      }
    });

    _tableControl.getTable().addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        if (_tableControl.getTable().getSelectionCount() > 0) {
          _tableControl.getButton(BUTTON_EDIT).setEnabled(true);
        } else {
          _tableControl.getButton(BUTTON_EDIT).setEnabled(false);
View Full Code Here

TOP

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

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.