Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.SelectionAdapter


        ToolBar colorBar = new ToolBar(colorContainer, SWT.FLAT);
        colorBar.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
        colorBar.setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_WHITE));

        fColorItem = new ToolItem(colorBar, SWT.PUSH);
        fColorItem.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            onSelectColor();
          }
        });
View Full Code Here


    });

    /* Enable Sorting adding listeners to Columns */
    TreeColumn[] columns = fCustomTree.getControl().getColumns();
    for (final TreeColumn column : columns) {
      column.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
          Columns oldSortBy = fNewsSorter.getSortBy();
          Columns newSortBy = (Columns) column.getData(COL_ID);
          boolean defaultAscending = newSortBy.prefersAscending();
View Full Code Here

  private void createLocationInput(Composite parent) {
    fLocationInput = new Text(parent, SWT.BORDER | SWT.SINGLE);
    fLocationInput.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
    fLocationInput.setText(fInput.getUrl());
    fLocationInput.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetDefaultSelected(SelectionEvent e) {
        if (StringUtils.isSet(fLocationInput.getText())) {
          fBrowser.setUrl(fLocationInput.getText());
          fBrowser.getControl().setFocus();
View Full Code Here

      grabTitleBar.setBackground(control.getDisplay().getSystemColor(SWT.COLOR_WHITE));

      ToolItem grabTitleItem = new ToolItem(grabTitleBar, SWT.PUSH);
      grabTitleItem.setImage(OwlUI.getImage(fResources, "icons/etool16/info.gif"));
      grabTitleItem.setToolTipText("Load name from feed");
      grabTitleItem.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
          onGrabTitle();
        }
      });
View Full Code Here

      });

      Button search = new Button(control, SWT.PUSH);
      search.setText("Search...");
      search.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
      search.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
          FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
          dialog.setFilterExtensions(new String[] { "*.opml", "*.xml", "*.*" });
          String file = dialog.open();
View Full Code Here

    /* Delete by Count */
    fDeleteNewsByCountCheck = new Button(container, SWT.CHECK);
    fDeleteNewsByCountCheck.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    fDeleteNewsByCountCheck.setSelection(fPrefDeleteNewsByCountState);
    fDeleteNewsByCountCheck.setText("Maximum number of news to keep: ");
    fDeleteNewsByCountCheck.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        fMaxCountSpinner.setEnabled(fDeleteNewsByCountCheck.getSelection());
      }
    });

    fMaxCountSpinner = new Spinner(container, SWT.BORDER);
    fMaxCountSpinner.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    fMaxCountSpinner.setEnabled(fDeleteNewsByCountCheck.getSelection());
    fMaxCountSpinner.setMinimum(0);
    fMaxCountSpinner.setMaximum(99999);
    fMaxCountSpinner.setSelection(fPrefDeleteNewsByCountValue);

    /* Delete by Age */
    fDeleteNewsByAgeCheck = new Button(container, SWT.CHECK);
    fDeleteNewsByAgeCheck.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    fDeleteNewsByAgeCheck.setSelection(fPrefDeleteNewsByAgeState);
    fDeleteNewsByAgeCheck.setText("Maximum age of news in days: ");
    fDeleteNewsByAgeCheck.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        fMaxAgeSpinner.setEnabled(fDeleteNewsByAgeCheck.getSelection());
      }
    });
View Full Code Here

        grabTitleBar.setBackground(container.getDisplay().getSystemColor(SWT.COLOR_WHITE));

        ToolItem grabTitleItem = new ToolItem(grabTitleBar, SWT.PUSH);
        grabTitleItem.setImage(OwlUI.getImage(fSite.getResourceManager(), "icons/etool16/info.gif"));
        grabTitleItem.setToolTipText("Load name from feed");
        grabTitleItem.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            onGrabTitle();
          }
        });
      }

      /* Other */
      else {

        /* Name */
        Label nameLabel = new Label(container, SWT.None);
        nameLabel.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
        nameLabel.setText("Name: ");

        fNameInput = new Text(container, SWT.BORDER);
        fNameInput.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
        fNameInput.setText(getName(entity));
      }
    }

    /* Location */
    IFolder sameParent = getSameParent(fEntities);
    if (sameParent != null) {
      separateFromTop = true;

      Label locationLabel = new Label(container, SWT.None);
      locationLabel.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
      locationLabel.setText("Location: ");

      /* Exclude Folders that are selected from Chooser */
      List<IFolder> excludes = new ArrayList<IFolder>();
      for (IEntity entity : fEntities) {
        if (entity instanceof IFolder)
          excludes.add((IFolder) entity);
      }

      fFolderChooser = new FolderChooser(container, sameParent, excludes, SWT.BORDER);
      fFolderChooser.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
      fFolderChooser.setLayout(LayoutUtils.createGridLayout(1, 0, 0, 2, 5, false));
      fFolderChooser.setBackground(container.getDisplay().getSystemColor(SWT.COLOR_WHITE));
    }

    /* Other Settings */
    Composite otherSettingsContainer = new Composite(container, SWT.NONE);
    otherSettingsContainer.setLayout(LayoutUtils.createGridLayout(1, 0, 0));
    otherSettingsContainer.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, true, 2, 1));

    if (separateFromTop)
      ((GridLayout) otherSettingsContainer.getLayout()).marginTop = 15;

    /* Auto-Reload */
    Composite autoReloadContainer = new Composite(otherSettingsContainer, SWT.NONE);
    autoReloadContainer.setLayout(LayoutUtils.createGridLayout(3, 0, 0));
    autoReloadContainer.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, true));

    fUpdateCheck = new Button(autoReloadContainer, SWT.CHECK);
    fUpdateCheck.setText("Automatically update the " + (fIsSingleBookMark ? "feed" : "feeds") + " every ");
    fUpdateCheck.setSelection(fPrefUpdateIntervalState);
    fUpdateCheck.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        fReloadSpinner.setEnabled(fUpdateCheck.getSelection());
        fReloadCombo.setEnabled(fUpdateCheck.getSelection());
      }
View Full Code Here

  }

  private void createLocationInput(Composite parent) {
    fLocationInput = new Text(parent, SWT.BORDER | SWT.SINGLE);
    fLocationInput.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
    fLocationInput.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetDefaultSelected(SelectionEvent e) {
        if (StringUtils.isSet(fLocationInput.getText())) {
          fBrowser.setUrl(fLocationInput.getText());
          fBrowser.getControl().setFocus();
View Full Code Here

    fAddFolderBar.setVisible(false);

    ToolItem addFolderItem = new ToolItem(fAddFolderBar, SWT.PUSH);
    addFolderItem.setImage(OwlUI.getImage(fResources, "icons/etool16/add_crop.gif"));
    addFolderItem.setToolTipText("New Folder...");
    addFolderItem.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        onNewFolder();
      }
    });

    ToolBar toggleBar = new ToolBar(toolbarContainer, SWT.FLAT);
    toggleBar.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, true));
    toggleBar.setBackground(fParent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
    toggleBar.setCursor(headerContainer.getDisplay().getSystemCursor(SWT.CURSOR_ARROW));

    fToggleItem = new ToolItem(toggleBar, SWT.PUSH);
    fToggleItem.setImage(OwlUI.getImage(fResources, "icons/ovr16/arrow_down.gif"));
    fToggleItem.setToolTipText("Show Folders");
    fToggleItem.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        onToggle();
      }
    });
View Full Code Here

    autoReloadContainer.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));

    fUpdateCheck = new Button(autoReloadContainer, SWT.CHECK);
    fUpdateCheck.setText("Automatically update the feeds every ");
    fUpdateCheck.setSelection(fGlobalScope.getBoolean(DefaultPreferences.BM_UPDATE_INTERVAL_STATE));
    fUpdateCheck.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        fUpdateValueSpinner.setEnabled(fUpdateCheck.getSelection());
        fUpdateScopeCombo.setEnabled(fUpdateCheck.getSelection());
      }
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.