Java Code Examples for org.eclipse.swt.SWT#BEGINNING

The following examples show how to use org.eclipse.swt.SWT#BEGINNING . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OverrideMethodDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected Control createLinkControl(Composite composite) {
	Link link= new Link(composite, SWT.WRAP);
	link.setText(JavaUIMessages.OverrideMethodDialog_link_message);
	link.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			openCodeTempatePage(CodeTemplateContextType.OVERRIDECOMMENT_ID);
		}
	});
	link.setToolTipText(JavaUIMessages.OverrideMethodDialog_link_tooltip);

	GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
	gridData.widthHint= convertWidthInCharsToPixels(40); // only expand further if anyone else requires it
	link.setLayoutData(gridData);
	return link;
}
 
Example 2
Source File: SyntaxColoringPreferencePage.java    From editorconfig-eclipse with Apache License 2.0 6 votes vote down vote up
private void createHeader(Composite contents) {
	String text = PreferencesMessages.EditorConfigEditorPreferencePage_link;
	Link link = new Link(contents, SWT.NONE);
	link.setText(text);
	link.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			if ("org.eclipse.ui.preferencePages.GeneralTextEditor".equals(e.text)) //$NON-NLS-1$
				PreferencesUtil.createPreferenceDialogOn(getShell(), e.text, null, null);
			else if ("org.eclipse.ui.preferencePages.ColorsAndFonts".equals(e.text)) //$NON-NLS-1$
				PreferencesUtil.createPreferenceDialogOn(getShell(), e.text, null,
						"selectFont:org.eclipse.jdt.ui.EditorConfigEditor.textfont"); //$NON-NLS-1$
		}
	});

	GridData gridData = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
	gridData.widthHint = 150; // only expand further if anyone else requires
								// it
	link.setLayoutData(gridData);

	addFiller(contents);
}
 
Example 3
Source File: JavaEditorAppearanceConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void createHeader(Composite contents) {
	final Shell shell= contents.getShell();
	String text= PreferencesMessages.JavaEditorPreferencePage_link;
	Link link= new Link(contents, SWT.NONE);
	link.setText(text);
	link.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			if ("org.eclipse.ui.preferencePages.GeneralTextEditor".equals(e.text)) //$NON-NLS-1$
				PreferencesUtil.createPreferenceDialogOn(shell, e.text, null, null);
			else if ("org.eclipse.ui.preferencePages.ColorsAndFonts".equals(e.text)) //$NON-NLS-1$
				PreferencesUtil.createPreferenceDialogOn(shell, e.text, null, "selectFont:org.eclipse.jdt.ui.editors.textfont"); //$NON-NLS-1$
		}
	});

	GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
	gridData.widthHint= 150; // only expand further if anyone else requires it
	link.setLayoutData(gridData);

	addFiller(contents);
}
 
Example 4
Source File: ImageSection.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
private void createControls(File f) {
	Label header = tk.createLabel(comp, Strings.cut(f.getName(), 40));
	header.setToolTipText(f.getName());
	UI.gridData(header, false, false).verticalAlignment = SWT.BEGINNING;
	controls.add(header);
	Image img = new Image(comp.getDisplay(), f.getAbsolutePath());
	Label lab = tk.createLabel(comp, "");
	lab.setImage(img);
	lab.addDisposeListener(e -> {
		if (!img.isDisposed()) {
			img.dispose();
		}
	});
	controls.add(lab);
}
 
Example 5
Source File: AbstractAnnotationHover.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void createCompletionProposalsControl(Composite parent, ICompletionProposal[] proposals) {
	Composite composite= new Composite(parent, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	GridLayout layout2= new GridLayout(1, false);
	layout2.marginHeight= 0;
	layout2.marginWidth= 0;
	layout2.verticalSpacing= 2;
	composite.setLayout(layout2);

	Label separator= new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
	GridData gridData= new GridData(SWT.FILL, SWT.CENTER, true, false);
	separator.setLayoutData(gridData);

	Label quickFixLabel= new Label(composite, SWT.NONE);
	GridData layoutData= new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
	layoutData.horizontalIndent= 4;
	quickFixLabel.setLayoutData(layoutData);
	String text;
	if (proposals.length == 1) {
		text= JavaHoverMessages.AbstractAnnotationHover_message_singleQuickFix;
	} else {
		text= Messages.format(JavaHoverMessages.AbstractAnnotationHover_message_multipleQuickFix, new Object[] { String.valueOf(proposals.length) });
	}
	quickFixLabel.setText(text);

	setColorAndFont(composite, parent.getForeground(), parent.getBackground(), JFaceResources.getDialogFont());
	createCompletionProposalsList(composite, proposals);
}
 
Example 6
Source File: AbstractAnnotationHover.java    From typescript.java with MIT License 5 votes vote down vote up
private void createAnnotationInformation(Composite parent, final Annotation annotation) {
	Composite composite = new Composite(parent, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
	GridLayout layout = new GridLayout(2, false);
	layout.marginHeight = 2;
	layout.marginWidth = 2;
	layout.horizontalSpacing = 0;
	composite.setLayout(layout);

	final Canvas canvas = new Canvas(composite, SWT.NO_FOCUS);
	GridData gridData = new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false);
	gridData.widthHint = 17;
	gridData.heightHint = 16;
	canvas.setLayoutData(gridData);
	canvas.addPaintListener(new PaintListener() {

		@Override
		public void paintControl(PaintEvent e) {
			e.gc.setFont(null);
			fMarkerAnnotationAccess.paint(annotation, e.gc, canvas, new Rectangle(0, 0, 16, 16));
		}
	});

	StyledText text = new StyledText(composite, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY);
	GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
	text.setLayoutData(data);
	String annotationText = annotation.getText();
	if (annotationText != null)
		text.setText(annotationText);
}
 
Example 7
Source File: HoverInfoWithSpellingAnnotation.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
private void createCompletionProposalsControl(Composite parent, ICompletionProposal[] proposals) {
    Composite composite= new Composite(parent, SWT.NONE);
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    GridLayout layout2= new GridLayout(1, false);
    layout2.marginHeight= 0;
    layout2.marginWidth= 0;
    layout2.verticalSpacing= 2;
    composite.setLayout(layout2);

    Label separator= new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
    GridData gridData= new GridData(SWT.FILL, SWT.CENTER, true, false);
    separator.setLayoutData(gridData);

    Label quickFixLabel= new Label(composite, SWT.NONE);
    GridData layoutData= new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
    layoutData.horizontalIndent= 4;
    quickFixLabel.setLayoutData(layoutData);
    String text;
    if (proposals.length == 1) {
        text= "1 quick fix available:";
    } else {
        text= MessageFormat.format("{0} quick fixes available:", new Object[] {String.valueOf(proposals.length)});
    }
    quickFixLabel.setText(text);

    setColorAndFont(composite, parent.getForeground(), parent.getBackground(), JFaceResources.getDialogFont());
    createCompletionProposalsList(composite, proposals);
}
 
Example 8
Source File: CompletionProposalComputerRegistry.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Log the status and inform the user about a misbehaving extension.
 *
 * @param descriptor the descriptor of the misbehaving extension
 * @param status a status object that will be logged
 */
void informUser(CompletionProposalComputerDescriptor descriptor, IStatus status) {
	JavaPlugin.log(status);
       String title= JavaTextMessages.CompletionProposalComputerRegistry_error_dialog_title;
       CompletionProposalCategory category= descriptor.getCategory();
       IContributor culprit= descriptor.getContributor();
       Set<String> affectedPlugins= getAffectedContributors(category, culprit);

	final String avoidHint;
	final String culpritName= culprit == null ? null : culprit.getName();
	if (affectedPlugins.isEmpty())
		avoidHint= Messages.format(JavaTextMessages.CompletionProposalComputerRegistry_messageAvoidanceHint, new Object[] {culpritName, category.getDisplayName()});
	else
		avoidHint= Messages.format(JavaTextMessages.CompletionProposalComputerRegistry_messageAvoidanceHintWithWarning, new Object[] {culpritName, category.getDisplayName(), toString(affectedPlugins)});

	String message= status.getMessage();
       // inlined from MessageDialog.openError
       MessageDialog dialog = new MessageDialog(JavaPlugin.getActiveWorkbenchShell(), title, null /* default image */, message, MessageDialog.ERROR, new String[] { IDialogConstants.OK_LABEL }, 0) {
       	@Override
		protected Control createCustomArea(Composite parent) {
       		Link link= new Link(parent, SWT.NONE);
       		link.setText(avoidHint);
       		link.addSelectionListener(new SelectionAdapter() {
       			@Override
				public void widgetSelected(SelectionEvent e) {
       				PreferencesUtil.createPreferenceDialogOn(getShell(), "org.eclipse.jdt.ui.preferences.CodeAssistPreferenceAdvanced", null, null).open(); //$NON-NLS-1$
       			}
       		});
       		GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
       		gridData.widthHint= this.getMinimumMessageWidth();
			link.setLayoutData(gridData);
       		return link;
       	}
       };
       dialog.open();
}
 
Example 9
Source File: AnnotationWithQuickFixesHover.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
private void createCompletionProposalsControl(Composite parent, ICompletionProposal[] proposals) {
	Composite composite= new Composite(parent, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	GridLayout layout2= new GridLayout(1, false);
	layout2.marginHeight= 0;
	layout2.marginWidth= 0;
	layout2.verticalSpacing= 2;
	composite.setLayout(layout2);

	Label separator= new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
	GridData gridData= new GridData(SWT.FILL, SWT.CENTER, true, false);
	separator.setLayoutData(gridData);

	Label quickFixLabel= new Label(composite, SWT.NONE);
	GridData layoutData= new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
	layoutData.horizontalIndent= 4;
	quickFixLabel.setLayoutData(layoutData);
	String text;
	if (proposals.length == 1) {
		// DIFF: replaced JavaHoverMessages with XtextUIMessages (4)
		text= XtextUIMessages.AnnotationWithQuickFixesHover_message_singleQuickFix;
	} else {
		// DIFF: replaced JavaHoverMessages with XtextUIMessages (4)
		text= MessageFormat.format(XtextUIMessages.AnnotationWithQuickFixesHover_message_multipleQuickFix, new Object[] { String.valueOf(proposals.length) });
	}
	quickFixLabel.setText(text);

	setColorAndFont(composite, parent.getForeground(), parent.getBackground(), JFaceResources.getDialogFont());
	createCompletionProposalsList(composite, proposals);
}
 
Example 10
Source File: AnnotationWithQuickFixesHover.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
private void createAnnotationInformation(Composite parent, final Annotation annotation) {
	Composite composite= new Composite(parent, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
	GridLayout layout= new GridLayout(2, false);
	layout.marginHeight= 2;
	layout.marginWidth= 2;
	layout.horizontalSpacing= 0;
	composite.setLayout(layout);

	final Canvas canvas= new Canvas(composite, SWT.NO_FOCUS);
	GridData gridData= new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false);
	gridData.widthHint= 17;
	gridData.heightHint= 16;
	canvas.setLayoutData(gridData);
	canvas.addPaintListener(new PaintListener() {
		@Override
		public void paintControl(PaintEvent e) {
			e.gc.setFont(null);
			fMarkerAnnotationAccess.paint(annotation, e.gc, canvas, new Rectangle(0, 0, 16, 16));
		}
	});

	StyledText text= new StyledText(composite, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY);
	GridData data= new GridData(SWT.FILL, SWT.FILL, true, true);
	text.setLayoutData(data);
	String annotationText= annotation.getText();
	if (annotationText != null)
		text.setText(annotationText);
}
 
Example 11
Source File: CvwActionPage.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
@Override
public void createControl(Composite parent) {
    super.createControl(parent);
    
    Composite container = new Composite(parent, SWT.NONE);
    container.setLayout(WizardUtils.createGridLayout(2, 5));
    
    Composite comp = new Composite(container, SWT.NONE);
    GridLayout gl = WizardUtils.createGridLayout(2, 0);
    gl.marginWidth = 0;
    comp.setLayout(gl);
    GridData gd = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
    gd.horizontalSpan = 2;
    comp.setLayoutData(gd);
    WizardUtils.createLabel(comp, "Initial date range: ", 1); // $NLX-CvwActionPage.Initialdaterange-1$
    _initialDateRangeCombo = WizardUtils.createCombo(comp, 1, CalendarFormat.getLabels(), CalendarFormat.WORK_WEEK.getIndex(), null);
    
    _dateRangeCheckbox = WizardUtils.createCheckBox(container, "Include date range icons",2, true); // $NLX-CvwActionPage.Includedaterangeicons-1$
    _dateRangeCheckbox.addSelectionListener(this);
    
    _todayCheckbox = WizardUtils.createCheckBox(container, CalendarFormat.TODAY.getLabel(), 1, true, 20);
    _todayTomorrowCheckbox = WizardUtils.createCheckBox(container, CalendarFormat.TODAY_TOMORROW.getLabel(), 1, true, 20);
    _workWeekCheckbox = WizardUtils.createCheckBox(container, CalendarFormat.WORK_WEEK.getLabel(), 1, true, 20);
    _fullWeekCheckbox = WizardUtils.createCheckBox(container, CalendarFormat.FULL_WEEK.getLabel(), 1, true, 20);
    _twoWeeksCheckbox = WizardUtils.createCheckBox(container, CalendarFormat.TWO_WEEKS.getLabel(), 1, true, 20);
    _monthCheckbox = WizardUtils.createCheckBox(container, CalendarFormat.MONTH.getLabel(), 1, true, 20);
    _yearCheckbox = WizardUtils.createCheckBox(container, CalendarFormat.YEAR.getLabel(), 1, true, 20);
            
    _displayFormatCheckbox = WizardUtils.createCheckBox(container, "Include display format icons", 2, true); // $NLX-CvwActionPage.Includedisplayformaticons-1$
    
    setControl(container);
    setPageComplete(true);        
}
 
Example 12
Source File: NewRelationDisplayDocPage.java    From depan with Apache License 2.0 5 votes vote down vote up
@Override
public Composite createOptionsControl(Composite container) {
  Group result = new Group(container, SWT.NONE);
  result.setText("Edge Display Document Options");

  GridLayout grid = new GridLayout();
  grid.numColumns = 2;
  grid.verticalSpacing = 9;
  result.setLayout(grid);

  GridData fillHorz = new GridData(SWT.FILL, SWT.BEGINNING, true, false);

  // Row 1) Container selection
  Label label = new Label(result, SWT.NULL);
  label.setText("&Name:");

  docName = new Text(result, SWT.BORDER | SWT.SINGLE);
  docName.setLayoutData(fillHorz);
  docName.setText(propInfo.getName());
  docName.addModifyListener(new ModifyListener() {

    @Override
    public void modifyText(ModifyEvent e) {
      updatePageStatus();
    }
  });

  return result;
}
 
Example 13
Source File: XSPEditorUtil.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
static public DCLabel createIndentedDCLabel(Composite parent, String attrName, int width, int indentAmt) {
    DCLabel newLabel = new DCLabel(parent, SWT.NONE, attrName); // use the attrname as the id by default
    newLabel.setAttributeName(attrName);
    GridData gd = new GridData(SWT.BEGINNING, SWT.CENTER, false, false, width, 1);
    if (indentAmt != 0)
        gd.horizontalIndent = indentAmt;
    newLabel.setLayoutData(gd);
    newLabel.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    return newLabel;
}
 
Example 14
Source File: XSPEditorUtil.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
static public Label createIndentedLabel(Composite parent, String labelText, int width, int indentAmt) {
    Label newLabel = new Label(parent, SWT.NONE);
    newLabel.setText(labelText);
    GridData ourGD = new GridData(SWT.BEGINNING, SWT.CENTER, false, false, width, 1);
    if (indentAmt != 0)
        ourGD.horizontalIndent = indentAmt;
    newLabel.setLayoutData(ourGD);
    newLabel.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    return newLabel;
}
 
Example 15
Source File: XSPEditorUtil.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
static public CustomCheckBox createIndentedCheck(Composite parent, String labelText, String id, int indent) {
    CustomCheckBox dcc = new CustomCheckBox(parent, SWT.CHECK, id);
    dcc.setText(labelText);
    dcc.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    GridData gd = new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 1, 1);
    gd.horizontalIndent = indent;
    dcc.setLayoutData(gd);
    return dcc;
}
 
Example 16
Source File: SimpleSlider.java    From gama with GNU General Public License v3.0 5 votes vote down vote up
public Panel(final Composite parent, final Color color, final boolean lastFillerRegion) {
	super(parent, SWT.DOUBLE_BUFFERED | SWT.NO_BACKGROUND);
	gd = new GridData(lastFillerRegion ? SWT.FILL : SWT.BEGINNING, SWT.BEGINNING, lastFillerRegion, false);
	gd.minimumHeight = 4;
	this.color = color;
	setLayoutData(gd);
	addPaintListener(this);
}
 
Example 17
Source File: BaseOutputDialog.java    From workspacemechanic with Eclipse Public License 1.0 4 votes vote down vote up
protected void createLabel(Composite parent, String text) {
  Label titleLabel = new Label(parent, SWT.BEGINNING);
  titleLabel.setText(text);
}
 
Example 18
Source File: EpfOutputDialog.java    From workspacemechanic with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected void addChildConfiguration(Composite parent) {
  // Add preferences table
  Label savedPreferencesLabel = new Label(parent, SWT.BEGINNING);
  savedPreferencesLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.LEFT, true, false, 3, 1));
  savedPreferencesLabel.setText("Saved Preferences:");

  Composite tableContainer = new Composite(parent, SWT.NONE);
  GridData tableLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1);
  tableContainer.setLayoutData(tableLayoutData);

  TableColumnLayout columnLayout = new TableColumnLayout();
  tableContainer.setLayout(columnLayout);

  acceptedPreferences =
      CheckboxTableViewer.newCheckList(tableContainer, SWT.SINGLE | SWT.FULL_SELECTION);
  Table acceptedPreferencesTable = acceptedPreferences.getTable();
  acceptedPreferencesTable.setHeaderVisible(true);
  acceptedPreferencesTable.setLinesVisible(true);

  // Setup table columns
  TableColumn keyColumn = new TableColumn(acceptedPreferencesTable, SWT.LEFT);
  keyColumn.setText("Key");
  columnLayout.setColumnData(keyColumn, new ColumnWeightData(1, 300, true));

  TableColumn valueColumn = new TableColumn(acceptedPreferencesTable, SWT.LEFT);
  valueColumn.setText("Value");
  columnLayout.setColumnData(valueColumn, new ColumnWeightData(1, 100, true));

  acceptedPreferences.setLabelProvider(labelProvider);
  acceptedPreferences.setContentProvider(new ArrayContentProvider());
  acceptedPreferences.setInput(preferences.keySet().toArray());

  acceptedPreferences.setAllChecked(true);
  acceptedPreferences.addCheckStateListener(new ICheckStateListener() {
    public void checkStateChanged(CheckStateChangedEvent event) {
      Set<String> newSelectedKeys = new HashSet<String>();
      for (Object obj : acceptedPreferences.getCheckedElements()) {
        newSelectedKeys.add((String) obj);
      }

      selectedKeys = newSelectedKeys;
      validate();
    }
  });

  tableContainer.layout();
}
 
Example 19
Source File: IndentGuidePreferencePage.java    From xds-ide with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(1, true));

    enabled = new Button(composite, SWT.CHECK);
    enabled.setText(Messages.IndentGuidePreferencePage_EnableIndentGuide);
    enabled.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            super.widgetSelected(e);
            enableControls(enabled.getSelection());
        }
    });

    Group group = new Group(composite, SWT.NONE);
    group.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
    group.setLayout(new GridLayout(1, true));
    group.setText(Messages.IndentGuidePreferencePage_LineAttributes);
    attributes = new Composite(group, SWT.NONE);
    GridData gridData = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
    gridData.horizontalIndent = 5;
    attributes.setLayoutData(gridData);
    attributes.setLayout(new GridLayout(2, false));

    new Label(attributes, SWT.NONE)
            .setText(Messages.IndentGuidePreferencePage_Alpha_0_255 + ':');
    lineAlpha = new Spinner(attributes, SWT.BORDER);
    lineAlpha.setMinimum(0);
    lineAlpha.setMaximum(255);
    new Label(attributes, SWT.NONE)
            .setText(Messages.IndentGuidePreferencePage_Style + ':');
    lineStyle = new Combo(attributes, SWT.READ_ONLY);
    lineStyle.setItems(styles);
    new Label(attributes, SWT.NONE)
            .setText(Messages.IndentGuidePreferencePage_Width_1_8 + ':');
    lineWidth = new Spinner(attributes, SWT.BORDER);
    lineWidth.setMinimum(1);
    lineWidth.setMaximum(8);
    new Label(attributes, SWT.NONE)
            .setText(Messages.IndentGuidePreferencePage_Shift_1_8 + ':');
    lineShift = new Spinner(attributes, SWT.BORDER);
    lineShift.setMinimum(0);
    lineShift.setMaximum(8);
    colorFieldEditor = new ColorFieldEditor(PreferenceConstants.LINE_COLOR,
            Messages.IndentGuidePreferencePage_Color + ':', attributes);
    colorFieldEditor.setPreferenceStore(getPreferenceStore());

    loadPreferences();
    return composite;
}
 
Example 20
Source File: DHTView.java    From BiglyBT with GNU General Public License v2.0 2 votes vote down vote up
private void initialiseGeneralGroup() {
  Group gGeneral = new Group(panel,SWT.NONE);
  Messages.setLanguageText(gGeneral, "DHTView.general.title" );

  GridData data = new GridData();
  data.verticalAlignment = SWT.BEGINNING;
  data.widthHint = 360;
  gGeneral.setLayoutData(data);

  GridLayout layout = new GridLayout();
  layout.numColumns = 6;
  gGeneral.setLayout(layout);

  	// row1

  Label label = new Label(gGeneral,SWT.NONE);
  Messages.setLanguageText(label,"DHTView.general.uptime");

  lblUpTime = new Label(gGeneral,SWT.NONE);
  lblUpTime.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));

  label = new Label(gGeneral,SWT.NONE);
  Messages.setLanguageText(label,"DHTView.general.users");

  lblNumberOfUsers = new Label(gGeneral,SWT.NONE);
  lblNumberOfUsers.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));

  label = new Label(gGeneral,SWT.NONE);
  Messages.setLanguageText(label,"DHTView.general.reachable");

  lblReachable = new Label(gGeneral,SWT.NONE);
  lblReachable.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));


  	// row 2

  label = new Label(gGeneral,SWT.NONE);
  Messages.setLanguageText(label,"DHTView.general.nodes");

  lblNodes = new Label(gGeneral,SWT.NONE);
  lblNodes.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));

  label = new Label(gGeneral,SWT.NONE);
  Messages.setLanguageText(label,"DHTView.general.leaves");

  lblLeaves = new Label(gGeneral,SWT.NONE);
  lblLeaves.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));

  label = new Label(gGeneral,SWT.NONE);
  Messages.setLanguageText(label,"DHTView.general.rendezvous");

  lblRendezvous = new Label(gGeneral,SWT.NONE);
  lblRendezvous.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));

  	// row 3

  label = new Label(gGeneral,SWT.NONE);
  Messages.setLanguageText(label,"DHTView.general.contacts");

  lblContacts = new Label(gGeneral,SWT.NONE);
  lblContacts.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));

  label = new Label(gGeneral,SWT.NONE);
  Messages.setLanguageText(label,"DHTView.general.replacements");

  lblReplacements = new Label(gGeneral,SWT.NONE);
  lblReplacements.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));

  label = new Label(gGeneral,SWT.NONE);
  Messages.setLanguageText(label,"DHTView.general.live");

  lblLive= new Label(gGeneral,SWT.NONE);
  lblLive.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));

  	// row 4

  label = new Label(gGeneral,SWT.NONE);
  Messages.setLanguageText(label,"DHTView.general.skew");

  lblSkew= new Label(gGeneral,SWT.NONE);
  lblSkew.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));

  label = new Label(gGeneral,SWT.NONE);
  Messages.setLanguageText(label,"DHTView.general.unknown");

  lblUnknown = new Label(gGeneral,SWT.NONE);
  lblUnknown.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));

  label = new Label(gGeneral,SWT.NONE);
  Messages.setLanguageText(label,"DHTView.general.dying");

  lblDying = new Label(gGeneral,SWT.NONE);
  lblDying.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));
}