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

The following examples show how to use org.eclipse.swt.SWT#SEPARATOR . 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: EncodingControlContribution.java    From eclipse-encoding-plugin with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This method will be called each time to update the label, as resize cannot be made to work.
 */
@Override
protected Control createControl(Composite parent) {

	// Label small height bug workarround for Neon - https://bugs.eclipse.org/bugs/show_bug.cgi?id=471313
	parent.getParent().setRedraw(true);

	agent.start(getWorkbenchWindow());
	statusBar = new Composite(parent, SWT.NONE);

	GridLayout gridLayout = new GridLayout();
	gridLayout.numColumns = 3;
	gridLayout.marginHeight = 0;
	statusBar.setLayout(gridLayout);

	encodingLabel = new EncodingLabel(agent, statusBar, 110);
	Label separator = new Label(statusBar, SWT.SEPARATOR | SWT.VERTICAL);
	separator.setLayoutData(new GridData(GridData.FILL_BOTH));
	lineSeparatorLabel = new LineSeparatorLabel(agent, statusBar, 40);

	fillControl();
	return statusBar;
}
 
Example 2
Source File: MenuItemProviders.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
public static IMenuItemProvider separatorMenuItemProvider() {
	return new IMenuItemProvider() {
		public void addMenuItem(NatTable natTable, Menu popupMenu) {
			 new MenuItem(popupMenu, SWT.SEPARATOR);
		}
	};
}
 
Example 3
Source File: MultiPlotGraphic.java    From BiglyBT with GNU General Public License v2.0 5 votes vote down vote up
@Override
 protected void
 addMenuItems(
Menu	menu )
 {
  new MenuItem( menu, SWT.SEPARATOR );
  
  MenuItem mi_reset = new MenuItem( menu, SWT.PUSH );

  mi_reset.setText(  MessageText.getString( "label.clear.history" ));

  mi_reset.addListener(SWT.Selection, new Listener() {
	  @Override
	  public void handleEvent(Event e) {
		  try{
		   	this_mon.enter();
		   	
		   	nbValues		= 0;
		   	currentPosition	= 0;
	 		
		   	for ( int i=0;i<all_values.length;i++ ){
		   		all_values[i] = new int[all_values[i].length];
		   	}		
		  }finally{
			  
			this_mon.exit();
		  }
		  
		  refresh( true );
	  }
  });
 }
 
Example 4
Source File: WizardComponentUtils.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
/** Horizontal line separator */
public static Control insertHorizontalSeparator(Composite parent) {
	Label label = new Label(parent, SWT.SEPARATOR | SWT.WRAP | SWT.HORIZONTAL | SWT.SHADOW_NONE);
	GridData separatorLayoutData = new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1);
	separatorLayoutData.heightHint = 25;
	label.setLayoutData(separatorLayoutData);
	return label;
}
 
Example 5
Source File: FileViewerWindow.java    From AppleCommander with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates the toolbar.
 */
private void createToolBar(Composite composite, Object layoutData) {
	toolBar = new ToolBar(composite, SWT.FLAT);
	toolBar.addListener(SWT.KeyUp, createToolbarCommandHandler());
	if (layoutData != null) toolBar.setLayoutData(layoutData);
	
	if (nativeFilter != null) {
		nativeFilterAdapter = (FilterAdapter) nativeFilterAdapterMap.get(nativeFilter.getClass());
		if (nativeFilterAdapter != null) {
			nativeToolItem = nativeFilterAdapter.create(toolBar);
			nativeToolItem.setSelection(true);
		} 
	}
	hexDumpToolItem = createHexDumpToolItem();
	if (nativeFilterAdapter == null) {
		// Default button changes for these instances.
		hexDumpToolItem.setSelection(true);
		// Prevent NullPointerExceptions if the nativeFilterAdapter does not apply.
		nativeFilterAdapter = hexFilterAdapter;
	}
	rawDumpToolItem = createRawDumpToolItem();
	new ToolItem(toolBar, SWT.SEPARATOR);
	copyToolItem = createCopyToolItem();
	new ToolItem(toolBar, SWT.SEPARATOR);
	createPrintToolItem();
	toolBar.pack();
}
 
Example 6
Source File: OSSpecific.java    From Rel with Apache License 2.0 5 votes vote down vote up
public static void addFileMenuItems(Menu menu) {
	new MenuItem(menu, SWT.SEPARATOR);
	MenuItem preferences = new MenuItem(menu, SWT.PUSH);
	preferences.setText("Preferences...");
	preferences.addListener(SWT.Selection, preferencesListener);
	MenuItem exit = new MenuItem(menu, SWT.PUSH);
	exit.setText("Exit " + appName);
	exit.addListener(SWT.Selection, exitListener);
}
 
Example 7
Source File: ExportDataSourceDialog.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
private void createSeparator( Composite composite, int span )
{
	Label separator = new Label( composite, SWT.HORIZONTAL | SWT.SEPARATOR );
	GridData gd = new GridData( GridData.FILL_HORIZONTAL );
	gd.verticalIndent = 5;
	gd.horizontalSpan = span;
	separator.setLayoutData( gd );
}
 
Example 8
Source File: EncodingLabel.java    From eclipse-encoding-plugin with Eclipse Public License 1.0 5 votes vote down vote up
private void createSettingMenu() {

		createSettingMenuItem(PREF_AUTODETECT_CHANGE, "Autodetect: Set Automatically");
		createSettingMenuItem(PREF_AUTODETECT_WARN, "Autodetect: Show Warning");
		createSettingMenuItem(PREF_DISABLE_DISCOURAGED_OPERATION, "Autodetect: Disable Discouraged Operations");
		new MenuItem(popupMenu, SWT.SEPARATOR);
	}
 
Example 9
Source File: SVNPropertyPage.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
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 10
Source File: TermDbManagerDialog.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create contents of the dialog.
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
	final Composite composite = (Composite) super.createDialogArea(parent);
	GridLayout parentLayout = ((GridLayout) composite.getLayout());
	parentLayout.numColumns = 4;
	parentLayout.marginHeight = 0;
	parentLayout.marginWidth = 0;
	parentLayout.marginTop = 0;
	parentLayout.verticalSpacing = 0;
	parentLayout.horizontalSpacing = 0;

	Control treeControl = createTreeAreaContents(composite);
	createSash(composite, treeControl);

	Label versep = new Label(composite, SWT.SEPARATOR | SWT.VERTICAL);
	GridData verGd = new GridData(GridData.FILL_VERTICAL | GridData.GRAB_VERTICAL);

	versep.setLayoutData(verGd);
	versep.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, true));

	Composite pageAreaComposite = new Composite(composite, SWT.NONE);
	pageAreaComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
	GridLayout layout = new GridLayout(1, true);
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	layout.verticalSpacing = 0;
	pageAreaComposite.setLayout(layout);

	// Build the Page container
	Composite pageContainer = createPageContainer(pageAreaComposite);
	GridData pageContainerData = new GridData(GridData.FILL_BOTH);
	pageContainerData.horizontalIndent = IDialogConstants.HORIZONTAL_MARGIN;
	pageContainer.setLayoutData(pageContainerData);
	// Build the separator line
	Label bottomSeparator = new Label(parent, SWT.HORIZONTAL | SWT.SEPARATOR);
	bottomSeparator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
	return composite;
}
 
Example 11
Source File: PropertyAndPreferenceFieldEditorPage.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
protected Label createDescriptionLabel(Composite parent)
{
	fParentComposite = parent;
	if (isProjectPreferencePage())
	{
		Composite composite = new Composite(parent, SWT.NONE);
		composite.setFont(parent.getFont());
		GridLayout layout = new GridLayout();
		layout.marginHeight = 0;
		layout.marginWidth = 0;
		layout.numColumns = 2;
		composite.setLayout(layout);
		composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

		IDialogFieldListener listener = new IDialogFieldListener()
		{
			public void dialogFieldChanged(DialogField field)
			{
				enableProjectSpecificSettings(((SelectionButtonDialogField) field).isSelected());
			}
		};

		fUseProjectSettings = new SelectionButtonDialogField(SWT.CHECK);
		fUseProjectSettings.setDialogFieldListener(listener);
		fUseProjectSettings.setLabelText(EplMessages.PropertyAndPreferencePage_enableProjectSpecific);
		fUseProjectSettings.doFillIntoGrid(composite, 1);
		setHorizontalGrabbing(fUseProjectSettings.getSelectionButton(null));

		if (offerLink())
		{
			fChangeWorkspaceSettings = createLink(composite,
					EplMessages.PropertyAndPreferencePage_workspaceSettingsLabel);
			fChangeWorkspaceSettings.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
		}
		else
		{
			setHorizontalSpan(fUseProjectSettings.getSelectionButton(null), 2);
		}

		Label horizontalLine = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
		horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
		horizontalLine.setFont(composite.getFont());
	}
	else if (supportsProjectSpecificOptions() && offerLink())
	{
		fChangeWorkspaceSettings = createLink(parent, EplMessages.PropertyAndPreferencePage_projectSettingsLabel);
		fChangeWorkspaceSettings.setLayoutData(new GridData(SWT.END, SWT.CENTER, true, false));
	}

	return super.createDescriptionLabel(parent);
}
 
Example 12
Source File: Txt2DatDesign.java    From ldparteditor with MIT License 4 votes vote down vote up
/**
 * Create contents of the dialog.
 *
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
    Composite cmp_container = (Composite) super.createDialogArea(parent);
    GridLayout gridLayout = (GridLayout) cmp_container.getLayout();
    gridLayout.verticalSpacing = 10;
    gridLayout.horizontalSpacing = 10;

    Label lbl_specify = new Label(cmp_container, SWT.NONE);
    lbl_specify.setText(I18n.TXT2DAT_Title);

    Label lbl_separator = new Label(cmp_container, SWT.SEPARATOR | SWT.HORIZONTAL);
    lbl_separator.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));

    Label lbl_coordsPrec = new Label(cmp_container, SWT.NONE);
    lbl_coordsPrec.setText(I18n.TXT2DAT_Font);

    NButton spn_vequ = new NButton(cmp_container, SWT.NONE);
    this.btn_chooseFont[0] = spn_vequ;
    spn_vequ.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    spn_vequ.setText(I18n.TXT2DAT_Select);

    Label lbl_text = new Label(cmp_container, SWT.NONE);
    lbl_text.setText(I18n.TXT2DAT_Text);

    Text txt_text = new Text(cmp_container, SWT.NONE);
    this.txt_text[0] = txt_text;
    txt_text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    txt_text.setText(ts.getText());

    Label lbl_use180deg = new Label(cmp_container, SWT.NONE);
    lbl_use180deg.setText(I18n.TXT2DAT_Flatness);

    BigDecimalSpinner spn_flatness = new BigDecimalSpinner(cmp_container, SWT.NONE);
    this.spn_flatness[0] = spn_flatness;
    spn_flatness.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    spn_flatness.setMaximum(new BigDecimal(1000));
    spn_flatness.setMinimum(new BigDecimal(0));
    spn_flatness.setValue(ts.getFlatness());

    Label lbl_af = new Label(cmp_container, SWT.NONE);
    lbl_af.setText(I18n.TXT2DAT_InterpolateFlatness);

    BigDecimalSpinner spn_interpolateFlatness = new BigDecimalSpinner(cmp_container, SWT.NONE);
    this.spn_interpolateFlatness[0] = spn_interpolateFlatness;
    spn_interpolateFlatness.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    spn_interpolateFlatness.setMaximum(new BigDecimal(1000));
    spn_interpolateFlatness.setMinimum(new BigDecimal(0));
    spn_interpolateFlatness.setValue(ts.getInterpolateFlatness());

    Label lbl_ac = new Label(cmp_container, SWT.NONE);
    lbl_ac.setText(I18n.TXT2DAT_FontHeight);

    BigDecimalSpinner spn_fontHeight = new BigDecimalSpinner(cmp_container, SWT.NONE);
    this.spn_fontHeight[0] = spn_fontHeight;
    spn_fontHeight.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    spn_fontHeight.setMaximum(new BigDecimal(10000));
    spn_fontHeight.setMinimum(new BigDecimal("0.0001")); //$NON-NLS-1$
    spn_fontHeight.setValue(ts.getFontHeight());

    Label lbl_ae = new Label(cmp_container, SWT.NONE);
    lbl_ae.setText(I18n.TXT2DAT_Angle);
    BigDecimalSpinner spn_deltaAngle = new BigDecimalSpinner(cmp_container, SWT.NONE);
    this.spn_deltaAngle[0] = spn_deltaAngle;
    spn_deltaAngle.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    spn_deltaAngle.setMaximum(new BigDecimal(30));
    spn_deltaAngle.setMinimum(new BigDecimal(0));
    spn_deltaAngle.setValue(ts.getDeltaAngle());

    cmp_container.pack();
    return cmp_container;
}
 
Example 13
Source File: ComponentTitledSeparator.java    From arx with Apache License 2.0 4 votes vote down vote up
/**
 * Create a separator
 */
private void createSeparator() {
        final Label separator = new Label(this, SWT.SEPARATOR | SWT.HORIZONTAL);
        separator.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
        separator.setBackground(getBackground());
}
 
Example 14
Source File: PropertyAndPreferencePage.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
protected Label createDescriptionLabel( Composite parent )
{
	fParentComposite = parent;

	if ( enableSetProjectSettings( ) )
	{
		if ( isProjectPreferencePage( ) )
		{
			Composite composite = new Composite( parent, SWT.NONE );
			composite.setFont( parent.getFont( ) );
			GridLayout layout = new GridLayout( );
			layout.marginHeight = 0;
			layout.marginWidth = 0;
			layout.numColumns = 2;
			composite.setLayout( layout );
			composite.setLayoutData( new GridData( SWT.FILL,
					SWT.CENTER,
					true,
					false ) );

			IDialogFieldListener listener = new IDialogFieldListener( ) {

				public void dialogFieldChanged( DialogField field )
				{
					if ( field instanceof SelectionButtonDialogField )
						enableProjectSpecificSettings( ( (SelectionButtonDialogField) field ).isSelected( ) );
				}
			};

			fUseProjectSettings = new SelectionButtonDialogField( SWT.CHECK );
			fUseProjectSettings.setDialogFieldListener( listener );
			fUseProjectSettings.setLabelText( Messages.getString( "PropertyAndPreferencePage.Text.Enable.SpecialSettings" ) ); //$NON-NLS-1$
			fUseProjectSettings.doFillIntoGrid( composite, 1 );
			WidgetUtil.setHorizontalGrabbing( fUseProjectSettings.getSelectionButton( null ) );

			if ( offerLink( ) )
			{
				fChangeWorkspaceSettings = createLink( composite,
						Messages.getString( "PropertyAndPreferencePage.Text.Configure.Workspace.Settings" ) ); //$NON-NLS-1$
				fChangeWorkspaceSettings.setLayoutData( new GridData( SWT.END,
						SWT.CENTER,
						false,
						false ) );
			}
			else
			{
				WidgetUtil.setHorizontalSpan( fUseProjectSettings.getSelectionButton( null ),
						2 );
			}

			Label horizontalLine = new Label( composite, SWT.SEPARATOR
					| SWT.HORIZONTAL );
			horizontalLine.setLayoutData( new GridData( GridData.FILL,
					GridData.FILL,
					true,
					false,
					2,
					1 ) );
			horizontalLine.setFont( composite.getFont( ) );
		}
		else if ( supportsProjectSpecificOptions( ) && offerLink( ) )
		{
			fChangeWorkspaceSettings = createLink( parent,
					Messages.getString( "PropertyAndPreferencePage.Text.Configure.Special.Settings" ) ); //$NON-NLS-1$
			fChangeWorkspaceSettings.setLayoutData( new GridData( SWT.END,
					SWT.CENTER,
					true,
					false ) );
		}
	}

	return super.createDescriptionLabel( parent );
}
 
Example 15
Source File: CDatePanel.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
public CDatePanel(Composite parent, int style) {
	super(parent, style);

	panel = new VPanel(this, SWT.NONE);

	locale = Locale.getDefault();
	try {
		timezone = TimeZone.getDefault();
	} catch (Exception e) {
		timezone = TimeZone.getTimeZone("GMT");
	}
	calendar = Calendar.getInstance(this.timezone, this.locale);
	calendar.setTime(new Date());

	builder = new CDateTimeBuilder();
	builder.setHeader(
			Header.Month().align(SWT.RIGHT, SWT.FILL, true).readOnly(),
			Header.Year().align(SWT.LEFT, SWT.FILL, true).readOnly());
	builder.setBody(Body.Days().compact());

	painter = new CDateTimePainter() {
		@Override
		protected void paintDayPanelBorders(VControl control, Event e) {
			Rectangle r = control.getBounds();
			e.gc.setForeground(e.display
					.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW));
			e.gc.drawLine(r.x, r.y, r.x, r.y + r.height - 50);
			e.gc.drawLine(r.x + r.width - 1, r.y, r.x + r.width - 1,
					r.y + r.height - 1);
			e.gc.drawLine(r.x, r.y + r.height - 1, r.x + r.width - 1,
					r.y + r.height - 1);
		}
	};

	pickers = new ArrayList<>();
	pickerSize = -1;

	VGridLayout layout = new VGridLayout();
	layout.verticalSpacing = 2;
	panel.setLayout(layout);

	createHeader();

	VLabel sep = new VLabel(panel, SWT.HORIZONTAL | SWT.SEPARATOR);
	sep.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));

	body = new VPanel(panel, SWT.NONE);
	body.setLayout(new VGridLayout());
	body.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

	body.addListener(SWT.Resize, event -> handleResize());
}
 
Example 16
Source File: XtendValidatorConfigurationBlock.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
private void createHorizontalLine(Composite settingsPage, int nColumns) {
	Label horizontalLine = new Label(settingsPage, SWT.SEPARATOR | SWT.HORIZONTAL);
	horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1));
	horizontalLine.setFont(settingsPage.getFont());
}
 
Example 17
Source File: CheckBoxToolTip.java    From hop with Apache License 2.0 4 votes vote down vote up
protected Composite createToolTipContentArea( Event event, Composite parent ) {
  Composite composite = new Composite( parent, SWT.NONE );
  FormLayout compLayout = new FormLayout();
  compLayout.marginHeight = 5;
  compLayout.marginWidth = 5;
  composite.setLayout( compLayout );

  composite.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) );

  Label imageLabel = new Label( composite, SWT.NONE );
  imageLabel.setImage( image );
  imageLabel.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) );
  FormData fdImageLabel = new FormData();
  fdImageLabel.left = new FormAttachment( 0, 0 );
  fdImageLabel.top = new FormAttachment( 0, 0 );
  imageLabel.setLayoutData( fdImageLabel );

  Label titleLabel = new Label( composite, SWT.LEFT );
  titleLabel.setText( title );
  titleLabel.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) );
  titleLabel.setFont( GuiResource.getInstance().getFontBold() );
  FormData fdTitleLabel = new FormData();
  fdTitleLabel.left = new FormAttachment( imageLabel, 20 );
  fdTitleLabel.top = new FormAttachment( 0, 0 );
  titleLabel.setLayoutData( fdTitleLabel );

  Label line = new Label( composite, SWT.SEPARATOR | SWT.HORIZONTAL );
  line.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) );
  FormData fdLine = new FormData();
  fdLine.left = new FormAttachment( imageLabel, 5 );
  fdLine.right = new FormAttachment( 100, -5 );
  fdLine.top = new FormAttachment( titleLabel, 5 );
  line.setLayoutData( fdLine );

  // Text messageLabel = new Text(composite, SWT.LEFT | ( showingScrollBars ? SWT.H_SCROLL | SWT.V_SCROLL : SWT.NONE )
  // );
  /*
   * Text messageLabel = new Text(composite, SWT.SINGLE | SWT.LEFT); messageLabel.setText(message);
   * messageLabel.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND)); FormData fdMessageLabel = new
   * FormData(); fdMessageLabel.left = new FormAttachment(imageLabel, 20); fdMessageLabel.top = new
   * FormAttachment(line, 5); if (showingScrollBars) { fdMessageLabel.right = new FormAttachment(imageLabel, 500);
   * fdMessageLabel.bottom= new FormAttachment(line, 400); } messageLabel.setLayoutData(fdMessageLabel);
   */
  Label messageLabel = new Label( composite, SWT.LEFT );
  messageLabel.setText( message );
  messageLabel.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) );
  FormData fdMessageLabel = new FormData();
  fdMessageLabel.left = new FormAttachment( imageLabel, 20 );
  fdMessageLabel.top = new FormAttachment( line, 5 );
  messageLabel.setLayoutData( fdMessageLabel );

  final Button disable = new Button( composite, SWT.CHECK );
  disable.setText( checkBoxMessage );
  disable.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) );
  disable.setSelection( false );
  FormData fdDisable = new FormData();
  fdDisable.left = new FormAttachment( 0, 0 );
  fdDisable.top = new FormAttachment( messageLabel, 20 );
  fdDisable.bottom = new FormAttachment( 100, 0 );
  disable.setLayoutData( fdDisable );
  disable.addSelectionListener( new SelectionAdapter() {

    public void widgetSelected( SelectionEvent e ) {
      for ( ICheckBoxToolTipListener listener : listeners ) {
        listener.checkBoxSelected( false );
      }
      hide();
    }

  } );
  disable.addPaintListener( new PaintListener() {

    public void paintControl( PaintEvent arg0 ) {
      checkBoxBounds = disable.getBounds();
    }

  } );

  composite.layout();
  checkBoxBounds = disable.getBounds();

  return composite;
}
 
Example 18
Source File: IntersectorDesign.java    From ldparteditor with MIT License 4 votes vote down vote up
/**
 * Create contents of the dialog.
 *
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
    Composite cmp_container = (Composite) super.createDialogArea(parent);
    GridLayout gridLayout = (GridLayout) cmp_container.getLayout();
    gridLayout.verticalSpacing = 10;
    gridLayout.horizontalSpacing = 10;

    Label lbl_specify = new Label(cmp_container, SWT.NONE);
    lbl_specify.setText(I18n.INTERSECTOR_Title);

    Label lbl_separator = new Label(cmp_container, SWT.SEPARATOR | SWT.HORIZONTAL);
    lbl_separator.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));

    Label lbl_description = new Label(cmp_container, SWT.NONE);
    lbl_description.setText(I18n.INTERSECTOR_Description);
    
    NButton btn_hideOther = new NButton(cmp_container, SWT.CHECK);
    this.btn_hideOther[0] = btn_hideOther;
    btn_hideOther.setText(I18n.INTERSECTOR_HideOther);
    btn_hideOther.setSelection(ins.isHidingOther());
    
    Combo cmb_scope = new Combo(cmp_container, SWT.READ_ONLY);
    this.cmb_scope[0] = cmb_scope;
    cmb_scope.setItems(new String[] {I18n.INTERSECTOR_ScopeFile, I18n.INTERSECTOR_ScopeSelection});
    cmb_scope.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    cmb_scope.setText(cmb_scope.getItem(ins.getScope()));
    cmb_scope.select(ins.getScope());
    cmb_scope.setEnabled(false);

    {
        Combo cmb_colourise = new Combo(cmp_container, SWT.READ_ONLY);
        this.cmb_colourise[0] = cmb_colourise;
        cmb_colourise.setItems(new String[] {I18n.INTERSECTOR_NoMods, I18n.INTERSECTOR_ColourMods});
        cmb_colourise.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
        cmb_colourise.setText(cmb_colourise.getItem(ins.isColourise() ? 1 : 0));
        cmb_colourise.select(ins.isColourise() ? 1 : 0);
    }

    cmp_container.pack();
    return cmp_container;
}
 
Example 19
Source File: BonitaAppearancePreferencePage.java    From bonita-studio with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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() {

    createTitleBar(Messages.BonitaPreferenceDialog_appearance, Pics.getImage(PicsConstants.preferenceAppearance), false);

    final Label coolBarLabel = new Label(getFieldEditorParent(), SWT.NONE);
    coolBarLabel.setText(Messages.defaultCoolbarAppearance);

    final Composite radioComposite = new Composite(getFieldEditorParent(), SWT.NONE);
    radioComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());

    radioFiled = new RadioGroupFieldEditor(BonitaCoolBarPreferenceConstant.COOLBAR_DEFAULT_SIZE, "", 3, new String[][] {
            { Messages.normal, BonitaCoolBarPreferenceConstant.NORMAL },
            { Messages.small, BonitaCoolBarPreferenceConstant.SMALL } }, radioComposite);

    radioComposite.setLayout(new GridLayout(3, false));
    radioFiled.getLabelControl(radioComposite).dispose();
    radioFiled.getRadioBoxControl(radioComposite).setLayoutData(GridDataFactory.fillDefaults().create());

    addField(radioFiled);

    new Label(getFieldEditorParent(), SWT.NONE);
    new Label(getFieldEditorParent(), SWT.NONE);

    final Label separator = new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL);
    separator.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(2, 1).create());

    new Label(getFieldEditorParent(), SWT.NONE);
    new Label(getFieldEditorParent(), SWT.NONE);

    createPreferenceEditorContributions(APPEARANCE_CONTRIBUTOR_ID);

}
 
Example 20
Source File: DropDownAction.java    From n4js with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Creates a new separator by hooking it into the given {@code parent} menu argument.
 *
 * @param parent
 *            the parent menu.
 * @return the new separator instance.
 */
protected MenuItem createSeparator(final Menu parent) {
	return new MenuItem(parent, SWT.SEPARATOR);
}