Examples of Spinner

  • pivot.wtk.Spinner
    Component that presents a means of cycling through a list of items. @author tvolkert

  • Examples of org.eclipse.swt.widgets.Spinner

            }

              /* Type: Number */
            case ISearchValueType.NUMBER:
            case ISearchValueType.INTEGER: {
              final Spinner spinner = new Spinner(inputField, SWT.BORDER);
              spinner.setMinimum(0);
              spinner.setMaximum(1000);
              spinner.addListener(SWT.Modify, new Listener() {
                public void handleEvent(Event event) {
                  fInputValue = spinner.getSelection();

                  if (!fInputValue.equals(input))
                    fModified = true;
                }
              });

              /* Pre-Select input if given */
              Object presetInput = (input == null) ? fInputValue : input;
              if (presetInput != null && presetInput instanceof Integer)
                spinner.setSelection((Integer) presetInput);

              /* Update Input Value */
              fInputValue = spinner.getSelection();

              break;
            }

              /* Type: String */
     
    View Full Code Here

    Examples of org.eclipse.swt.widgets.Spinner

          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(1000);
        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());
          }
        });

        fMaxAgeSpinner = new Spinner(container, SWT.BORDER);
        fMaxAgeSpinner.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        fMaxAgeSpinner.setEnabled(fDeleteNewsByAgeCheck.getSelection());
        fMaxAgeSpinner.setMinimum(0);
        fMaxAgeSpinner.setMaximum(1000);
        fMaxAgeSpinner.setSelection(fPrefDeleteNewsByAgeValue);
    View Full Code Here

    Examples of org.eclipse.swt.widgets.Spinner

            public void widgetSelected(SelectionEvent e) {
              fMaxLastVisitSpinner.setEnabled(fDeleteFeedByLastVisitCheck.getSelection());
            }
          });

          fMaxLastVisitSpinner = new Spinner(container, SWT.BORDER);
          fMaxLastVisitSpinner.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
          fMaxLastVisitSpinner.setEnabled(fDeleteFeedByLastVisitCheck.getSelection());
          fMaxLastVisitSpinner.setMinimum(1);
          fMaxLastVisitSpinner.setMaximum(999);
          fMaxLastVisitSpinner.setSelection(fGlobalScope.getInteger(DefaultPreferences.CLEAN_UP_BM_BY_LAST_VISIT_VALUE));

          Label label = new Label(container, SWT.None);
          label.setText("days");
        }

        /* 2.) Delete Feeds that have not updated in X Days */
        {
          fDeleteFeedByLastUpdateCheck = new Button(container, SWT.CHECK);
          fDeleteFeedByLastUpdateCheck.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
          fDeleteFeedByLastUpdateCheck.setSelection(fGlobalScope.getBoolean(DefaultPreferences.CLEAN_UP_BM_BY_LAST_UPDATE_STATE));
          fDeleteFeedByLastUpdateCheck.setText("Delete bookmarks that have not been updated for ");
          fDeleteFeedByLastUpdateCheck.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
              fMaxLastUpdateSpinner.setEnabled(fDeleteFeedByLastUpdateCheck.getSelection());
            }
          });

          fMaxLastUpdateSpinner = new Spinner(container, SWT.BORDER);
          fMaxLastUpdateSpinner.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
          fMaxLastUpdateSpinner.setEnabled(fDeleteFeedByLastUpdateCheck.getSelection());
          fMaxLastUpdateSpinner.setMinimum(1);
          fMaxLastUpdateSpinner.setMaximum(999);
          fMaxLastUpdateSpinner.setSelection(fGlobalScope.getInteger(DefaultPreferences.CLEAN_UP_BM_BY_LAST_UPDATE_VALUE));
    View Full Code Here

    Examples of org.eclipse.swt.widgets.Spinner

            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(9999);
          fMaxCountSpinner.setSelection(fGlobalScope.getInteger(DefaultPreferences.CLEAN_UP_NEWS_BY_COUNT_VALUE));
        }

        /* 5.) Delete News with an age > X Days */
        {
          fDeleteNewsByAgeCheck = new Button(container, SWT.CHECK);
          fDeleteNewsByAgeCheck.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
          fDeleteNewsByAgeCheck.setSelection(fGlobalScope.getBoolean(DefaultPreferences.CLEAN_UP_NEWS_BY_AGE_STATE));
          fDeleteNewsByAgeCheck.setText("Maximum age of news in days: ");
          fDeleteNewsByAgeCheck.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
              fMaxAgeSpinner.setEnabled(fDeleteNewsByAgeCheck.getSelection());
            }
          });

          fMaxAgeSpinner = new Spinner(container, SWT.BORDER);
          fMaxAgeSpinner.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
          fMaxAgeSpinner.setEnabled(fDeleteNewsByAgeCheck.getSelection());
          fMaxAgeSpinner.setMinimum(1);
          fMaxAgeSpinner.setMaximum(9999);
          fMaxAgeSpinner.setSelection(fGlobalScope.getInteger(DefaultPreferences.CLEAN_UP_NEWS_BY_AGE_VALUE));
    View Full Code Here

    Examples of org.eclipse.swt.widgets.Spinner

        /* Specially treat Age */
        else if (field.getId() == INews.AGE_IN_DAYS || field.getId() == INews.AGE_IN_MINUTES) {
          Composite container = new Composite(inputField, SWT.NONE);
          container.setLayout(LayoutUtils.createGridLayout(2, 0, 0));

          final Spinner spinner = new Spinner(container, SWT.BORDER);
          spinner.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
          spinner.setMinimum(1);
          spinner.setMaximum(1000000);

          final Combo combo = new Combo(container, SWT.BORDER | SWT.READ_ONLY);
          combo.add(Messages.SearchConditionItem_DAYS);
          combo.add(Messages.SearchConditionItem_HOURS);
          combo.add(Messages.SearchConditionItem_MINUTES);

          Listener listener = new Listener() {
            public void handleEvent(Event event) {
              fInputValue = getAgeValue(spinner, combo);

              if (!fInputValue.equals(input))
                fModified = true;
            }
          };
          spinner.addListener(SWT.Modify, listener);
          combo.addListener(SWT.Modify, listener);

          /* Pre-Select input if given */
          Object presetInput = (input == null) ? fInputValue : input;
          if (presetInput != null && presetInput instanceof Integer) {
            Integer inputValue = (Integer) presetInput;

            /* Day */
            if (inputValue >= 0) {
              spinner.setSelection(inputValue);
              combo.select(0);
            }

            /* Hour */
            else if (inputValue % 60 == 0) {
              spinner.setSelection(Math.abs(inputValue) / 60);
              combo.select(1);
            }

            /* Minute */
            else {
              spinner.setSelection(Math.abs(inputValue));
              combo.select(2);
            }
          }

          /* Otherwise use Default */
          else {
            spinner.setSelection(1);
            combo.select(0);
          }

          /* Update Input Value */
          fInputValue = getAgeValue(spinner, combo);
        }

        /* Create new Input Field based on search-value-type */
        else {
          switch (field.getSearchValueType().getId()) {

            /* Type: Boolean */
            case ISearchValueType.BOOLEAN: {
              final Combo combo = new Combo(inputField, SWT.BORDER | SWT.READ_ONLY);
              combo.add(Messages.SearchConditionItem_TRUE);
              combo.add(Messages.SearchConditionItem_FALSE);
              combo.addListener(SWT.Modify, new Listener() {
                public void handleEvent(Event event) {
                  fInputValue = Boolean.valueOf(combo.getItem(combo.getSelectionIndex()));

                  if (!fInputValue.equals(input))
                    fModified = true;
                }
              });

              /* Pre-Select input if given */
              Object presetInput = (input == null) ? fInputValue : input;
              if (presetInput != null && presetInput instanceof Boolean)
                combo.select(((Boolean) presetInput) ? 0 : 1);
              else
                combo.select(0);

              /* Update Input Value */
              fInputValue = Boolean.valueOf(combo.getItem(combo.getSelectionIndex()));

              break;
            }

              /* Type: Date / Time */
            case ISearchValueType.DATE:
            case ISearchValueType.TIME:
            case ISearchValueType.DATETIME: {
              final Calendar cal = Calendar.getInstance();
              final DateTime datetime = new DateTime(inputField, SWT.DATE | SWT.BORDER);
              datetime.addListener(SWT.Selection, new Listener() {
                public void handleEvent(Event event) {
                  cal.set(Calendar.DATE, datetime.getDay());
                  cal.set(Calendar.MONTH, datetime.getMonth());
                  cal.set(Calendar.YEAR, datetime.getYear());

                  fInputValue = cal.getTime();

                  if (!fInputValue.equals(input))
                    fModified = true;
                }
              });

              /* Pre-Select input if given */
              Object presetInput = (input == null) ? fInputValue : input;
              if (presetInput != null && presetInput instanceof Date)
                cal.setTime((Date) presetInput);

              datetime.setDay(cal.get(Calendar.DATE));
              datetime.setMonth(cal.get(Calendar.MONTH));
              datetime.setYear(cal.get(Calendar.YEAR));

              /* Update Input Value */
              fInputValue = cal.getTime();

              break;
            }

              /* Type: Enumeration */
            case ISearchValueType.ENUM: {
              final Text text = new Text(inputField, SWT.BORDER);
              text.addListener(SWT.Modify, new Listener() {
                public void handleEvent(Event event) {
                  fInputValue = text.getText();

                  if (!fInputValue.equals(input))
                    fModified = true;
                }
              });

              /* Provide Auto-Complete Field */
              OwlUI.hookAutoComplete(text, field.getSearchValueType().getEnumValues(), true, true);

              /* Pre-Select input if given */
              String inputValue = (input != null ? input.toString() : null);
              if (inputValue != null)
                text.setText(inputValue);

              /* Update Input Value */
              fInputValue = text.getText();

              break;
            }

              /* Type: Number */
            case ISearchValueType.NUMBER:
            case ISearchValueType.INTEGER: {
              final Spinner spinner = new Spinner(inputField, SWT.BORDER);
              spinner.setMinimum(0);
              spinner.setMaximum(1000);
              spinner.addListener(SWT.Modify, new Listener() {
                public void handleEvent(Event event) {
                  fInputValue = spinner.getSelection();

                  if (!fInputValue.equals(input))
                    fModified = true;
                }
              });

              /* Pre-Select input if given */
              Object presetInput = (input == null) ? fInputValue : input;
              if (presetInput != null && presetInput instanceof Integer)
                spinner.setSelection((Integer) presetInput);

              /* Update Input Value */
              fInputValue = spinner.getSelection();

              break;
            }

              /* Type: String */
     
    View Full Code Here

    Examples of org.eclipse.swt.widgets.Spinner

            public void widgetSelected(SelectionEvent e) {
              fMaxLastVisitSpinner.setEnabled(fDeleteFeedByLastVisitCheck.getSelection());
            }
          });

          fMaxLastVisitSpinner = new Spinner(container, SWT.BORDER);
          fMaxLastVisitSpinner.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
          fMaxLastVisitSpinner.setEnabled(fDeleteFeedByLastVisitCheck.getSelection());
          fMaxLastVisitSpinner.setMinimum(1);
          fMaxLastVisitSpinner.setMaximum(999);
          fMaxLastVisitSpinner.setSelection(fGlobalScope.getInteger(DefaultPreferences.CLEAN_UP_BM_BY_LAST_VISIT_VALUE));

          Label label = new Label(container, SWT.None);
          label.setText(Messages.CleanUpOptionsPage_DAYS);
        }

        /* 2.) Delete Feeds that have not updated in X Days */
        {
          fDeleteFeedByLastUpdateCheck = new Button(container, SWT.CHECK);
          fDeleteFeedByLastUpdateCheck.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
          fDeleteFeedByLastUpdateCheck.setSelection(fGlobalScope.getBoolean(DefaultPreferences.CLEAN_UP_BM_BY_LAST_UPDATE_STATE));
          fDeleteFeedByLastUpdateCheck.setText(Messages.CleanUpOptionsPage_DELETE_BY_UPDATE);
          fDeleteFeedByLastUpdateCheck.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
              fMaxLastUpdateSpinner.setEnabled(fDeleteFeedByLastUpdateCheck.getSelection());
            }
          });

          fMaxLastUpdateSpinner = new Spinner(container, SWT.BORDER);
          fMaxLastUpdateSpinner.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
          fMaxLastUpdateSpinner.setEnabled(fDeleteFeedByLastUpdateCheck.getSelection());
          fMaxLastUpdateSpinner.setMinimum(1);
          fMaxLastUpdateSpinner.setMaximum(999);
          fMaxLastUpdateSpinner.setSelection(fGlobalScope.getInteger(DefaultPreferences.CLEAN_UP_BM_BY_LAST_UPDATE_VALUE));
    View Full Code Here

    Examples of org.eclipse.swt.widgets.Spinner

            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(9999);
          fMaxCountSpinner.setSelection(fGlobalScope.getInteger(DefaultPreferences.CLEAN_UP_NEWS_BY_COUNT_VALUE));
        }

        /* 5.) Delete News with an age > X Days */
        {
          fDeleteNewsByAgeCheck = new Button(container, SWT.CHECK);
          fDeleteNewsByAgeCheck.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
          fDeleteNewsByAgeCheck.setSelection(fGlobalScope.getBoolean(DefaultPreferences.CLEAN_UP_NEWS_BY_AGE_STATE));
          fDeleteNewsByAgeCheck.setText(Messages.CleanUpOptionsPage_DELETE_NEWS_BY_AGE);
          fDeleteNewsByAgeCheck.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
              fMaxAgeSpinner.setEnabled(fDeleteNewsByAgeCheck.getSelection());
            }
          });

          fMaxAgeSpinner = new Spinner(container, SWT.BORDER);
          fMaxAgeSpinner.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
          fMaxAgeSpinner.setEnabled(fDeleteNewsByAgeCheck.getSelection());
          fMaxAgeSpinner.setMinimum(1);
          fMaxAgeSpinner.setMaximum(9999);
          fMaxAgeSpinner.setSelection(fGlobalScope.getInteger(DefaultPreferences.CLEAN_UP_NEWS_BY_AGE_VALUE));
    View Full Code Here

    Examples of org.eclipse.swt.widgets.Spinner

            fUpdateValueSpinner.setEnabled(fUpdateCheck.getSelection());
            fUpdateScopeCombo.setEnabled(fUpdateCheck.getSelection());
          }
        });

        fUpdateValueSpinner = new Spinner(autoReloadContainer, SWT.BORDER);
        fUpdateValueSpinner.setMinimum(1);
        fUpdateValueSpinner.setMaximum(999);
        fUpdateValueSpinner.setEnabled(fUpdateCheck.getSelection());

        long updateInterval = fGlobalScope.getLong(DefaultPreferences.BM_UPDATE_INTERVAL);
    View Full Code Here

    Examples of org.eclipse.swt.widgets.Spinner

          public void widgetSelected(SelectionEvent e) {
            fMarkReadAfterSpinner.setEnabled(fMarkReadStateCheck.getSelection());
          }
        });

        fMarkReadAfterSpinner = new Spinner(markReadAfterContainer, SWT.BORDER);
        fMarkReadAfterSpinner.setMinimum(0);
        fMarkReadAfterSpinner.setMaximum(100);
        fMarkReadAfterSpinner.setSelection(fGlobalScope.getInteger(DefaultPreferences.MARK_READ_IN_MILLIS) / 1000);
        fMarkReadAfterSpinner.setEnabled(fMarkReadStateCheck.getSelection());
    View Full Code Here

    Examples of org.eclipse.swt.widgets.Spinner

          public void widgetSelected(SelectionEvent e) {
            fDeleteNewsByCountValue.setEnabled(fDeleteNewsByCountCheck.getSelection());
          }
        });

        fDeleteNewsByCountValue = new Spinner(group, SWT.BORDER);
        fDeleteNewsByCountValue.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        fDeleteNewsByCountValue.setEnabled(fDeleteNewsByCountCheck.getSelection());
        fDeleteNewsByCountValue.setMinimum(0);
        fDeleteNewsByCountValue.setMaximum(99999);
        fDeleteNewsByCountValue.setSelection(fGlobalScope.getInteger(DefaultPreferences.DEL_NEWS_BY_COUNT_VALUE));

        /* Delete by Age */
        fDeleteNewsByAgeCheck = new Button(group, SWT.CHECK);
        fDeleteNewsByAgeCheck.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        fDeleteNewsByAgeCheck.setSelection(fGlobalScope.getBoolean(DefaultPreferences.DEL_NEWS_BY_AGE_STATE));
        fDeleteNewsByAgeCheck.setText(Messages.FeedsPreferencePage_MAX_AGE);
        fDeleteNewsByAgeCheck.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            fDeleteNewsByAgeValue.setEnabled(fDeleteNewsByAgeCheck.getSelection());
          }
        });

        fDeleteNewsByAgeValue = new Spinner(group, SWT.BORDER);
        fDeleteNewsByAgeValue.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
        fDeleteNewsByAgeValue.setEnabled(fDeleteNewsByAgeCheck.getSelection());
        fDeleteNewsByAgeValue.setMinimum(0);
        fDeleteNewsByAgeValue.setMaximum(99999);
        fDeleteNewsByAgeValue.setSelection(fGlobalScope.getInteger(DefaultPreferences.DEL_NEWS_BY_AGE_VALUE));
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. 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.