Java Code Examples for org.eclipse.swt.events.SelectionAdapter

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project cilia-workbench, under directory /cilia-workbench-monitoring/src/fr/liglab/adele/cilia/workbench/monitoring/changesview/.

Source file: ChangesTableViewer.java

  22 
vote

/** 
 * Gets the selection adapter.
 * @param column the column
 * @param columnHeader the column header
 * @return the selection adapter
 */
private static SelectionAdapter getSelectionAdapter(final TableColumn column,final ChangesTableColumnHeader columnHeader){
  SelectionAdapter selectionAdapter=new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      tableSorter.setColumn(columnHeader);
      viewer.refresh();
    }
  }
;
  return selectionAdapter;
}
 

Example 2

From project Archimedes, under directory /br.org.archimedes.core/src/br/org/archimedes/gui/swt/.

Source file: CanvasWithSlider.java

  21 
vote

/** 
 * Adds selection listeners to the size sliders.
 */
private void addSliderListener(){
  SelectionListener sliderListener=new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent event){
      redraw();
    }
  }
;
  slider.addSelectionListener(sliderListener);
}
 

Example 3

From project aws-toolkit-for-eclipse, under directory /com.amazonaws.eclipse.core/src/com/amazonaws/eclipse/core/ui/.

Source file: AccountSelectionComposite.java

  21 
vote

protected void createAccountSelectionCombo(){
  Label selectAccount=new Label(this,SWT.None);
  selectAccount.setText("Select Account:");
  this.accountSelection=new Combo(this,SWT.DROP_DOWN | SWT.READ_ONLY);
  accountSelection.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      for (      SelectionListener listener : listeners) {
        listener.widgetSelected(e);
      }
    }
  }
);
}
 

Example 4

From project Bio-PEPA, under directory /uk.ac.ed.inf.common.ui.plotview/src/uk/ac/ed/inf/common/ui/plotview/views/.

Source file: PlotView.java

  21 
vote

/** 
 * This is a callback that will allow us to create the viewer and initialize it.
 */
public void createPartControl(Composite parent){
  SelectionListener listener=new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      PlotView.this.notify((IStructuredSelection)getSelection());
    }
  }
;
  folder=new TabFolder(parent,SWT.NONE);
  folder.addSelectionListener(listener);
  makeActions();
  hookContextMenu();
  contributeToActionBars();
}
 

Example 5

From project bndtools, under directory /bndtools.core/src/bndtools/editor/project/.

Source file: RepositoryBundleSelectionPart.java

  21 
vote

protected ToolItem createAddItemTool(ToolBar toolbar){
  ToolItem tool=new ToolItem(toolbar,SWT.PUSH);
  tool.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ADD));
  tool.setToolTipText("Add Bundle");
  tool.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      doAdd();
    }
  }
);
  return tool;
}
 

Example 6

From project ceylon-ide-eclipse, under directory /plugins/com.redhat.ceylon.eclipse.ui/src/com/redhat/ceylon/eclipse/code/preferences/.

Source file: CeylonRepoPreferencesBlock.java

  21 
vote

private void initSystemRepoBrowseButton(final Composite composite){
  systemRepoBrowseButton=new Button(composite,SWT.PUSH);
  systemRepoBrowseButton.setText("Browse...");
  systemRepoBrowseButton.setLayoutData(swtDefaults().align(SWT.FILL,SWT.CENTER).create());
  systemRepoBrowseButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String result=new DirectoryDialog(composite.getShell(),SWT.SHEET).open();
      if (result != null) {
        systemRepoText.setText(result);
      }
    }
  }
);
}
 

Example 7

From project dawn-isenciaui, under directory /com.isencia.passerelle.workbench.model.editor.ui/src/main/java/com/isencia/passerelle/workbench/model/editor/ui/descriptor/.

Source file: StringMapPropertyDescriptor.java

  21 
vote

protected void createButtonsForButtonBar(Composite parent){
  super.createButtonsForButtonBar(parent);
  final Button button=createButton(parent,CLEAR,"Clear",true);
  button.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      setReturnCode(CLEAR);
      close();
    }
  }
);
}
 

Example 8

From project dawn-ui, under directory /org.dawb.workbench.plotting/src/org/dawb/workbench/plotting/tools/history/.

Source file: ImageHistoryTool.java

  21 
vote

@Override protected CellEditor getCellEditor(final Object element){
  ComboBoxCellEditor ed=new ComboBoxCellEditor((Composite)getViewer().getControl(),Operator.getOperators(),SWT.READ_ONLY);
  ((CCombo)ed.getControl()).addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      ImageOperatorEditingSupport.this.setValue(element,((CCombo)e.getSource()).getSelectionIndex());
    }
  }
);
  return ed;
}
 

Example 9

From project droolsjbpm-tools, under directory /drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/dsl/editor/.

Source file: DSLEditor.java

  21 
vote

private void createEditButton(Composite parent){
  Button add=new Button(parent,SWT.PUSH | SWT.CENTER);
  add.setText("Edit");
  GridData gridData=new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
  gridData.widthHint=80;
  add.setLayoutData(gridData);
  add.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      showEditPopup();
    }
  }
);
}
 

Example 10

From project Eclipse, under directory /com.mobilesorcery.sdk.importproject/src/com/mobilesorcery/sdk/importproject/.

Source file: MoSyncWizardProjectsImportPage.java

  21 
vote

/** 
 * Create the area with the extra options.
 * @param workArea
 */
private void createOptionsArea(Composite workArea){
  Composite optionsGroup=new Composite(workArea,SWT.NONE);
  optionsGroup.setLayout(new GridLayout());
  optionsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  copyCheckbox=new Button(optionsGroup,SWT.CHECK);
  copyCheckbox.setText(DataTransferMessages.WizardProjectsImportPage_CopyProjectsIntoWorkspace);
  copyCheckbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  copyCheckbox.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      copyFiles=copyCheckbox.getSelection();
    }
  }
);
}
 

Example 11

From project eclipsefp, under directory /net.sf.eclipsefp.haskell.debug.ui/INTERNAL/java/src/net/sf/eclipsefp/haskell/debug/ui/internal/launch/.

Source file: HaskellArgumentsTab.java

  21 
vote

private SelectionListener getSelectionAdapter(){
  if (selectionAdapter == null) {
    selectionAdapter=new SelectionAdapter(){
      @Override public void widgetSelected(      final SelectionEvent e){
        updateLaunchConfigurationDialog();
      }
    }
;
  }
  return selectionAdapter;
}
 

Example 12

From project egit-github, under directory /org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/.

Source file: GistAttachmentPart.java

  21 
vote

private void createButtons(Composite attachmentsComposite,FormToolkit toolkit){
  final Composite attachmentControlsComposite=toolkit.createComposite(attachmentsComposite);
  attachmentControlsComposite.setLayout(new GridLayout(2,false));
  attachmentControlsComposite.setLayoutData(new GridData(GridData.BEGINNING));
  Button attachFileButton=toolkit.createButton(attachmentControlsComposite,org.eclipse.mylyn.internal.tasks.ui.editors.Messages.TaskEditorAttachmentPart_Attach_,SWT.PUSH);
  attachFileButton.setImage(CommonImages.getImage(CommonImages.FILE_PLAIN));
  attachFileButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      EditorUtil.openNewAttachmentWizard(getTaskEditorPage(),Mode.DEFAULT,null);
    }
  }
);
  getTaskEditorPage().registerDefaultDropListener(attachFileButton);
}
 

Example 13

From project Extensions2Services, under directory /eu.wwuk.eclipse.extsvcs.examples.client/src/eu/wwuk/eclipse/extsvcs/examples/client/view/.

Source file: EventSendingView.java

  21 
vote

@Override public void createPartControl(Composite parent){
  Button button=new Button(parent,SWT.PUSH);
  button.setText("Send");
  button.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      EventAdmin ea=(EventAdmin)context.locateService("EventAdmin");
      if (ea != null)       ea.postEvent(new Event("PING",(Map)null));
    }
  }
);
}
 

Example 14

From project gda-common-rcp, under directory /uk.ac.gda.common.rcp/src/uk/ac/gda/richbeans/components/scalebox/.

Source file: NumberBox.java

  21 
vote

protected void createSelectionListener(final StyledText text){
  this.selectionListener=new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      textUpdateAndFireListeners();
    }
  }
;
  text.addSelectionListener(selectionListener);
}
 

Example 15

From project adt-cdt, under directory /com.android.ide.eclipse.adt.cdt/src/com/android/ide/eclipse/adt/cdt/internal/preferences/.

Source file: NDKPreferencePage.java

  20 
vote

/** 
 * Create contents of the preference page.
 * @param parent
 */
@Override public Control createContents(Composite parent){
  Composite container=new Composite(parent,SWT.NULL);
  container.setLayout(new GridLayout(1,false));
  Group grpNdkLocation=new Group(container,SWT.NONE);
  grpNdkLocation.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,false,1,1));
  grpNdkLocation.setText("NDK Location");
  grpNdkLocation.setLayout(new GridLayout(2,false));
  text=new Text(grpNdkLocation,SWT.BORDER);
  text.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,false,1,1));
  String ndkLoc=NDKManager.getNDKLocation();
  if (ndkLoc != null)   text.setText(ndkLoc);
  Button button=new Button(grpNdkLocation,SWT.NONE);
  button.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String dir=new DirectoryDialog(NDKPreferencePage.this.getShell()).open();
      if (dir != null)       text.setText(dir);
    }
  }
);
  button.setText("Browse...");
  return container;
}
 

Example 16

From project BHT-FPA, under directory /mailer-common/de.bht.fpa.mail.common/src/de/bht/fpa/mail/s000000/common/filter/entry/.

Source file: FilterEntryComponent.java

  20 
vote

/** 
 * Create the composite.
 * @param parent
 * @param style
 */
public FilterEntryComponent(final Composite parent){
  super(parent,SWT.NONE);
  GridLayout layout=new GridLayout(NR_OF_COLUMNS,false);
  layout.marginHeight=0;
  setLayout(layout);
  filterTypeComponent=new FilterTypeComponent(this);
  filterTypeComponent.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,false,1,1));
  remBtn=new Button(this,SWT.NONE);
  remBtn.setText("-");
  remBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      filterChangedListener.onRemoveFilter(FilterEntryComponent.this);
    }
  }
);
  Button addBtn=new Button(this,SWT.NONE);
  addBtn.setLayoutData(new GridData(SWT.RIGHT,SWT.CENTER,false,false,1,1));
  addBtn.setText("+");
  addBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      filterChangedListener.onAddFilter(FilterEntryComponent.this);
    }
  }
);
}
 

Example 17

From project bioclipse.opentox, under directory /plugins/net.bioclipse.opentox.ds/src/net/bioclipse/opentox/ds/prefs/.

Source file: ModelsListEditor.java

  20 
vote

/** 
 * Creates a selection listener.
 */
public void createSelectionListener(){
  selectionListener=new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent event){
      Widget widget=event.widget;
      if (widget == addButton) {
        addPressed();
      }
 else       if (widget == removeButton) {
        removePressed();
      }
 else       if (widget == upButton) {
        upPressed();
      }
 else       if (widget == downButton) {
        downPressed();
      }
 else       if (widget == list) {
        selectionChanged();
      }
    }
  }
;
}
 

Example 18

From project bioclipse.seneca, under directory /plugins/net.bioclipse.seneca/src/net/bioclipse/seneca/wizard/.

Source file: SJSCheckWizardPage.java

  20 
vote

public void createControl(Composite parent){
  final Composite control=new Composite(parent,SWT.NONE);
  GridLayout gridLayout=new GridLayout();
  gridLayout.numColumns=2;
  control.setLayout(gridLayout);
  tree=new Tree(control,SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
  GridData gridData=new GridData(GridData.FILL_BOTH);
  gridData.horizontalSpan=2;
  gridData.heightHint=200;
  tree.setLayoutData(gridData);
  tree.setHeaderVisible(true);
  TreeColumn column1=new TreeColumn(tree,SWT.LEFT);
  column1.setText("Task");
  column1.setWidth(300);
  TreeColumn column2=new TreeColumn(tree,SWT.LEFT);
  column2.setText("State");
  column2.setWidth(50);
  tree.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      CheckItem item=checksMap.get((TreeItem)e.item);
      if (item != null && item.getError() != null) {
        setErrorMessage(item.getError());
      }
 else {
        setErrorMessage(null);
      }
    }
    public void widgetDefaultSelected(    SelectionEvent e){
      System.out.println("default selected: " + ((TreeItem)e.item).getText());
    }
  }
);
  setControl(control);
  checkForRequiredData(tree);
  checkJudges(tree);
  configureEngine(tree);
  setErrorMessage(null);
  setPageComplete(true);
}
 

Example 19

From project bioclipse.speclipse, under directory /plugins/net.bioclipse.specmol/src/net/bioclipse/specmol/wizards/.

Source file: ChooseIdWizardPage.java

  20 
vote

public void initUi(){
  BibtexDatabase db;
  try {
    db=Activator.getDefault().getJavaBibtexManager().loadBibliodata(((AssignBibtexWizard)this.getWizard()).getBibtexPage().getSelectedRes()).getJabrefDatabase();
  }
 catch (  Exception e1) {
    e1.printStackTrace();
    throw new RuntimeException(e1);
  }
  Iterator it=db.getEntries().iterator();
  int i=0;
  while (it.hasNext()) {
    BibtexEntry entry=(BibtexEntry)it.next();
    if (!map.containsValue(entry)) {
      list1.add(entry.getCiteKey());
      map.put(new Integer(i),entry);
      i++;
    }
  }
  for (int k=0; k < 10; k++) {
    if (list1.getItem(0).equals(" ") || list1.getItem(0).equals("                               "))     list1.remove(0);
  }
  list1.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      ChooseIdWizardPage.this.setPageComplete(true);
      ChooseIdWizardPage.this.setErrorMessage(null);
      getWizard().getContainer().updateButtons();
    }
  }
);
  list1.redraw();
}
 

Example 20

From project bpelunit, under directory /tycho/net.bpelunit.framework.client.eclipse/src/net/bpelunit/framework/client/eclipse/dialog/field/.

Source file: FileField.java

  20 
vote

@Override protected void createControl(Composite parent){
  Label label=new Label(parent,SWT.NONE);
  label.setText(getLabelText());
  label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
  Composite comp=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.marginHeight=0;
  layout.marginWidth=0;
  comp.setLayout(layout);
  comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  fText=new Text(comp,SWT.SINGLE | SWT.BORDER);
  GridData data=new GridData(GridData.FILL_HORIZONTAL);
  data.widthHint=200;
  fText.setLayoutData(data);
  label.setSize(label.getSize().x,fText.getSize().y);
  if (getInitialValue() != null) {
    fText.setText(getInitialValue());
  }
  fCurrentSelection=fText.getText();
  fText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      fCurrentSelection=fText.getText();
      getDialog().validateFields();
    }
  }
);
  Button button=createButton(comp,IDialogConstants.IGNORE_ID,"&Browse...",false);
  button.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String selected=FileSelector.getFile(getDialog().getShell(),fText.getText(),fFileValidator,fFilter,fRoot,fCurrentDir);
      if (selected != null) {
        fCurrentSelection=fText.getText();
        fText.setText(selected);
        getDialog().validateFields();
      }
    }
  }
);
}
 

Example 21

From project BPMN2-Editor-for-Eclipse, under directory /org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/wizards/.

Source file: BPMN2DiagramWizardPage.java

  20 
vote

/** 
 * @see IDialogPage#createControl(Composite)
 */
@Override public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NULL);
  GridLayout layout=new GridLayout();
  container.setLayout(layout);
  layout.numColumns=3;
  layout.verticalSpacing=9;
  Label label=new Label(container,SWT.NULL);
  label.setText("&Location:");
  containerText=new Text(container,SWT.BORDER | SWT.SINGLE);
  GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  containerText.setLayoutData(gd);
  containerText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    ModifyEvent e){
      dialogChanged();
    }
  }
);
  Button button=new Button(container,SWT.PUSH);
  button.setText("Browse...");
  button.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      handleBrowse();
    }
  }
);
  label=new Label(container,SWT.NULL);
  label.setText("&File name:");
  fileText=new Text(container,SWT.BORDER | SWT.SINGLE);
  gd=new GridData(GridData.FILL_HORIZONTAL);
  fileText.setLayoutData(gd);
  fileText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    ModifyEvent e){
      dialogChanged();
    }
  }
);
  initialize();
  dialogChanged();
  setControl(container);
}
 

Example 22

From project bundlemaker, under directory /main/org.bundlemaker.core.ui.mvn/src/org/bundlemaker/core/ui/mvn/.

Source file: CompositeEditMvnArtifacts.java

  20 
vote

/** 
 * <p> </p>
 */
protected void init(){
  final Shell shell=getShell();
  GridData layoutData=new GridData(GridData.FILL_BOTH);
  setLayoutData(layoutData);
  setLayout(new GridLayout(2,false));
  _contentList=new List(this,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL| SWT.MULTI);
  layoutData=new GridData(GridData.FILL_BOTH);
  layoutData.verticalIndent=0;
  _contentList.setLayoutData(layoutData);
  _contentList.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      refreshEnablement();
    }
  }
);
  Composite buttonBar=new Composite(this,SWT.NONE);
  buttonBar.setLayout(new GridLayout(1,false));
  GridData gd=new GridData();
  gd.verticalAlignment=GridData.BEGINNING;
  gd.horizontalAlignment=GridData.FILL;
  gd.verticalIndent=0;
  buttonBar.setLayoutData(gd);
  newTextButton(buttonBar,"Add Artifact...",new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      addArtifact(shell);
    }
  }
);
  _removeButton=newTextButton(buttonBar,"Remove Entry",new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      removeArtifact();
    }
  }
);
  redrawList();
  refreshEnablement();
}
 

Example 23

From project ccw, under directory /ccw.core/src/java/ccw/launching/.

Source file: ClojureMainTab.java

  20 
vote

private void createFileEditor(final Composite parent,String string){
  Group section=SWTFactory.createGroup(parent,"Evaluate Clojure source file(s)",2,1,GridData.FILL_BOTH);
  sourceFilesViewer=new TableViewer(section);
  sourceFilesViewer.setLabelProvider(new DecoratingLabelProvider(new WorkbenchLabelProvider(),CCWPlugin.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
  sourceFilesViewer.setContentProvider(new ArrayContentProvider());
  sourceFilesViewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
  Composite buttonSection=SWTFactory.createComposite(section,parent.getFont(),1,1,GridData.FILL_BOTH);
  Button chooseButton=new Button(buttonSection,SWT.PUSH);
  chooseButton.setText("Choose...");
  chooseButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String currentProjName=fProjText.getText().trim();
      final IProject proj=ResourcesPlugin.getWorkspace().getRoot().getProject(currentProjName);
      if (proj == null) {
        return;
      }
      CheckedTreeSelectionDialog dialog=new CheckedTreeSelectionDialog(parent.getShell(),new WorkbenchLabelProvider(),new BaseWorkbenchContentProvider());
      dialog.setInput(proj.getWorkspace().getRoot());
      dialog.addFilter(new ClojureElementViewerFilter(proj));
      if (sourceFilesViewer.getInput() != null) {
        dialog.setInitialSelections(((List<?>)sourceFilesViewer.getInput()).toArray());
      }
      dialog.setTitle("Evaluate Clojure source file(s)");
      dialog.open();
      List<IFile> selectedFiles=new ArrayList<IFile>();
      Object[] dialogResult=dialog.getResult();
      if (dialogResult != null) {
        for (        Object o : dialogResult) {
          if (o instanceof IFile) {
            selectedFiles.add((IFile)o);
          }
        }
      }
      sourceFilesViewer.setInput(selectedFiles);
      updateLaunchConfigurationDialog();
    }
  }
);
}
 

Example 24

From project CIShell, under directory /clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/components/.

Source file: BooleanComponent.java

  20 
vote

public Control createGUI(Composite parent,int style){
  checkbox=new Button(parent,SWT.CHECK);
  GridData gridData=new GridData(SWT.LEFT,SWT.CENTER,false,false);
  gridData.horizontalSpan=MAX_SPAN;
  checkbox.setLayoutData(gridData);
  String label=attribute.getName();
  if (label != null)   checkbox.setText(label);
 else   checkbox.setText("");
  checkbox.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent event){
      update();
    }
  }
);
  return checkbox;
}
 

Example 25

From project Database-Designer, under directory /plugins/org.obeonetwork.dsl.entityrelation.edit/src-gen/org/obeonetwork/dsl/entityrelation/parts/forms/.

Source file: AttributePropertiesEditionPartForm.java

  20 
vote

/** 
 */
protected Composite createLiteralsMultiValuedEditor(FormToolkit widgetFactory,Composite parent){
  literals=widgetFactory.createText(parent,"",SWT.READ_ONLY);
  GridData literalsData=new GridData(GridData.FILL_HORIZONTAL);
  literalsData.horizontalSpan=2;
  literals.setLayoutData(literalsData);
  EditingUtils.setID(literals,EntityrelationViewsRepository.Attribute.Properties.literals);
  EditingUtils.setEEFtype(literals,"eef::MultiValuedEditor::field");
  editLiterals=widgetFactory.createButton(parent,getDescription(EntityrelationViewsRepository.Attribute.Properties.literals,EntityrelationMessages.AttributePropertiesEditionPart_LiteralsLabel),SWT.NONE);
  GridData editLiteralsData=new GridData();
  editLiterals.setLayoutData(editLiteralsData);
  editLiterals.addSelectionListener(new SelectionAdapter(){
    /** 
 * {@inheritDoc}
 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
 */
    public void widgetSelected(    SelectionEvent e){
      EEFFeatureEditorDialog dialog=new EEFFeatureEditorDialog(literals.getShell(),"Attribute",new AdapterFactoryLabelProvider(adapterFactory),literalsList,TypesLibraryPackage.eINSTANCE.getTypeInstance_Literals().getEType(),null,false,true,null,null);
      if (dialog.open() == Window.OK) {
        literalsList=dialog.getResult();
        if (literalsList == null) {
          literalsList=new BasicEList();
        }
        literals.setText(literalsList.toString());
        propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AttributePropertiesEditionPartForm.this,EntityrelationViewsRepository.Attribute.Properties.literals,PropertiesEditionEvent.COMMIT,PropertiesEditionEvent.SET,null,new BasicEList(literalsList)));
        setHasChanged(true);
      }
    }
  }
);
  EditingUtils.setID(editLiterals,EntityrelationViewsRepository.Attribute.Properties.literals);
  EditingUtils.setEEFtype(editLiterals,"eef::MultiValuedEditor::browsebutton");
  return parent;
}
 

Example 26

From project dawn-common, under directory /org.dawb.common.ui/src/org/dawb/common/ui/plot/roi/.

Source file: ROIEditTable.java

  20 
vote

@Override protected CellEditor getCellEditor(final Object element){
  FieldComponentCellEditor ed=null;
  try {
    ed=new FieldComponentCellEditor(((TableViewer)getViewer()).getTable(),FloatSpinnerWrapper.class.getName(),SWT.RIGHT);
  }
 catch (  ClassNotFoundException e) {
    logger.error("Cannot get FieldComponentCellEditor for " + SpinnerWrapper.class.getName(),e);
    return null;
  }
  final FloatSpinnerWrapper rb=(FloatSpinnerWrapper)ed.getFieldWidget();
  if (element instanceof LinearROI || element instanceof PointROI || element instanceof PolylineROI|| element instanceof RectangularROI) {
    if (column == 1) {
      if (!Double.isNaN(xLowerBound))       rb.setMinimum(xLowerBound);
      if (!Double.isNaN(xUpperBound))       rb.setMaximum(xUpperBound);
    }
 else {
      if (!Double.isNaN(yLowerBound))       rb.setMinimum(yLowerBound);
      if (!Double.isNaN(yUpperBound))       rb.setMaximum(yUpperBound);
    }
  }
 else {
    rb.setMaximum(Double.MAX_VALUE);
    rb.setMinimum(-Double.MAX_VALUE);
  }
  rb.setButtonVisible(false);
  rb.setActive(true);
  ((Spinner)rb.getControl()).addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      setValue(element,rb.getValue(),false);
    }
  }
);
  return ed;
}
 

Example 27

From project dawn-third, under directory /org.dawb.org.csstudio.swt.xygraph/src/org/csstudio/swt/xygraph/toolbar/.

Source file: XYGraphConfigDialog.java

  20 
vote

@Override protected void createButtonsForButtonBar(Composite parent){
  ((GridLayout)parent.getLayout()).numColumns++;
  Button button=new Button(parent,SWT.PUSH);
  button.setText("Apply");
  GridData data=new GridData(GridData.HORIZONTAL_ALIGN_FILL);
  int widthHint=convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
  Point minSize=button.computeSize(SWT.DEFAULT,SWT.DEFAULT,true);
  data.widthHint=Math.max(widthHint,minSize.x);
  button.setLayoutData(data);
  button.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      applyChanges();
    }
  }
);
  super.createButtonsForButtonBar(parent);
  Shell shell=parent.getShell();
  if (shell != null) {
    shell.setDefaultButton(button);
  }
}
 

Example 28

From project dawn-workflow, under directory /org.dawb.passerelle.common/src/org/dawb/passerelle/common/parameter/roi/.

Source file: ROIDialog.java

  20 
vote

public Control createDialogArea(Composite parent){
  final Composite main=(Composite)super.createDialogArea(parent);
  main.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  final Composite top=new Composite(main,SWT.NONE);
  top.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false));
  top.setLayout(new GridLayout(2,false));
  final Label label=new Label(top,SWT.NONE);
  label.setText("Region type    ");
  label.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,false));
  roiType=new CCombo(top,SWT.READ_ONLY | SWT.BORDER);
  roiType.setItems(ROIType.getTypes());
  roiType.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false));
  roiType.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      try {
        roiEditor.setRegion(ROIType.createNew(roiType.getSelectionIndex()),null);
      }
 catch (      Exception e1) {
        logger.error("Cannot create roi " + ROIType.getType(roiType.getSelectionIndex()).getName(),e1);
      }
    }
  }
);
  this.roiEditor=new ROIEditTable();
  roiEditor.createPartControl(main);
  return main;
}
 

Example 29

From project Diver, under directory /ca.uvic.chisel.logging.eclipse/src/ca/uvic/chisel/logging/eclipse/internal/ui/.

Source file: UploadWizardPage1.java

  20 
vote

public void createControl(Composite parent){
  Composite page=new Composite(parent,SWT.BORDER);
  page.setLayout(new GridLayout());
  Browser b=new Browser(page,SWT.NONE);
  b.setText("<HTML><body>" + "<p>You have selected to log various user interactions in you Eclipse " + "workbench. The following loggers have been installed and the data gathered "+ "by them will now be uploaded to thier servers. Please review the logs, accept "+ "the disclaimers, and select <i>Finish</i> to upload the data.</p>"+ "<p>You can disable the loggers at any time using the <i>Workbench Logger</i> "+ "preference page</p>"+ "</body></html>");
  GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
  gd.heightHint=200;
  b.setLayoutData(gd);
  Composite categoriesArea=createCategoriesArea(page);
  categoriesArea.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false));
  acceptButton=new Button(page,SWT.CHECK);
  acceptButton.setText("I accept the disclaimers of the selected loggers.");
  acceptButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      boolean complete=((Button)e.widget).getSelection();
      if (!complete) {
        setErrorMessage("You must accept the disclaimers for the selected loggers");
      }
 else {
        setErrorMessage(null);
      }
      setPageComplete(complete);
    }
  }
);
  setControl(page);
  setErrorMessage("You must accept the disclaimers for the selected loggers");
}
 

Example 30

From project dolphin, under directory /com.sysdeo.eclipse.tomcat/src/com/sysdeo/eclipse/tomcat/editors/.

Source file: ClasspathFieldEditor.java

  20 
vote

/** 
 * Creates a selection listener.
 */
public void createSelectionListener(){
  selectionListener=new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent event){
      Widget widget=event.widget;
      if (widget == addJarZipButton) {
        addJarZipPressed();
      }
 else       if (widget == addDirButton) {
        addDirPressed();
      }
 else       if (widget == removeButton) {
        removePressed();
      }
 else       if (widget == upButton) {
        upPressed();
      }
 else       if (widget == downButton) {
        downPressed();
      }
 else       if (widget == list) {
        selectionChanged();
      }
    }
  }
;
}
 

Example 31

From project dozer, under directory /eclipse-plugin/net.sf.dozer.eclipse.plugin/src/org/dozer/eclipse/plugin/editorpage/utils/.

Source file: DozerUiUtils.java

  20 
vote

public static IObservableValue createLabelClassBrowse(Composite client,String messagePrefix,final String superType,final boolean allowInterfaces){
  createLabel(client,messagePrefix);
  Composite tableClient=toolkit.createComposite(client,SWT.WRAP);
  TableWrapLayout layout=new TableWrapLayout();
  layout.bottomMargin=0;
  layout.leftMargin=0;
  layout.rightMargin=0;
  layout.topMargin=0;
  layout.numColumns=2;
  tableClient.setLayout(layout);
  final IObservableValue text=DozerUiUtils.createText(tableClient,messagePrefix);
  Button browseBtn=toolkit.createButton(tableClient,"Browse...",SWT.PUSH);
  browseBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String className=DozerUiUtils.getInstance().doOpenClassSelectionDialog(superType,allowInterfaces);
      if (className != null) {
        text.setValue(className);
      }
    }
  }
);
  TableWrapData td=new TableWrapData();
  browseBtn.setLayoutData(td);
  td=new TableWrapData(TableWrapData.FILL_GRAB);
  tableClient.setLayoutData(td);
  return text;
}
 

Example 32

From project eclipse-instasearch, under directory /instasearch/src/it/unibz/instasearch/prefs/.

Source file: InstaSearchPreferencePage.java

  20 
vote

/** 
 * Creates the field editors. Field editors are abstractions of the common GUI blocks needed to manipulate various types of preferences. Each field editor knows how to save and restore itself.
 */
@Override public void createFieldEditors(){
  String[] fileValues=new String[]{"5","10","15","25","50"};
  addField(new ComboFieldEditor(PreferenceConstants.P_SHOWN_FILES_COUNT,"Shown results (initially)",getArrayOfPairs(fileValues),getFieldEditorParent()));
  String[] lineValues=new String[]{"3","4","5","7","10","15","25"};
  addField(new ComboFieldEditor(PreferenceConstants.P_SHOWN_LINES_COUNT,"Preview lines",getArrayOfPairs(lineValues),getFieldEditorParent()));
  addBoolField(PreferenceConstants.P_SHOW_MATCH_COUNT,"Show number of matches");
  addBoolField(PreferenceConstants.P_SHOW_FULL_PATH,"Show full file path in results");
  addBoolField(PreferenceConstants.P_DIALOG_ON_SHORTCUT,"Open search dialog with shortcut key (Ctrl+Alt+I)");
  StringButtonFieldEditor extensions=new ExtensionsFieldEditor(getFieldEditorParent());
  extensions.setChangeButtonText("...");
  extensions.setEmptyStringAllowed(true);
  addField(extensions);
  addBoolField(PreferenceConstants.P_INDEX_EMPTY_EXTENSION,"Index files without extension");
  BooleanFieldEditor indexJars=new BooleanFieldEditor(PreferenceConstants.P_INDEX_ARCHIVES,"Index JAR Source Attachements (beta)",getFieldEditorParent());
  addField(indexJars);
  indexJars.setEnabled(false,getFieldEditorParent());
  if (InstaSearchPlugin.getInstaSearch() != null && InstaSearchPlugin.getInstaSearch().getIndexer() instanceof WorkspaceIndexerJDT)   indexJars.setEnabled(true,getFieldEditorParent());
  addBoolField(PreferenceConstants.P_FUZZY_SEARCH_AUTO,"Find similar matches when no exact matches found");
  String version=InstaSearchPlugin.getVersion();
  addBoolField(PreferenceConstants.P_CHECK_UPDATES,"Notify about updates (ver. " + version + ")");
  addField(new WorkspacePathEditor(PreferenceConstants.P_EXCLUDE_DIRS,"Exclude folders from index","Select folder to exclude from indexing",getFieldEditorParent()));
  Link annotationsLink=new Link(getFieldEditorParent(),SWT.NONE);
  annotationsLink.setText("See <a>Annotations</a> to set Search Results highlight color");
  annotationsLink.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      PreferencesUtil.createPreferenceDialogOn(getShell(),"org.eclipse.ui.editors.preferencePages.Annotations",null,null).open();
    }
  }
);
}
 

Example 33

From project eclipse-integration-cloudfoundry, under directory /org.cloudfoundry.ide.eclipse.server.ui/src/org/cloudfoundry/ide/eclipse/internal/server/ui/editor/.

Source file: ApplicationActionMenuControl.java

  20 
vote

public void createControl(){
  buttonComposite=toolkit != null ? toolkit.createComposite(parent,SWT.NONE) : new Composite(parent,SWT.NONE);
  GridLayoutFactory.fillDefaults().spacing(new Point(0,0)).numColumns(2).equalWidth(false).margins(0,0).applyTo(buttonComposite);
  applicationActionButton=createButton(buttonComposite,selectionButtonLabel,selectionButtonImage,SWT.FLAT);
  applicationActionButton.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      notifyListeners();
    }
  }
);
  GridDataFactory.fillDefaults().grab(true,false).align(SWT.END,SWT.BEGINNING).applyTo(applicationActionButton);
  setDefaultTooltipMessage();
  if (actions != null && actions.size() > 1) {
    final MenuManager viewMenuManager=new MenuManager();
    ToolBarManager manager=createToolBarManager(buttonComposite);
    toolBar=manager.getControl();
    viewMenuButton=new ToolItem(toolBar,SWT.PUSH,0);
    viewMenuButton.setImage(CloudFoundryImages.getImage(CloudFoundryImages.MENU_VIEW_ENABLED));
    viewMenuButton.setDisabledImage(CloudFoundryImages.getImage(CloudFoundryImages.MENU_VIEW_DISABLED));
    viewMenuButton.setToolTipText("Select mode");
    viewMenuButton.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(      SelectionEvent e){
        showViewMenu(viewMenuManager,toolBar);
      }
    }
);
    for (    ApplicationAction action : actions) {
      viewMenuManager.add(new MenuAction(action));
    }
  }
  setVisible(true);
}
 

Example 34

From project eclipse-integration-commons, under directory /org.springframework.ide.eclipse.uaa/src/org/springframework/ide/eclipse/internal/uaa/preferences/.

Source file: UaaDialog.java

  20 
vote

@Override protected Control createContents(Composite parent){
  getShell().setText(DIALOG_TITLE);
  Control control=super.createContents(parent);
  getButton(IDialogConstants.OK_ID).setText("Accept");
  getButton(IDialogConstants.CANCEL_ID).setText("Reject");
  getButton(IDialogConstants.CANCEL_ID).addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      setReturnCode(1000);
    }
  }
);
  setTitle(TITLE);
  setMessage("Download consent required",IMessageProvider.INFORMATION);
  setTitleImage(image);
  setBlockOnOpen(true);
  setDialogHelpAvailable(false);
  setHelpAvailable(false);
  applyDialogFont(control);
  return control;
}
 

Example 35

From project eclipse-integration-gradle, under directory /org.springsource.ide.eclipse.gradle.ui/src/org/springsource/ide/eclipse/gradle/ui/launch/.

Source file: GradleTaskOrderDialog.java

  20 
vote

/** 
 * Create button area & buttons
 * @param comp
 */
private void createButtons(Composite parent){
  Composite comp=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.marginHeight=0;
  layout.marginWidth=0;
  GridData gd=new GridData(GridData.HORIZONTAL_ALIGN_FILL);
  gd.verticalAlignment=GridData.BEGINNING;
  comp.setLayout(layout);
  comp.setLayoutData(gd);
  fUp=new Button(comp,SWT.PUSH);
  fUp.setFont(parent.getFont());
  fUp.setText("Move Up");
  setButtonLayoutData(fUp);
  fUp.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      handleUpPressed();
    }
  }
);
  fDown=new Button(comp,SWT.PUSH);
  fDown.setFont(parent.getFont());
  fDown.setText("Move Down");
  setButtonLayoutData(fDown);
  fDown.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      handleDownPressed();
    }
  }
);
}
 

Example 36

From project flyingsaucer, under directory /flying-saucer-swt/src/main/java/org/xhtmlrenderer/simple/xhtml/swt/.

Source file: SWTCheckControl.java

  20 
vote

protected Control createSWTControl(FormControl control,BasicRenderer parent,LayoutContext c,CalculatedStyle style,UserAgentCallback uac){
  final CheckControl cc=(CheckControl)control;
  final Button button=new Button(parent,(cc.isRadio() ? SWT.RADIO : SWT.CHECK));
  button.setText("");
  button.setSelection(cc.isSuccessful());
  button.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      if (!button.getSelection() && cc.isRadio()) {
        button.setSelection(true);
      }
 else {
        cc.setSuccessful(button.getSelection());
      }
    }
  }
);
  cc.addFormControlListener(new FormControlAdapter(){
    public void successful(    FormControl control){
      button.setSelection(control.isSuccessful());
    }
  }
);
  return button;
}
 

Example 37

From project Foglyn, under directory /com.foglyn.ui/src/com/foglyn/ui/.

Source file: FoglynSingleSelectionWithDependenciesAttributeEditor.java

  20 
vote

@Override public void createControl(Composite parent,FormToolkit toolkit){
  combo=new Combo(parent,SWT.FLAT | SWT.READ_ONLY);
  toolkit.adapt(combo,false,false);
  combo.setFont(JFaceResources.getDefaultFont());
  combo.setData(FormToolkit.KEY_DRAW_BORDER,Boolean.FALSE);
  combo.setVisibleItemCount(Constants.NUMBER_OF_ENTRIES_IN_COMBOBOX);
  combo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent event){
      int index=combo.getSelectionIndex();
      if (index > -1) {
        Assert.isNotNull(options);
        setSelectedOption(options.get(index));
      }
    }
  }
);
  setValues();
  setControl(combo);
}
 

Example 38

From project gmc, under directory /src/org.gluster.storage.management.console/src/org/gluster/storage/management/console/dialogs/.

Source file: BricksSelectionPage.java

  20 
vote

private void createDualTableViewer(List<Device> allDevices,List<Device> selectedDevices,String volumeName){
  TableColumnData[] columnData=createColumnData();
  ITableLabelProvider diskLabelProvider=getDiskLabelProvider(volumeName);
  dualTableViewer=new CustomTableDualListComposite<Device>(this,SWT.NONE,columnData,columnData);
  dualTableViewer.setViewerLabels("Available:","Selected:");
  dualTableViewer.setAvailableTableLinesVisible(false);
  dualTableViewer.setAvailableTableHeaderVisible(true);
  dualTableViewer.setAvailableContentProvider(new RemovableContentProvider<Device>(getAvailableDevice(allDevices,selectedDevices)));
  dualTableViewer.setAvailableLabelProvider(diskLabelProvider);
  dualTableViewer.setChosenTableLinesVisible(true);
  dualTableViewer.setChosenTableHeaderVisible(true);
  chosenBricksContentProvider=new RemovableContentProvider<Device>(selectedDevices);
  dualTableViewer.setChosenContentProvider(chosenBricksContentProvider);
  dualTableViewer.setChosenLabelProvider(diskLabelProvider);
  dualTableViewer.getChosenTable().addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      updateButtons();
    }
  }
);
}