Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Spinner


                    // doSave(null);
                    // }
                    // });

                    // property instance limit (widget)
                    propertyLimitSpinner = new Spinner(propertyGroup, SWT.NONE);
                    propertyLimitSpinner.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, false, false));
                    propertyLimitSpinner.setToolTipText(Messages
                            .getString("object.template.editor.property.limit.tooltip"));
                    propertyLimitSpinner.setIncrement(1);
                    propertyLimitSpinner.setMinimum(0);
View Full Code Here


            logger.debug("creating starting level field");
            label = new Label(generalGroup, SWT.RIGHT);
            label.setText(res.getLocaleString("campaign.editor.starting_level.label"));
            label.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));

            startingLevel = new Spinner(generalGroup, SWT.BORDER);
            {
                GridData gd = new GridData(GridData.FILL_HORIZONTAL);
                gd.horizontalSpan = 2;
                startingLevel.setLayoutData(gd);
            }
View Full Code Here

    super(id);
  }

  @Override
  protected Control createControl(Composite parent) {
    text = new Spinner(parent, SWT.BORDER | SWT.FLAT);
    text.setToolTipText("Number of iterations");
    text.setTextLimit(3);
    text.setSize(25, 15);
    text.setDigits(0);
    text.setIncrement(1);
View Full Code Here

    scale.setMaximum(100);
    scale.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
    scale.setSelection(cacheManager.getSelectedGoalPriority(
        (Goal) rootElement).intValue());

    final Spinner spinner = new Spinner(composite, SWT.NONE);

    spinner.setMinimum(0);
    spinner.setMaximum(100);
    spinner.setSelection(scale.getSelection());
    spinner.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false, false,
        1, 1));

    final Button lockButton = new Button(composite, SWT.TOGGLE);
    lockButton.setText(UNLOCKED_STATE_STRING);
    lockButton.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false,
        false, 1, 1));

    final Button deselectButton = new Button(composite, SWT.TOGGLE);
    deselectButton.setImage(PlatformUI.getWorkbench().getSharedImages()
        .getImage(ISharedImages.IMG_TOOL_DELETE));
    deselectButton.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false,
        false, 1, 1));
    deselectButton.setSelection(cacheManager
        .goalIsMarkedAsToRemove((Goal) rootElement));
    deselectButton.setSelection(cacheManager
        .goalIsMarkedAsToRemove((Goal) rootElement));
    deselectButton.addSelectionListener(new SelectionListener() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        if (deselectButton.getSelection()) {
          builder.deselectRootElement((Goal) rootElement);
          scale.setSelection(0);
          spinner.setSelection(0);

          updateRelatedScales(spinner, scale, rootElement,
              spinner.getSelection(), cacheManager, true);
          lockButton.setSelection(true);
          lockButton.setText(LOCKED_STATE_STRING);
          setLockStateForControls();
          spinner.setEnabled(false);
          scale.setEnabled(false);
          lockButton.setEnabled(false);

        } else {
          builder.reselectRootElement((Goal) rootElement);
          spinner.setEnabled(true);
          scale.setEnabled(true);
          lockButton.setEnabled(true);
        }
        udaptePriorityLabel(priorityLabel, cacheManager,
            (Goal) rootElement);
      }

      @Override
      public void widgetDefaultSelected(SelectionEvent e) {
      }
    });

    lockedMap.put(rootElement, false);
    scalesMap.put(scale, rootElement);
    spinnersMap.put(spinner, rootElement);

    scale.addSelectionListener(new SelectionListener() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        updateRelatedScales(spinner, scale, rootElement,
            scale.getSelection(), cacheManager, false);
        udaptePriorityLabel(priorityLabel, cacheManager,
            (Goal) rootElement);
      }

      @Override
      public void widgetDefaultSelected(SelectionEvent e) {

      }
    });

    spinner.addSelectionListener(new SelectionListener() {

      @Override
      public void widgetSelected(SelectionEvent e) {
 
        updateRelatedScales(spinner, scale, rootElement,
            spinner.getSelection(), cacheManager, false);
        udaptePriorityLabel(priorityLabel, cacheManager,
            (Goal) rootElement);
      }

      @Override
View Full Code Here

    scale.setMaximum(100);
    scale.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
    scale.setSelection(cacheManager
        .getSelectedGoalPriorizedDecompositionWeight(source, target));

    final Spinner spinner = new Spinner(composite, SWT.NONE);

    spinner.setMinimum(0);
    spinner.setMaximum(100);
    spinner.setSelection(scale.getSelection());
    spinner.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false, false,
        1, 1));

    final Button lockButton = new Button(composite, SWT.TOGGLE);

    lockButton.setFont(lockButtonFont);
    lockButton.setText(UNLOCKED_STATE_STRING);
    lockButton.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false,
        false, 1, 1));

    final Button deselectButton = new Button(composite, SWT.TOGGLE);
    deselectButton.setImage(PlatformUI.getWorkbench().getSharedImages()
        .getImage(ISharedImages.IMG_TOOL_DELETE));
     
    deselectButton.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false,
        false, 1, 1));
    deselectButton.setSelection(cacheManager
        .goalDecompositionIsMarkedAsToRemove(decomposition));
   
    deselectButton.addSelectionListener(new SelectionListener() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        if (deselectButton.getSelection()) {
          builder.deselectDecomposition(decomposition);
          scale.setSelection(0);
          spinner.setSelection(0);

          updateRelatedScales(spinner, scale, decomposition,
              scale.getSelection(), cacheManager, true);
          lockButton.setSelection(true);
          lockButton.setText(LOCKED_STATE_STRING);
          setLockStateForControls();
          spinner.setEnabled(false);
          scale.setEnabled(false);
          lockButton.setEnabled(false);
        } else {
          builder.reselectDecomposition(decomposition);
          scale.setSelection(cacheManager
              .getSelectedGoalPriorizedDecompositionWeight(cacheManager
                  .getSelectedGoalsPriorizedDecomposition(decomposition)));
          spinner.setEnabled(true);
          scale.setEnabled(true);
          lockButton.setEnabled(true);
        }
        udaptePriorityLabel(priorityLabel, cacheManager, source, target);

      }

      @Override
      public void widgetDefaultSelected(SelectionEvent e) {
      }
    });

    lockedMap
        .put(decomposition, cacheManager
            .goalDecompositionIsMarkedAsToRemove(decomposition));
    scalesMap.put(scale, decomposition);
    spinnersMap.put(spinner, decomposition);

    scale.addSelectionListener(new SelectionListener() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        spinner.setSelection(scale.getSelection());
        updateRelatedScales(spinner, scale, decomposition,
            scale.getSelection(), cacheManager, false);
        udaptePriorityLabel(priorityLabel, cacheManager, source, target);
      }

      @Override
      public void widgetDefaultSelected(SelectionEvent e) {

      }
    });

    spinner.addSelectionListener(new SelectionListener() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        scale.setSelection(spinner.getSelection());
        updateRelatedScales(spinner, scale, decomposition,
            spinner.getSelection(), cacheManager, false);
        udaptePriorityLabel(priorityLabel, cacheManager, source, target);
      }

      @Override
      public void widgetDefaultSelected(SelectionEvent e) {
View Full Code Here

    thresholdScale.setMaximum(200);
    thresholdScale.setSelection(100);
    thresholdScale.setToolTipText("please select a minimal threshold for the attribute explorer here");
   
   
    final Spinner thresholdSpinner = new Spinner(thresholdGroup, SWT.NONE);
    thresholdSpinner.setMinimum(-100);
    thresholdSpinner.setMaximum(100);
    thresholdSpinner.setSelection(0);
    thresholdSpinner.setToolTipText("please select a minimal threshold for the attribute explorer here");

    final Combo thresholdCombo = new Combo(thresholdGroup, SWT.DROP_DOWN);
    thresholdCombo.add("makes");
    thresholdCombo.add("some positive");
    thresholdCombo.add("helps");
    thresholdCombo.add("neutral");
    thresholdCombo.add("hurts");
    thresholdCombo.add("some negative");
    thresholdCombo.add("breaks");
    thresholdCombo.setToolTipText("please select a minimal threshold for the attribute explorer here");

    thresholdCombo.select(3);
    thresholdGroup.setEnabled(false);
    thresholdScale.setEnabled(false);
    thresholdSpinner.setEnabled(false);
    thresholdCombo.setEnabled(false);

    attributeExplorerCheckbox.addSelectionListener(new SelectionListener() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        boolean enabled = attributeExplorerCheckbox.getSelection();
        thresholdGroup.setEnabled(enabled);
        thresholdScale.setEnabled(enabled);
        thresholdSpinner.setEnabled(enabled);
        thresholdCombo.setEnabled(enabled);
      }

      @Override
      public void widgetDefaultSelected(SelectionEvent e) {
      }
    });

    thresholdScale.addSelectionListener(new SelectionListener() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        thresholdSpinner.setSelection(thresholdScale.getSelection() - 100);
        updateThresholdComboSelection(thresholdSpinner, thresholdCombo);
      }

      @Override
      public void widgetDefaultSelected(SelectionEvent e) {
      }
    });

    thresholdSpinner.addSelectionListener(new SelectionListener() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        thresholdScale.setSelection(thresholdSpinner.getSelection() + 100);
        updateThresholdComboSelection(thresholdSpinner, thresholdCombo);
      }

      @Override
      public void widgetDefaultSelected(SelectionEvent e) {
      }
    });

    thresholdCombo.addSelectionListener(new SelectionListener() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        switch (thresholdCombo.getSelectionIndex()) {
        case 0:
          thresholdScale.setSelection(176);
          thresholdSpinner.setSelection(76);
          break;
        case 1:
          thresholdScale.setSelection(126);
          thresholdSpinner.setSelection(26);
          break;
        case 2:
          thresholdScale.setSelection(101);
          thresholdSpinner.setSelection(1);
          break;
        case 3:
          thresholdScale.setSelection(100);
          thresholdSpinner.setSelection(0);
          break;
        case 4:
          thresholdScale.setSelection(99);
          thresholdSpinner.setSelection(-1);
          break;
        case 5:
          thresholdScale.setSelection(74);
          thresholdSpinner.setSelection(-26);
          break;
        case 6:
          thresholdScale.setSelection(24);
          thresholdSpinner.setSelection(-76);
          break;

        default:
          break;
        }
View Full Code Here

    gridData.horizontalAlignment = SWT.FILL;
    gridData.grabExcessHorizontalSpace = false;
    nScale.setLayoutData(gridData);
    nScale.setToolTipText("select here the number of calculated subpatterns used for the NGram similarity check");

    nSpinner = new Spinner(composite, SWT.NONE);
    nSpinner.setMinimum(nScale.getMinimum());
    nSpinner.setMaximum(nScale.getMaximum());
    nSpinner.setSelection(nScale.getSelection());
    gridData = new GridData();
    gridData.horizontalSpan = 1;
    gridData.horizontalAlignment = SWT.LEFT;
    gridData.grabExcessHorizontalSpace = false;
    nSpinner.setLayoutData(gridData);
    nSpinner.setToolTipText(nScale.getToolTipText());
    nSpinner.addSelectionListener(new SelectionListener() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        nScale.setSelection(nSpinner.getSelection());
        if (getFilterWord() != null && getFilterWord() != "")
          searchProperties(getFilterWord(), getN(), getMinCorrelation(),  cataloguge,
              assignedConstraintedSet);

      }

      @Override
      public void widgetDefaultSelected(SelectionEvent e) {

      }
    });

    nScale.addSelectionListener(new SelectionListener() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        nSpinner.setSelection(nScale.getSelection());
        if (getFilterWord() != null && getFilterWord() != "")
          searchProperties(getFilterWord(), getN(), getMinCorrelation(),  cataloguge,
              assignedConstraintedSet);

      }

      @Override
      public void widgetDefaultSelected(SelectionEvent e) {

      }
    });
    new Label(composite, SWT.NONE); //dummy

    Label minCorrelationCaptionLabel = new Label(composite, SWT.NONE);

    minCorrelationCaptionLabel.setText("min correlation");
    gridData = new GridData();
    gridData.horizontalSpan = 1;
    gridData.horizontalAlignment = SWT.LEFT;
    gridData.grabExcessHorizontalSpace = false;
    minCorrelationCaptionLabel.setLayoutData(gridData);

    minCorrelationScale = new Scale(composite, SWT.NONE);
    minCorrelationScale.setMaximum(100);
    minCorrelationScale.setMinimum(0);
    minCorrelationScale.setSelection(80);

    gridData = new GridData();
    gridData.horizontalSpan = 1;
    gridData.horizontalAlignment = SWT.FILL;
    gridData.grabExcessHorizontalSpace = true;
    minCorrelationScale.setLayoutData(gridData);
    minCorrelationScale.setToolTipText("select here the minimal correlation used for the NGram similarity check");

    minCorrelationSpinner = new Spinner(composite, SWT.NONE);
    minCorrelationSpinner.setMaximum(minCorrelationScale.getMaximum());
    minCorrelationSpinner.setMinimum(minCorrelationScale.getMinimum());
    minCorrelationSpinner.setSelection(minCorrelationScale.getSelection());
    minCorrelationSpinner.setToolTipText(minCorrelationScale.getToolTipText());
    gridData = new GridData();
View Full Code Here

    }
    /**
     * {@inheritDoc}
     */
    public Spinner createWidget(AbstractDataView parent, int style) {
        return new Spinner(parent, style);
    }
View Full Code Here

        if (item == null)
          return;

        // The control that will be the editor must be a child of the
        // Table
        Spinner newEditor = new Spinner(table, SWT.NONE);

        if (item.getData() instanceof ConstraintData) {
          ConstraintData data = (ConstraintData) item.getData();
          newEditor.setSelection(data.getWeight());
        }

        newEditor.addModifyListener(new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            if (editor.getItem().isDisposed()) {
              return;
            }
            Spinner spinner = (Spinner) editor.getEditor();
            int newWeight = spinner.getSelection();
            TableItem item = editor.getItem();
            if (item.getData() instanceof ConstraintData) {
              ConstraintData data = (ConstraintData) item.getData();
              data.setWeight(newWeight);
            }
View Full Code Here

    Label lblNumberOfMeasures = new Label(grpInsertMeasures, SWT.NONE);
    lblNumberOfMeasures.setBounds(10, 15, 220, 14);
    lblNumberOfMeasures.setText("Number of Measures to insert:");
    lblNumberOfMeasures.setToolTipText("Number of Measures to insert:");
   
    spinner = new Spinner(grpInsertMeasures, SWT.BORDER);
    spinner.setToolTipText("Enter a number between 1 and 100");
    spinner.setTextLimit(3);
    spinner.setMinimum(1);
    spinner.setMaximum(100);
    spinner.setSelection(1);
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.Spinner

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.