Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Combo


    sourceInputContainer.setLayout(LayoutUtils.createGridLayout(2, 0, 0));
    ((GridLayout) sourceInputContainer.getLayout()).marginLeft = 15;
    ((GridLayout) sourceInputContainer.getLayout()).marginBottom = 10;
    sourceInputContainer.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));

    fResourceInput = new Combo(sourceInputContainer, SWT.DROP_DOWN | SWT.BORDER);
    OwlUI.makeAccessible(fResourceInput, fImportFromResourceRadio);
    fResourceInput.setEnabled(fImportFromResourceRadio.getSelection());
    fResourceInput.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    if (StringUtils.isSet(fWebsite))
View Full Code Here


    keywordInputContainer.setLayout(LayoutUtils.createGridLayout(1, 0, 0));
    ((GridLayout) keywordInputContainer.getLayout()).marginLeft = 15;
    ((GridLayout) keywordInputContainer.getLayout()).marginBottom = 10;
    keywordInputContainer.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));

    fKeywordInput = new Combo(keywordInputContainer, SWT.DROP_DOWN | SWT.BORDER);
    OwlUI.makeAccessible(fKeywordInput, fImportFromKeywordRadio);
    fKeywordInput.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    fKeywordInput.setEnabled(fImportFromKeywordRadio.getSelection());
    if (fImportFromKeywordRadio.getSelection()) {
      hookKeywordAutocomplete(true);
View Full Code Here

  GridData numGd = new GridData(); numGd.grabExcessHorizontalSpace = true; numGd.horizontalAlignment = GridData.FILL;
  Label numLabel = new Label(composite, SWT.LEFT);
  numLabel.setText("Number of Threads: ");
  numLabel.setLayoutData(numGd);

  final Combo threadCombo = new Combo(composite, SWT.SINGLE |  SWT.BORDER );
  final String[] threads =  new String[] { "1", "2", "4", "8"};
  for (int i = 0; i < threads.length; i++) threadCombo.add(threads[i]);
  int numThreads = ( (CrawlConfigWizard) getWizard()).crawlConfig.getNumThreads();
  switch (numThreads)
  { case 1: threadCombo.select(0); break;
  case 2: threadCombo.select(1); break;
  case 4: threadCombo.select(2); break;
  case 8: threadCombo.select(3); break;
  }

  CLabel threadDescr = new CLabel (composite, SWT.BORDER);
  GridData threadlGd = new GridData();
  threadlGd.horizontalSpan = 5; threadlGd.grabExcessHorizontalSpace = true;
  threadlGd.horizontalAlignment = GridData.FILL;
  threadDescr.setText("More than one thread will be beneficial in a multi-processor machine");
  threadDescr.setBackground( labelColors, new int[] {100} );
  threadDescr.setLayoutData(freshlGd);

  //*-- build sizth row and description to handle the spell checker
  GridData spellGd = new GridData(); spellGd.grabExcessHorizontalSpace = true; spellGd.horizontalAlignment = GridData.FILL;
  Label spellLabel = new Label(composite, SWT.LEFT);
  spellLabel.setText("Use Spell Checker: ");
  spellLabel.setLayoutData(freshGd);

  final Button spellYesButton = new Button(composite, SWT.RADIO); spellYesButton.setText("Yes");
  final Button spellNoButton = new Button(composite, SWT.RADIO); spellNoButton.setText("No");
  if ( ( (CrawlConfigWizard) getWizard()).crawlConfig.isSpellCheck() ) spellYesButton.setSelection(true);
  else spellNoButton.setSelection(true);

  CLabel spellDescr = new CLabel (composite, SWT.BORDER);
  GridData spelllGd = new GridData();
  spelllGd.horizontalSpan = 5; spelllGd.grabExcessHorizontalSpace = true;
  spelllGd.horizontalAlignment = GridData.FILL;
  spellDescr.setText("A spell checker can provide alternative queries");
  spellDescr.setBackground( labelColors, new int[] {100} );
  spellDescr.setLayoutData(freshlGd);
  //*-- build the listener
  Listener selectionListener = new Listener()
  { public void handleEvent(Event event)
  {
   //*-- set the crawl configuration based on the selected buttons
   if (skipYesButton.getSelection())   ( (CrawlConfigWizard) getWizard() ).crawlConfig.setSkipHidden(true);
   if (skipNoButton.getSelection())   ( (CrawlConfigWizard) getWizard() ).crawlConfig.setSkipHidden(false);
   if (folYesButton.getSelection()) ( (CrawlConfigWizard) getWizard() ).crawlConfig.setFollowLinks(true);
   if (folNoButton.getSelection())  ( (CrawlConfigWizard) getWizard() ).crawlConfig.setFollowLinks(false);
   if (keepYesButton.getSelection())  ( (CrawlConfigWizard) getWizard() ).crawlConfig.setKeepDups(true);
   if (keepNoButton.getSelection())   ( (CrawlConfigWizard) getWizard() ).crawlConfig.setKeepDups(false);
   if (freshYesButton.getSelection())   ( (CrawlConfigWizard) getWizard() ).crawlConfig.setFreshCrawl(true);
   if (freshNoButton.getSelection())  ( (CrawlConfigWizard) getWizard() ).crawlConfig.setFreshCrawl(false);
   if (spellYesButton.getSelection())   ( (CrawlConfigWizard) getWizard() ).crawlConfig.setSpellCheck(true);
   if (spellNoButton.getSelection())  ( (CrawlConfigWizard) getWizard() ).crawlConfig.setSpellCheck(false);
   int numThreads = Integer.parseInt( threads[threadCombo.getSelectionIndex() ] );
   ( (CrawlConfigWizard) getWizard() ).crawlConfig.setNumThreads(numThreads);

   //*-- set the selected buttons in the window
   if ( ( (CrawlConfigWizard) getWizard()).crawlConfig.isSkipHidden() ) skipYesButton.setSelection(true);
   else skipNoButton.setSelection(true);  
   if ( ( (CrawlConfigWizard) getWizard()).crawlConfig.isFollowLinks() ) folYesButton.setSelection(true);
   else folNoButton.setSelection(true);
   if ( ( (CrawlConfigWizard) getWizard()).crawlConfig.isKeepDups() ) keepYesButton.setSelection(true);
   else keepNoButton.setSelection(true);
   if ( ( (CrawlConfigWizard) getWizard()).crawlConfig.isFreshCrawl() ) freshYesButton.setSelection(true);
   else freshNoButton.setSelection(true);
   if ( ( (CrawlConfigWizard) getWizard()).crawlConfig.isSpellCheck() ) spellYesButton.setSelection(true);
   else spellNoButton.setSelection(true);
   switch (numThreads)
   { case 1: threadCombo.select(0); break;
   case 2: threadCombo.select(1); break;
   case 4: threadCombo.select(2); break;
   case 8: threadCombo.select(3); break;
   }
  }
  };

  skipYesButton.addListener( SWT.Selection, selectionListener);   skipNoButton.addListener( SWT.Selection, selectionListener);
  folYesButton.addListener( SWT.Selection, selectionListener);    folNoButton.addListener( SWT.Selection, selectionListener);
  keepYesButton.addListener( SWT.Selection, selectionListener);   keepNoButton.addListener( SWT.Selection, selectionListener);
  freshYesButton.addListener( SWT.Selection, selectionListener);   freshNoButton.addListener( SWT.Selection, selectionListener);
  spellYesButton.addListener( SWT.Selection, selectionListener);   spellNoButton.addListener( SWT.Selection, selectionListener);
  threadCombo.addListener( SWT.Selection, selectionListener);

  setControl(composite);

}
View Full Code Here

    /* 3.) Create Input Field */
    createInputField();
  }

  private void createFieldCombo() {
    Combo fieldCombo = new Combo(this, SWT.BORDER | SWT.READ_ONLY);
    fieldCombo.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, true));
    fieldCombo.setVisibleItemCount(100);

    fFieldViewer = new ComboViewer(fieldCombo);
    fFieldViewer.setContentProvider(new ComboContentProvider());
    fFieldViewer.setLabelProvider(new ComboLabelProvider());
    fFieldViewer.setInput(fCondition);
View Full Code Here

      }
    });
  }

  private void createSpecifierCombo() {
    Combo specifierCombo = new Combo(this, SWT.BORDER | SWT.READ_ONLY);
    specifierCombo.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, true));
    ((GridData) specifierCombo.getLayoutData()).widthHint = 80;
    specifierCombo.setVisibleItemCount(100);

    fSpecifierViewer = new ComboViewer(specifierCombo);
    fSpecifierViewer.setContentProvider(new ComboContentProvider());
    fSpecifierViewer.setLabelProvider(new ComboLabelProvider());
    fSpecifierViewer.setInput(fCondition.getField());
View Full Code Here

    else {
      switch (field.getSearchValueType().getId()) {

        /* Type: Boolean */
        case ISearchValueType.BOOLEAN: {
          final Combo combo = new Combo(inputField, SWT.BORDER | SWT.READ_ONLY);
          combo.add("true");
          combo.add("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 */
 
View Full Code Here

    /* 3.) Create Input Field */
    createInputField();
  }

  private void createFieldCombo() {
    Combo fieldCombo = new Combo(this, SWT.BORDER | SWT.READ_ONLY);
    fieldCombo.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, true));
    fieldCombo.setVisibleItemCount(100);

    fFieldViewer = new ComboViewer(fieldCombo);
    fFieldViewer.setContentProvider(new ComboContentProvider());
    fFieldViewer.setLabelProvider(new ComboLabelProvider());
    fFieldViewer.setInput(fCondition);
View Full Code Here

      }
    });
  }

  private void createSpecifierCombo() {
    Combo specifierCombo = new Combo(this, SWT.BORDER | SWT.READ_ONLY);
    specifierCombo.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, true));
    ((GridData) specifierCombo.getLayoutData()).widthHint = 80;
    specifierCombo.setVisibleItemCount(100);

    fSpecifierViewer = new ComboViewer(specifierCombo);
    fSpecifierViewer.setContentProvider(new ComboContentProvider());
    fSpecifierViewer.setLabelProvider(new ComboLabelProvider());
    fSpecifierViewer.setInput(fCondition.getField());
View Full Code Here

    else {
      switch (field.getSearchValueType().getId()) {

        /* Type: Boolean */
        case ISearchValueType.BOOLEAN: {
          final Combo combo = new Combo(inputField, SWT.BORDER | SWT.READ_ONLY);
          combo.add("true");
          combo.add("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 */
 
View Full Code Here

    /* 3.) Create Input Field */
    createInputField();
  }

  private void createFieldCombo() {
    Combo fieldCombo = new Combo(this, SWT.BORDER | SWT.READ_ONLY);
    fieldCombo.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, true));
    fieldCombo.setVisibleItemCount(100);

    fFieldViewer = new ComboViewer(fieldCombo);
    fFieldViewer.setContentProvider(new ComboContentProvider());
    fFieldViewer.setLabelProvider(new ComboLabelProvider());
    fFieldViewer.setInput(fCondition);
View Full Code Here

TOP

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

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.