Java Code Examples for org.eclipse.swt.widgets.Label

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 Bio-PEPA, under directory /uk.ac.ed.inf.common.ui.plotview/src/uk/ac/ed/inf/common/ui/plotview/views/actions/.

Source file: SaveChartDialog.java

  19 
vote

private Text createRow(Composite main,String label,int value){
  Label rowLabel=new Label(main,SWT.NULL);
  rowLabel.setText(label);
  rowLabel.setLayoutData(new GridData());
  Text rowText=new Text(main,SWT.BORDER);
  rowText.setText(Integer.toString(value));
  rowText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  return rowText;
}
 

Example 2

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

Source file: LayerForm.java

  18 
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

  18 
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 bel-editor, under directory /org.openbel.editor.ui/src/org/openbel/editor/ui/properties/.

Source file: BELEditorPropertyPage.java

  18 
vote

private void addFirstSection(Composite parent){
  Composite composite=createDefaultComposite(parent);
  Label pathLabel=new Label(composite,SWT.NONE);
  pathLabel.setText(PATH_TITLE);
  Text pathValueText=new Text(composite,SWT.WRAP | SWT.READ_ONLY);
  pathValueText.setText(((IResource)getElement()).getFullPath().toString());
}
 

Example 5

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

Source file: DownloadSpectraServerWizardPage.java

  18 
vote

protected void addAdditionalControl(Composite container){
  Label label=new Label(container,SWT.NULL);
  label.setText("\n\rThis will search for structures and their spectra by your existing structure.\n\rPlease choose the type of search you would like to use:");
  final String[] options=new String[]{"Exact Substructure","Fuzzy Substructure","Identity"};
  radios=new Button[options.length];
  for (int i=0; i < options.length; i++) {
    radios[i]=new Button(container,SWT.RADIO);
    if (i == 2)     radios[i].setSelection(true);
    radios[i].setText(options[i]);
  }
}
 

Example 6

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

Source file: WorkspaceMainPart.java

  18 
vote

private void createMissingExtsWarningPanel(Composite parent,FormToolkit tk,IPath extPath){
  Composite composite=tk.createComposite(parent);
  GridLayout layout=new GridLayout(2,false);
  layout.marginHeight=0;
  layout.marginWidth=0;
  composite.setLayout(layout);
  Label l1=tk.createLabel(composite,"image");
  l1.setImage(warningImg);
  Label l2=tk.createLabel(composite,String.format("No default configuration files found under %s",extPath));
  l2.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,false));
}
 

Example 7

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

Source file: BPELUnitCoveragePreferencePage.java

  18 
vote

protected void createSpacer(Composite composite,int columnSpan){
  Label label=new Label(composite,SWT.LEFT);
  GridData gd=new GridData();
  gd.horizontalSpan=columnSpan;
  label.setLayoutData(gd);
}
 

Example 8

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

Source file: AbstractBpmn2PropertiesComposite.java

  18 
vote

protected void createLabel(String name){
  Label label=new Label(this,SWT.NONE);
  label.setLayoutData(new GridData(SWT.RIGHT,SWT.CENTER,false,false,1,1));
  toolkit.adapt(label,true,true);
  label.setText(name);
  widgets.add(label);
}
 

Example 9

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

Source file: DsmDetailComposite.java

  18 
vote

/** 
 * <p> </p>
 * @param label
 * @return
 */
private Label createFieldWithLabel(Composite parent,String label){
  Label theLabel=new Label(parent,SWT.TRAIL);
  theLabel.setText(label);
  GridDataFactory.swtDefaults().grab(false,false).align(SWT.FILL,SWT.FILL).applyTo(theLabel);
  Label result=new Label(parent,SWT.LEAD);
  GridDataFactory.swtDefaults().grab(true,true).align(SWT.FILL,SWT.FILL).applyTo(result);
  return result;
}
 

Example 10

From project CBCJVM, under directory /eclipse/src/cbclipse/properties/.

Source file: CBCPropertyPage.java

  18 
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 11

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

Source file: CodePopup.java

  18 
vote

@Override protected Control createTitleControl(Composite parent){
  getPopupLayout().copy().numColumns(3).applyTo(parent);
  Label iconLabel=new Label(parent,SWT.NONE);
  iconLabel.setImage(CeylonPlugin.getInstance().getImageRegistry().get(CEYLON_SOURCE));
  getShell().addKeyListener(new GotoListener());
  return super.createTitleControl(parent);
}
 

Example 12

From project cilia-workbench, under directory /cilia-workbench-designer/src/fr/liglab/adele/cilia/workbench/designer/view/chainview/abstractchain/.

Source file: UpdateMediatorRefDialog.java

  18 
vote

protected Control createDialogArea(Composite parent){
  Composite container=(Composite)super.createDialogArea(parent);
  container.setLayout(new GridLayout(1,false));
  populateDialogArea(container);
  final Label messageArea=new Label(container,SWT.WRAP);
  messageArea.setText(peMessage);
  messageArea.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false));
  paramEditor=new ComboKeyValueEditor(container,peKeys,peModel,peKeyLabel,peValueLabel);
  paramEditor.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  paramEditor.setKeyValidator(defaultValidator);
  paramEditor.setValueValidator(defaultValidator);
  return container;
}
 

Example 13

From project CIShell, under directory /core/org.cishell.utility.swt/src/org/cishell/utility/swt/.

Source file: ExpandableComponentWidget.java

  18 
vote

public Collection<Label> createColumnLabels(Composite parent,int style){
  List<Label> columnLabels=new ArrayList<Label>();
  for (  String columnLabelText : createColumnLabelTexts()) {
    Label columnLabel=new Label(parent,style);
    columnLabel.setLayoutData(createColumnLabelLayoutData());
    columnLabel.setText(columnLabelText);
    columnLabels.add(columnLabel);
  }
  return columnLabels;
}
 

Example 14

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

  17 
vote

private void addUnionIntersection(){
  Composite unionIntersectionComponent=new Composite(container,SWT.NONE);
  unionIntersectionComponent.setLayout(new GridLayout(NR_OF_COLUMNS,false));
  Label lblBeiErfllen=new Label(unionIntersectionComponent,SWT.NONE);
  lblBeiErfllen.setText("If");
  groupFilterComboViewer=new ComboViewer(unionIntersectionComponent,SWT.READ_ONLY);
  groupFilterComboViewer.setContentProvider(ArrayContentProvider.getInstance());
  groupFilterComboViewer.setLabelProvider(new LabelProvider(){
    @Override public String getText(    Object element){
      return ((FilterGroupType)element).value();
    }
  }
);
  groupFilterComboViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      filterGroupType=SelectionHelper.handleStructuredSelectionEvent(event,FilterGroupType.class);
    }
  }
);
  groupFilterComboViewer.setInput(FilterGroupType.values());
  groupFilterComboViewer.setSelection(new StructuredSelection(FilterGroupType.UNION));
  Label lblDerFolgendenBedingungen=new Label(unionIntersectionComponent,SWT.NONE);
  lblDerFolgendenBedingungen.setText("of the following conditions are met:");
}
 

Example 15

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

Source file: ServicesEditDialog.java

  17 
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 16

From project ccw, under directory /ccw.leiningen/src/java/ccw/leiningen/.

Source file: WizardNewLeiningenProjectTemplatePage.java

  17 
vote

/** 
 * (non-Javadoc) Method declared on IDialogPage.
 */
public void createLeinTemplateGroup(Composite parent){
  Composite projectGroup=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.numColumns=2;
  projectGroup.setLayout(layout);
  GridData projectGroupLayoutData=new GridData(GridData.FILL_HORIZONTAL);
  projectGroupLayoutData.grabExcessVerticalSpace=true;
  projectGroup.setLayoutData(projectGroupLayoutData);
  Label projectLabel=new Label(projectGroup,SWT.NONE);
  projectLabel.setText("Leiningen Template to use:");
  projectLabel.setFont(parent.getFont());
  templateNameField=new Text(projectGroup,SWT.BORDER);
  GridData data=projectGroupLayoutData;
  data.widthHint=SIZING_TEXT_FIELD_WIDTH;
  templateNameField.setLayoutData(data);
  templateNameField.setFont(parent.getFont());
  if (initialTemplateFieldValue != null) {
    templateNameField.setText(initialTemplateFieldValue);
  }
  templateNameField.addListener(SWT.Modify,templateNameModifyListener);
}
 

Example 17

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

Source file: AttributePropertiesEditionPartForm.java

  17 
vote

protected Composite createCommentsTextarea(FormToolkit widgetFactory,Composite parent){
  Label commentsLabel=createDescription(parent,EntityrelationViewsRepository.Attribute.Properties.comments,EntityrelationMessages.AttributePropertiesEditionPart_CommentsLabel);
  GridData commentsLabelData=new GridData(GridData.FILL_HORIZONTAL);
  commentsLabelData.horizontalSpan=3;
  commentsLabel.setLayoutData(commentsLabelData);
  comments=widgetFactory.createText(parent,"",SWT.BORDER | SWT.WRAP | SWT.MULTI| SWT.V_SCROLL);
  GridData commentsData=new GridData(GridData.FILL_HORIZONTAL);
  commentsData.horizontalSpan=2;
  commentsData.heightHint=80;
  commentsData.widthHint=200;
  comments.setLayoutData(commentsData);
  comments.addFocusListener(new FocusAdapter(){
    /** 
 * {@inheritDoc}
 * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
 */
    public void focusLost(    FocusEvent e){
      if (propertiesEditionComponent != null) {
        propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AttributePropertiesEditionPartForm.this,EntityrelationViewsRepository.Attribute.Properties.comments,PropertiesEditionEvent.COMMIT,PropertiesEditionEvent.SET,null,comments.getText()));
        propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AttributePropertiesEditionPartForm.this,EntityrelationViewsRepository.Attribute.Properties.comments,PropertiesEditionEvent.FOCUS_CHANGED,PropertiesEditionEvent.FOCUS_LOST,null,comments.getText()));
      }
    }
    /** 
 * @see org.eclipse.swt.events.FocusAdapter#focusGained(org.eclipse.swt.events.FocusEvent)
 */
    @Override public void focusGained(    FocusEvent e){
      if (propertiesEditionComponent != null) {
        propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AttributePropertiesEditionPartForm.this,null,PropertiesEditionEvent.FOCUS_CHANGED,PropertiesEditionEvent.FOCUS_GAINED,null,null));
      }
    }
  }
);
  EditingUtils.setID(comments,EntityrelationViewsRepository.Attribute.Properties.comments);
  EditingUtils.setEEFtype(comments,"eef::Textarea");
  FormUtils.createHelpButton(widgetFactory,parent,propertiesEditionComponent.getHelpContent(EntityrelationViewsRepository.Attribute.Properties.comments,EntityrelationViewsRepository.FORM_KIND),null);
  return parent;
}
 

Example 18

From project big-data-plugin, under directory /src/org/pentaho/di/ui/job/entries/sqoop/xul/.

Source file: SwtLabelOrLink.java

  16 
vote

public SwtLabelOrLink(Element self,XulComponent parent,XulDomContainer container,String tagName){
  super(tagName);
  if (self.getAttributeValue("onclick") != null) {
    link=new Link((Composite)parent.getManagedObject(),SWT.NONE);
    link.addSelectionListener(new SelectionListener(){
      public void widgetSelected(      SelectionEvent selectionEvent){
        invoke(onclick);
      }
      public void widgetDefaultSelected(      SelectionEvent selectionEvent){
        invoke(onclick);
      }
    }
);
    setManagedObject(link);
  }
 else {
    String multi=(self != null) ? self.getAttributeValue("multiline") : null;
    if (multi != null && multi.equals("true")) {
      label=new Label((Composite)parent.getManagedObject(),SWT.WRAP);
      setManagedObject(label);
    }
 else {
      cLabel=new CLabel((Composite)parent.getManagedObject(),SWT.NONE);
      setManagedObject(cLabel);
    }
  }
}