Java Code Examples for org.eclipse.swt.layout.GridData

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 Archimedes, under directory /br.org.archimedes.core/src/br/org/archimedes/gui/swt/.

Source file: CanvasWithSlider.java

  32 
vote

/** 
 * Sets the layout of the group and lay itens in it.
 */
private void layThingsOut(){
  GridLayout groupLayout=new GridLayout(1,false);
  group.setLayout(groupLayout);
  GridData groupLayoutData=new GridData();
  groupLayoutData.horizontalAlignment=GridData.FILL_HORIZONTAL;
  slider.setLayoutData(groupLayoutData);
  groupLayoutData=new GridData();
  groupLayoutData.horizontalAlignment=GridData.CENTER;
  groupLayoutData.heightHint=canvasSize;
  groupLayoutData.widthHint=canvasSize;
  canvas.setLayoutData(groupLayoutData);
}
 

Example 2

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

Source file: LayerForm.java

  32 
vote

/** 
 * Creates the name label and text field
 * @param formGroup The parent composite
 */
private void createNameField(Group formGroup){
  GridData layoutData;
  Label nameLabel=new Label(formGroup,SWT.NONE);
  nameLabel.setText(Messages.LayerEditor_NameLabel);
  layoutData=new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
  nameLabel.setLayoutData(layoutData);
  nameText=new Text(formGroup,SWT.BORDER);
  layoutData=new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
  layoutData.widthHint=280;
  nameText.setLayoutData(layoutData);
  nameText.addModifyListener(modifyListener);
}
 

Example 3

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

Source file: AccountSelectionComposite.java

  32 
vote

protected void createNoAccountLabel(){
  noAccounts=new Label(this,SWT.None);
  noAccounts.setText("No AWS accounts have been configured yet.");
  GridData gd=new GridData();
  gd.horizontalSpan=2;
  noAccounts.setLayoutData(gd);
}
 

Example 4

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

Source file: AwsToolkitPreferencePage.java

  32 
vote

/** 
 * Creates a new label with the specified text.
 * @param labelText The text for the label.
 * @param composite The parent composite.
 * @return The new Label.
 */
protected Label newLabel(String labelText,Composite composite){
  Label label=new Label(composite,SWT.WRAP);
  label.setText(labelText);
  GridData data=new GridData(SWT.FILL,SWT.FILL,false,false);
  data.horizontalSpan=LAYOUT_COLUMN_WIDTH;
  data.widthHint=500;
  label.setLayoutData(data);
  return label;
}
 

Example 5

From project bel-editor, under directory /org.openbel.editor.ui/src/org/openbel/editor/ui/properties/.

Source file: BELEditorPropertyPage.java

  32 
vote

private void addSeparator(Composite parent){
  Label separator=new Label(parent,SWT.SEPARATOR | SWT.HORIZONTAL);
  GridData gridData=new GridData();
  gridData.horizontalAlignment=GridData.FILL;
  gridData.grabExcessHorizontalSpace=true;
  separator.setLayoutData(gridData);
}
 

Example 6

From project bel-editor, under directory /org.openbel.editor.ui/src/org/openbel/editor/ui/properties/.

Source file: BELEditorPropertyPage.java

  32 
vote

/** 
 * @see PreferencePage#createContents(Composite)
 */
@Override protected Control createContents(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  composite.setLayout(layout);
  GridData data=new GridData(GridData.FILL);
  data.grabExcessHorizontalSpace=true;
  composite.setLayoutData(data);
  addFirstSection(composite);
  addSeparator(composite);
  addSecondSection(composite);
  return composite;
}
 

Example 7

From project big-data-plugin, under directory /src/org/pentaho/di/ui/vfs/hadoopvfsfilechooserdialog/.

Source file: HadoopVfsFileChooserDialog.java

  32 
vote

public HadoopVfsFileChooserDialog(VfsFileChooserDialog vfsFileChooserDialog,FileObject rootFile,FileObject initialFile){
  super(HadoopSpoonPlugin.HDFS_SCHEME,HadoopSpoonPlugin.HDFS_SCHEME_DISPLAY_NAME,vfsFileChooserDialog,SWT.NONE);
  this.rootFile=rootFile;
  this.initialFile=initialFile;
  this.vfsFileChooserDialog=vfsFileChooserDialog;
  GridData gridData=new GridData(SWT.FILL,SWT.CENTER,true,false);
  setLayoutData(gridData);
  setLayout(new GridLayout(1,false));
  createConnectionPanel();
  initializeConnectionPanel();
}
 

Example 8

From project Bio-PEPA, under directory /uk.ac.ed.inf.biopepa.ui/src/uk/ac/ed/inf/biopepa/ui/wizards/export/.

Source file: PrismExportWizard.java

  32 
vote

private GridData newTextGridData(){
  GridData textGridData=new GridData();
  textGridData.widthHint=80;
  textGridData.horizontalAlignment=GridData.FILL;
  textGridData.grabExcessHorizontalSpace=true;
  return textGridData;
}
 

Example 9

From project Bio-PEPA, under directory /uk.ac.ed.inf.biopepa.ui/src/uk/ac/ed/inf/biopepa/ui/wizards/export/.

Source file: SimulationDistributionsWizard.java

  32 
vote

private GridData newTextGridData(){
  GridData textGridData=new GridData();
  textGridData.widthHint=80;
  textGridData.horizontalAlignment=GridData.FILL;
  textGridData.grabExcessHorizontalSpace=true;
  return textGridData;
}
 

Example 10

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

Source file: ModelsListEditor.java

  32 
vote

/** 
 * Helper method to create a push button.
 * @param parent the parent control
 * @param key the resource name used to supply the button's label text
 * @return Button
 */
private Button createPushButton(Composite parent,String key){
  Button button=new Button(parent,SWT.PUSH);
  button.setText(JFaceResources.getString(key));
  button.setFont(parent.getFont());
  GridData data=new GridData(GridData.FILL_HORIZONTAL);
  int widthHint=convertHorizontalDLUsToPixels(button,IDialogConstants.BUTTON_WIDTH);
  data.widthHint=Math.max(widthHint,button.computeSize(SWT.DEFAULT,SWT.DEFAULT,true).x);
  button.setLayoutData(data);
  button.addSelectionListener(getSelectionListener());
  return button;
}
 

Example 11

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

Source file: StructureGeneratorSettingsPage.java

  32 
vote

private Text createSettingField(FormToolkit toolkit,Composite settingsSectionClient,Text fieldSWTWidget,String label,String generatorName,String field,String defaultValue){
  SenecaJobSpecification specification=((SenecaJobEditor)this.getEditor()).getSpecification();
  toolkit.createLabel(settingsSectionClient,label);
  String value=specification.getGeneratorSetting(generatorName,field);
  fieldSWTWidget=toolkit.createText(settingsSectionClient,value != null ? value : defaultValue,SWT.BORDER);
  GridData gData=new GridData(GridData.FILL_HORIZONTAL);
  gData.horizontalSpan=1;
  fieldSWTWidget.setLayoutData(gData);
  fieldSWTWidget.addModifyListener(new EditorModifyListener(this));
  return fieldSWTWidget;
}
 

Example 12

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

Source file: ClonePage.java

  32 
vote

public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NULL);
  GridLayout layout=new GridLayout();
  container.setLayout(layout);
  layout.numColumns=1;
  text=new Text(container,SWT.NULL);
  text.setText(name + ".new");
  GridData gridData3=new GridData();
  gridData3.widthHint=200;
  text.setLayoutData(gridData3);
  setControl(container);
}
 

Example 13

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

Source file: SpecMolPeackChartComposite.java

  32 
vote

/** 
 * initializes the composite by creating and adding a peak chart
 * @param AssignmentPage page 
 */
private void init(AssignmentPage page){
  GridLayout layout=new GridLayout();
  this.setLayout(layout);
  GridData layoutData=new GridData(GridData.FILL_BOTH);
  this.setLayoutData(layoutData);
  Frame fileTableFrame=SWT_AWT.new_Frame(this);
  fileTableFrame.setLayout(new BorderLayout());
  chart=SpectrumChartFactory.createPeakChart(null,null,null);
  chart.setTitle("empty chart");
  chartPanel=new SpokChartPanel(chart,"peak",null,null);
  fileTableFrame.add(chartPanel,BorderLayout.CENTER);
  chartPanel.addMouseListener(page.getPeakChartCompositeMouseListener());
}
 

Example 14

From project bioclipse.vscreen, under directory /net.bioclipse.vscreen.ui/src/net/bioclipse/vscreen/ui/editors/.

Source file: VScreenEditor.java

  32 
vote

@Override public void createPartControl(Composite parent){
  GridLayout gridLayout=new GridLayout();
  gridLayout.numColumns=1;
  parent.setLayout(gridLayout);
  viewer=new TreeViewer(parent,SWT.BORDER | SWT.MULTI | SWT.H_SCROLL| SWT.V_SCROLL);
  ColumnViewerToolTipSupport.enableFor(viewer);
  viewer.setContentProvider(new VScreenContentProvider());
  viewer.setLabelProvider(new LabelProvider());
  GridData gridData=new GridData(GridData.FILL,GridData.FILL,true,true);
  viewer.getTree().setLayoutData(gridData);
  viewer.setInput(new String[]{"WEEHOOW"});
}
 

Example 15

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

Source file: IncludedResourcesPart.java

  32 
vote

void createSection(Section section,FormToolkit toolkit){
  section.setText("Import Patterns");
  section.setDescription("Resources matching the listed patterns will be included in the bundle.");
  Composite composite=toolkit.createComposite(section);
  section.setClient(composite);
  table=toolkit.createTable(composite,SWT.FULL_SELECTION | SWT.MULTI);
  GridLayout layout=new GridLayout(2,false);
  composite.setLayout(layout);
  GridData gd;
  gd=new GridData(SWT.FILL,SWT.FILL,true,true,1,3);
  gd.widthHint=300;
  gd.heightHint=100;
  table.setLayoutData(gd);
}
 

Example 16

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

Source file: PageLayoutUtils.java

  32 
vote

static Object createExpanded(){
  GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
  gd.widthHint=50;
  gd.heightHint=50;
  return gd;
}
 

Example 17

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

Source file: FilterDialog.java

  31 
vote

private void addFilterEntryGroup(){
  filterEntriesGroup=new Group(container,SWT.NONE);
  GridLayout layout=new GridLayout(1,false);
  layout.marginHeight=0;
  filterEntriesGroup.setLayout(layout);
  filterEntriesGroup.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false,1,1));
}
 

Example 18

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

Source file: FilterDialog.java

  31 
vote

private void addNewFilterEntryAtIndex(int index){
  FilterEntryComponent filterEntryComponent=new FilterEntryComponent(filterEntriesGroup);
  filterEntryComponent.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,false,1,1));
  filterEntryComponent.setFilterChangedListener(filterEntryChangedListener);
  filterEntryComponents.add(index,filterEntryComponent);
  updateRemoveButtonEnabled();
}
 

Example 19

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

Source file: ServicesEditDialog.java

  31 
vote

protected Control createDialogArea(Composite parent){
  setTitle("OpenTox Service Endpoint");
  setMessage("Enter details for the OpenTox Service Endpoint. \n");
  Composite area=(Composite)super.createDialogArea(parent);
  Composite container=new Composite(area,SWT.NONE);
  container.setLayout(new GridLayout(2,false));
  container.setLayoutData(new GridData(GridData.FILL_BOTH));
  final Label lblName=new Label(container,SWT.NONE);
  lblName.setLayoutData(new GridData(SWT.RIGHT,SWT.CENTER,false,false,1,1));
  lblName.setText("Name:");
  txtName=new Text(container,SWT.BORDER);
  GridData gridData_1=new GridData(SWT.FILL,SWT.CENTER,true,false,1,1);
  gridData_1.widthHint=100;
  txtName.setLayoutData(gridData_1);
  txtName.setText(name);
  final Label lblURL=new Label(container,SWT.NONE);
  lblURL.setLayoutData(new GridData(SWT.RIGHT,SWT.CENTER,false,false,1,1));
  lblURL.setText("Service:");
  txtService=new Text(container,SWT.BORDER);
  GridData gridData=new GridData(SWT.FILL,SWT.CENTER,true,false,1,1);
  gridData.widthHint=250;
  txtService.setLayoutData(gridData);
  txtService.setText(service);
  final Label lblServiceSPARQL=new Label(container,SWT.NONE);
  lblServiceSPARQL.setLayoutData(new GridData(SWT.RIGHT,SWT.CENTER,false,false,1,1));
  lblServiceSPARQL.setText("ServiceSPARQL:");
  txtServiceSparql=new Text(container,SWT.BORDER);
  GridData gridData2=new GridData(SWT.FILL,SWT.CENTER,true,false,1,1);
  gridData2.widthHint=250;
  txtServiceSparql.setLayoutData(gridData2);
  txtServiceSparql.setText(serviceSparql);
  return area;
}
 

Example 20

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

Source file: MetadataPage.java

  31 
vote

protected void createFormContent(IManagedForm managedForm){
  SenecaJobSpecification specification=((SenecaJobEditor)this.getEditor()).getSpecification();
  final ScrolledForm form=managedForm.getForm();
  FormToolkit toolkit=managedForm.getToolkit();
  form.setText("General Information");
  GridLayout layout=new GridLayout(3,false);
  form.getBody().setLayout(layout);
  toolkit.createLabel(form.getBody(),"Job Title:");
  jobTitle=toolkit.createText(form.getBody(),specification.getJobTitle(),SWT.BORDER);
  GridData gData=new GridData(GridData.FILL_HORIZONTAL);
  gData.horizontalSpan=2;
  jobTitle.setLayoutData(gData);
  jobTitle.addModifyListener(new EditorModifyListener(this));
  toolkit.createLabel(form.getBody(),"Molecular Formula:");
  mfData=toolkit.createText(form.getBody(),specification.getMolecularFormula(),SWT.BORDER);
  mfData.setLayoutData(gData);
  mfData.addModifyListener(new EditorModifyListener(this));
  toolkit.createLabel(form.getBody(),"Carbon hydrogen count:");
  for (int i=0; i < 4; i++) {
    toolkit.createLabel(form.getBody(),"CH" + i,SWT.BORDER);
    dataFile[i]=toolkit.createText(form.getBody(),Integer.toString(specification.getDeptData(i)),SWT.BORDER);
    gData=new GridData(SWT.LEFT);
    gData.horizontalSpan=1;
    dataFile[i].setLayoutData(gData);
    dataFile[i].addModifyListener(new EditorModifyListener(this));
    if (i < 4 - 1)     toolkit.createComposite(form.getBody());
  }
  toolkit.createLabel(form.getBody(),"Do aromaticity detection during run");
  detectAromaticity=toolkit.createButton(form.getBody(),"",SWT.CHECK);
  detectAromaticity.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
      setDirty(true);
    }
    public void widgetSelected(    SelectionEvent e){
      setDirty(true);
    }
  }
);
  detectAromaticity.setSelection(specification.getDetectAromaticity());
}
 

Example 21

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

Source file: CheckBoxField.java

  31 
vote

@Override protected void createControl(Composite parent){
  fCheckBox=new Button(parent,SWT.CHECK);
  fCheckBox.setText(getLabelText());
  GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
  gridData.horizontalSpan=2;
  fCheckBox.setLayoutData(gridData);
  if (getInitialValue() != null) {
    fCheckBox.setSelection(Boolean.parseBoolean(getInitialValue()));
  }
 else   fCheckBox.setSelection(false);
  fCurrentSelection=fCheckBox.getSelection();
  fCheckBox.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
      widgetSelected(e);
    }
    public void widgetSelected(    SelectionEvent e){
      fCurrentSelection=fCheckBox.getSelection();
      getDialog().validateFields();
    }
  }
);
}
 

Example 22

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

Source file: FileField.java

  31 
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 23

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

  30 
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;
}