org.eclipse.swt.layout.RowLayout Java Examples

The following examples show how to use org.eclipse.swt.layout.RowLayout. 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: CommitSetDialog.java    From APICloud-Studio with GNU General Public License v3.0 7 votes vote down vote up
private void createOptionsArea(Composite composite) {
Composite radioArea = new Composite(composite, SWT.NONE);
RowLayout radioAreaLayout = new RowLayout(SWT.VERTICAL);
radioAreaLayout.marginLeft = 0;
radioAreaLayout.marginRight = 0;
radioAreaLayout.marginTop = 0;
radioAreaLayout.marginBottom = 0;
radioArea.setLayout(radioAreaLayout);

      useTitleButton = createRadioButton(radioArea, Policy.bind("CommitSetDialog_2")); 
      enterCommentButton = createRadioButton(radioArea, Policy.bind("CommitSetDialog_3")); 
      SelectionAdapter listener = new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
              updateEnablements();
          }
      };
      useTitleButton.addSelectionListener(listener);
      enterCommentButton.addSelectionListener(listener);
      
  }
 
Example #2
Source File: GenericResourceSaveControl.java    From depan with Apache License 2.0 6 votes vote down vote up
public GenericResourceSaveControl(Composite parent, SaveLoadConfig<T> config) {
  super(parent, SWT.NONE);
  this.config = config; 

  setLayout(new RowLayout());

  Button saveButton = new Button(this, SWT.PUSH);
  saveButton.setText(config.getSaveLabel());
  saveButton.setLayoutData(new RowData());

  saveButton.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent e) {
      handleSave();
    }
  });

}
 
Example #3
Source File: CogniCryptPreferencePage.java    From CogniCrypt with Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	final Composite container = new Composite(parent, SWT.FILL);
	container.setLayout(new GridLayout(1, true));
	notifyBasicPreferenceListeners(container);

	new Label(container, SWT.NONE);
	final ExpandableComposite collap = new ExpandableComposite(container, SWT.Collapse);
	collap.setText("Advanced Options");

	final Composite advancedOptions = new Composite(collap, SWT.None);
	collap.setClient(advancedOptions);
	advancedOptions.setLayout(new RowLayout(SWT.VERTICAL));
	notifyAdvancedPreferenceListeners(advancedOptions);

	collap.setExpanded(true);
	return container;
}
 
Example #4
Source File: GeneratorView.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
private void createHeader ( final Composite parent )
{
    this.header = new Composite ( parent, SWT.NONE );
    this.header.setLayoutData ( new GridData ( GridData.BEGINNING, GridData.BEGINNING, true, false ) );
    this.header.setLayout ( new RowLayout () );

    this.startButton = new Button ( this.header, SWT.TOGGLE );
    this.startButton.setText ( Messages.getString ( "GeneratorView.ButtonGo" ) );
    this.startButton.addSelectionListener ( new SelectionAdapter () {
        @Override
        public void widgetSelected ( final SelectionEvent e )
        {
            GeneratorView.this.toggleButton ( GeneratorView.this.startButton.getSelection () );
        }
    } );

    this.errorLabel = new Label ( this.header, SWT.NONE );
}
 
Example #5
Source File: GalleryExampleTab.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
private void createAnimationGroup(Composite parent) {
	Group animationGroup = createEmptyGroup(parent, "Animation");
	animationGroup.setLayout(new RowLayout());

	bAnimation = createButton(animationGroup, SWT.CHECK, "Animations", false, false);
	bAnimation.addListener(SWT.Selection, groupParamSelectionListener);

	cAnimationMovement = new Combo(animationGroup, SWT.READ_ONLY);
	cAnimationMovement.setItems(new String[] { "ExpoOut", "BounceOut", "ElasticOut", "LinearInOut" });
	cAnimationMovement.setText("ExpoOut");
	cAnimationMovement.addListener(SWT.Selection, groupParamSelectionListener);

	sAnimationDuration = new Spinner(animationGroup, SWT.NONE);
	sAnimationDuration.setMinimum(250);
	sAnimationDuration.setMaximum(5000);
	sAnimationDuration.setIncrement(100);
	sAnimationDuration.setSelection(500);
	sAnimationDuration.addListener(SWT.Selection, groupParamSelectionListener);
}
 
Example #6
Source File: LinkComposite.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
public LinkComposite ( final Composite parent, final int style, final String format )
{
    super ( parent, style );

    final RowLayout layout = new RowLayout ();
    layout.wrap = false;
    layout.center = true;
    layout.spacing = 7;
    layout.pack = true;
    setLayout ( layout );

    this.textLabel = new Link ( this, SWT.NONE );
    this.textLabel.setText ( format );

    this.textLabel.addSelectionListener ( new SelectionAdapter () {

        @Override
        public void widgetSelected ( final SelectionEvent event )
        {
            logger.info ( "LinkComponent selected: {}", event.text ); //$NON-NLS-1$
            Program.launch ( event.text );
        }
    } );
}
 
Example #7
Source File: GenericResourceLoadControl.java    From depan with Apache License 2.0 6 votes vote down vote up
public GenericResourceLoadControl(Composite parent, SaveLoadConfig<T> config) {
  super(parent, SWT.NONE);
  this.config = config;

  setLayout(new RowLayout());

  Button loadButton = new Button(this, SWT.PUSH);
  loadButton.setText(config.getLoadLabel());
  loadButton.setLayoutData(new RowData());

  loadButton.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent e) {
      handleLoad();
    }
  });
}
 
Example #8
Source File: GalleryExampleTab.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
private void createDecoratorsGroup(Composite parent) {
	Group dataGroup = createEmptyGroup(parent, "Decorators");
	dataGroup.setLayout(new RowLayout());

	sDecoratorNumber = new Spinner(dataGroup, SWT.NONE);
	sDecoratorNumber.setMinimum(1);
	sDecoratorNumber.setMaximum(5);
	sDecoratorNumber.setIncrement(1);
	sDecoratorNumber.setSelection(1);
	sDecoratorNumber.addListener(SWT.Selection, contentParamSelectionListener);

	bDecoratorLeft = createButton(dataGroup, SWT.CHECK, "Top Left", false, false);
	bDecoratorLeft.addListener(SWT.Selection, contentParamSelectionListener);
	bDecoratorUp = createButton(dataGroup, SWT.CHECK, "Top Right", false, false);
	bDecoratorUp.addListener(SWT.Selection, contentParamSelectionListener);
	bDecoratorRight = createButton(dataGroup, SWT.CHECK, "Bottom Right", false, false);
	bDecoratorRight.addListener(SWT.Selection, contentParamSelectionListener);
	bDecoratorDown = createButton(dataGroup, SWT.CHECK, "Bottom Left", false, false);
	bDecoratorDown.addListener(SWT.Selection, contentParamSelectionListener);
}
 
Example #9
Source File: GalleryExampleTab.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
private void createItemParametersGroup(Composite parent) {
	Group dataGroup = createEmptyGroup(parent, "Item parameters");
	dataGroup.setLayout(new RowLayout());

	cItemRenderer = new Combo(dataGroup, SWT.READ_ONLY);
	cItemRenderer.setItems(new String[] { "Icon", "List" });
	cItemRenderer.setText("Icon");
	cItemRenderer.addListener(SWT.Selection, itemRendererParamSelectionListener);

	bItemDropShadow = createButton(dataGroup, SWT.CHECK, "Drop shadow", false, true);

	sItemDropShadowSize = new Spinner(dataGroup, SWT.NONE);
	sItemDropShadowSize.setMinimum(0);
	sItemDropShadowSize.setMaximum(20);
	sItemDropShadowSize.setIncrement(1);
	sItemDropShadowSize.setSelection(5);
	sItemDropShadowSize.addListener(SWT.Selection, itemRendererParamSelectionListener);

	bItemLabel = createButton(dataGroup, SWT.CHECK, "Display labels", false, true);
}
 
Example #10
Source File: DrawableToolTip.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Creates a drawable tool tip instance.
 *
 * @param parent The parent composite.
 */
public DrawableToolTip(Composite parent) {
    fToolTipShell = new Shell(parent.getShell(), SWT.ON_TOP);
    fToolTipShell.setLayout(new RowLayout());
    fToolTipShell.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    fToolTipShell.addPaintListener(this);
    fToolTipShell.setSize(SHELL_WIDTH, SHELL_HEIGHT);
    fToolTipShell.addDisposeListener((e) -> {
        for (int i = 0; i < fColors.length; i++) {
            fColors[i].dispose();
        }
    });

    fColors = new Color[NUMBER_STEPS];
    int greenBlue = BASE_GREEN_BLUE_VALUE;
    final int step = COLOR_STEP;
    for (int i = 0; i < fColors.length; i++) {
        fColors[i] = new Color(Display.getDefault(), BASE_RED_VALUE, greenBlue, greenBlue);
        greenBlue -= step;
    }
}
 
Example #11
Source File: RelationCountFilterEditorControl.java    From depan with Apache License 2.0 6 votes vote down vote up
/**
 * Construct the {@code RangeTool} UI with the given set of options.
 * 
 * @param parent containing window for range tool
 * @param style basic presentation options
 */
public RangeTool(Composite parent, int style,
    String label, RelationCount.RangeData setup) {
  super(parent, style);

  setLayout(new RowLayout());

  Label rangeLabel = new Label(this, SWT.LEFT);
  rangeLabel.setText(label);

  rangeOp = createRangeOp(setup.option);
  loLabel = new Label(this, SWT.LEFT);
  loLimit = new Spinner(this, style);
  hiLabel = new Label(this, SWT.LEFT);
  hiLimit = new Spinner(this, style);
  setLimits(setup);
}
 
Example #12
Source File: FilterAdvancedComposite.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
public AssertionComposite ( final OrCondition orCondition, final Composite parent, final String attribute, final Type type )
{
    // final fields
    super ( parent, SWT.NONE );
    this.orCondition = orCondition;

    // widgets
    this.notCheck = createNotCheck ();
    this.attributeText = createAttributeText ( attribute );
    createFieldTypeLabel ( type );
    this.assertionCombo = createAssertionCombo ();
    this.valueText = createValueText ();
    createRemoveButton ();

    // layout
    final RowLayout layout = new RowLayout ();
    layout.center = true;
    this.setLayout ( layout );

    parent.notifyListeners ( SWT.Resize, new org.eclipse.swt.widgets.Event () );
}
 
Example #13
Source File: DateChooserComboExampleTab.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
private void createStyleGroup(Composite parent) {
		Group gp = new Group(parent, SWT.NONE);
		gp.setText("Style");
		gp.setLayout(new RowLayout());
		GridData data = new GridData(SWT.FILL, SWT.FILL, false, false);
//		data.horizontalSpan = 2;
		gp.setLayoutData(data);

		borderStyle = new Button(gp, SWT.CHECK);
		borderStyle.setText("SWT.BORDER");
		borderStyle.addListener(SWT.Selection, recreateListener);

		readOnlyStyle = new Button(gp, SWT.CHECK);
		readOnlyStyle.setText("SWT.READ_ONLY");
		readOnlyStyle.addListener(SWT.Selection, recreateListener);

		flatStyle = new Button(gp, SWT.CHECK);
		flatStyle.setText("SWT.FLAT");
		flatStyle.addListener(SWT.Selection, recreateListener);
	}
 
Example #14
Source File: DateChooserExampleTab.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
private void createStyleGroup(Composite parent) {
	Group gp = new Group(parent, SWT.NONE);
	gp.setText("Style");
	gp.setLayout(new RowLayout());
	GridData data = new GridData(SWT.FILL, SWT.FILL, false, false);
	data.horizontalSpan = 2;
	gp.setLayoutData(data);

	borderStyle = new Button(gp, SWT.CHECK);
	borderStyle.setText("SWT.BORDER");
	borderStyle.addListener(SWT.Selection, recreateListener);

	multiStyle = new Button(gp, SWT.CHECK);
	multiStyle.setText("SWT.MULTI");
	multiStyle.addListener(SWT.Selection, recreateListener);
}
 
Example #15
Source File: SearchDialog.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
private Composite createOptionsPanel(final Composite composite) {
	final Composite row = new Composite(composite, SWT.NONE);
	row.setLayout(new GridLayout(2,true));
	
	final Group directionGroup = new Group(row, SWT.SHADOW_ETCHED_IN);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(directionGroup);
	directionGroup.setText("Direction");
	final RowLayout rowLayout = new RowLayout(SWT.VERTICAL);
	rowLayout.marginHeight = rowLayout.marginWidth = 3;
	directionGroup.setLayout(rowLayout);
	forwardButton = new Button(directionGroup, SWT.RADIO);
	forwardButton.setText("F&orward");
	forwardButton.setSelection(true);
	final Button backwardButton = new Button(directionGroup, SWT.RADIO);
	backwardButton.setText("&Backward");

	final Group optionsGroup = new Group(row, SWT.SHADOW_ETCHED_IN);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(optionsGroup);
	optionsGroup.setText("Options");
	optionsGroup.setLayout(rowLayout);
	caseSensitiveButton = new Button(optionsGroup, SWT.CHECK);
	caseSensitiveButton.setText("&Case Sensitive");
	wrapSearchButton = new Button(optionsGroup, SWT.CHECK);
	wrapSearchButton.setText("&Wrap Search");
	wrapSearchButton.setSelection(true);
	
	return row;
}
 
Example #16
Source File: BorderThicknessPicker.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
public BorderThicknessPicker(Composite parent) {
    super(parent, NONE);
    setLayout(new RowLayout());

    combo = new Combo(this, SWT.READ_ONLY | SWT.DROP_DOWN);
    combo.setItems(new String[] { "Thin", "Thick", "Very Thick" });
    combo.select(0);
}
 
Example #17
Source File: NewAccessDialog.java    From thym with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Create contents of the dialog.
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
	getShell().setText("New Access");
	Composite container = (Composite) super.createDialogArea(parent);
	GridLayout gl_container = new GridLayout(2, false);
	gl_container.marginTop = 10;
	container.setLayout(gl_container);
	
	Label lblOrigin = new Label(container, SWT.NONE);
	lblOrigin.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	lblOrigin.setText("Origin:");
	
	txtOrigin = new Text(container, SWT.BORDER);
	txtOrigin.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	new Label(container, SWT.NONE);
	
	Composite composite = new Composite(container, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
	composite.setLayout(new RowLayout(SWT.VERTICAL));
	
	btnSubdomains = new Button(composite, SWT.CHECK);
	btnSubdomains.setText("Allow Subdomains");
	
	btnBrowserOnly = new Button(composite, SWT.CHECK);
	btnBrowserOnly.setText("Browser Only");

	return container;
}
 
Example #18
Source File: HorizontalAlignmentPicker.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
public HorizontalAlignmentPicker(Composite parent, HorizontalAlignmentEnum alignment) {
    super(parent, SWT.NONE);
    setLayout(new RowLayout());

    combo = new Combo(this, SWT.READ_ONLY | SWT.DROP_DOWN);
    combo.setItems(new String[] { "Center", "Left", "Right" });

    update(alignment);
}
 
Example #19
Source File: LineStylePicker.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
public LineStylePicker(Composite parent) {
    super(parent, NONE);
    setLayout(new RowLayout());
    
    combo = new Combo(this, SWT.READ_ONLY | SWT.DROP_DOWN);
    combo.setItems(new String[] { "Solid", "Dashed", "Dotted", "Dashdot", "Dashdotdot" });
    combo.select(0);
}
 
Example #20
Source File: CommonConfigurationAttributesPanel.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
private void createUnitsControls(Composite parent, String attr, String label) {
    DataNode dn = DCUtils.findDataNode(parent, true);
    Field unitsField = new UnitField(attr);
    Field numField   = new NumberField(attr);
    dn.addComputedField(numField);
    dn.addComputedField(unitsField);

    createLabel(label, null);

    Composite controlRow = new Composite(parent, SWT.NONE);
    RowLayout rl = new RowLayout();
    rl.marginBottom = rl.marginLeft = rl.marginRight = rl.marginTop = 0;
    rl.center = true;
    controlRow.setLayout(rl);
    GridData gd = createControlGDFill(1);
    controlRow.setLayoutData(gd);

    Composite save = getCurrentParent();
    setCurrentParent(controlRow);

    DCCompositeText text = createDCTextComputed(numField.getName(), new RowData(80, SWT.DEFAULT));
    MultiValidator mv = new MultiValidator();
    mv.add(new StrictNumberValidator(new Double(0), null));
    mv.add(new LengthValidator(0, 7)); // Allow 7 digits
    text.setValidator(mv);

    String[] codes  = { "px", "%" };  //$NON-NLS-1$
    String[] labels = { "Pixels", "Percent" }; // $NLX-CommonConfigurationAttributesPanel.Pixels-1$ $NLX-CommonConfigurationAttributesPanel.Percent-2$

    ILookup lookup = new StringLookup(codes, labels);
    createLabel("Units:", null); // $NLX-CommonConfigurationAttributesPanel.Units-1$
    DCCompositeCombo combo = createComboComputed(unitsField.getName(), lookup, null, true, false);

    unitsField.setControls(text, combo);
    numField.setControls(text, combo);
    setCurrentParent(save);
}
 
Example #21
Source File: CameraPositionGroup.java    From depan with Apache License 2.0 5 votes vote down vote up
public CameraPositionGroup(Composite parent) {
  super(parent, SWT.NONE);
  setLayout(new FillLayout(SWT.HORIZONTAL));

  Group group = new Group(this, SWT.NONE);
  group.setText("Camera Position");

  RowLayout row = new RowLayout(SWT.HORIZONTAL);
  row.marginTop = 0;
  row.marginBottom = 0;
  row.marginLeft = 0;
  row.marginRight = 0;
  row.justify = true;
  row.pack = false;
  group.setLayout(row);

  xposInput = new PositionInput(group, "X-Pos",
      "Left/Right");
  xposInput.setLayoutData(new RowData());
  xposInput.addModifyListener(INPUT_LISTENER);

  yposInput = new PositionInput(group, "Y-Pos",
      "Up/Down");
  yposInput.setLayoutData(new RowData());
  yposInput.addModifyListener(INPUT_LISTENER);

  zposInput = new PositionInput(group, "Z-Pos",
      "Page-Up/Page-Dn");
  zposInput.setLayoutData(new RowData());
  zposInput.setLimits((int) GLConstants.ZOOM_MAX, (int) (GLConstants.Z_FAR - 1));
  zposInput.addModifyListener(INPUT_LISTENER);
}
 
Example #22
Source File: Regression_139334_swt.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * main() method for constructing the layout.
 * 
 * @param args
 */
public static void main( String[] args )
{
	Display display = Display.getDefault( );
	Shell shell = new Shell( display );
	shell.setSize( 600, 400 );
	shell.setLayout( new GridLayout( ) );

	Regression_139334_swt siv = new Regression_139334_swt(
			shell,
			SWT.NO_BACKGROUND );
	siv.setLayoutData( new GridData( GridData.FILL_BOTH ) );
	siv.addPaintListener( siv );

	Composite cBottom = new Composite( shell, SWT.NONE );
	cBottom.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	cBottom.setLayout( new RowLayout( ) );

	Label la = new Label( cBottom, SWT.NONE );

	la.setText( "Choose: " );//$NON-NLS-1$
	cbType = new Combo( cBottom, SWT.DROP_DOWN | SWT.READ_ONLY );
	cbType.add( "Bar Chart" );
	cbType.select( 0 );

	btn = new Button( cBottom, SWT.NONE );
	btn.setText( "Update" );//$NON-NLS-1$
	btn.addSelectionListener( siv );

	shell.open( );
	while ( !shell.isDisposed( ) )
	{
		if ( !display.readAndDispatch( ) )
			display.sleep( );
	}
	display.dispose( );
}
 
Example #23
Source File: ViewFilterDialog.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
private static Composite createCLabelsArea(Composite container) {
    Composite labels = new Composite(container, SWT.NONE);
    GridData gd = new GridData(SWT.CENTER, SWT.CENTER, false, false);
    labels.setLayoutData(gd);
    RowLayout rl = new RowLayout(SWT.HORIZONTAL);
    rl.marginTop = 0;
    rl.marginBottom = 0;
    rl.marginLeft = 3;
    rl.marginRight = 0;
    labels.setLayout(rl);
    return labels;
}
 
Example #24
Source File: HorizontalAlignmentPicker.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
public HorizontalAlignmentPicker(Composite parent, HorizontalAlignmentEnum alignment) {
    super(parent, SWT.NONE);
    setLayout(new RowLayout());

    combo = new Combo(this, SWT.READ_ONLY | SWT.DROP_DOWN);
    combo.setItems(new String[] { "Center", "Left", "Right" });

    update(alignment);
}
 
Example #25
Source File: UiUtils.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
public static RowLayout removeMargins(RowLayout layout) {
  layout.marginBottom = 0;
  layout.marginHeight = 0;
  layout.marginLeft = 0;
  layout.marginRight = 0;
  layout.marginTop = 0;
  layout.marginWidth = 0;
  return layout;
}
 
Example #26
Source File: AbstractPopup.java    From workspacemechanic with Eclipse Public License 1.0 5 votes vote down vote up
private void initializeLayout(Composite widget) {
  RowLayout layout = new RowLayout();
  layout.type = SWT.VERTICAL;
  layout.marginTop = 5;
  layout.marginBottom = 5;
  layout.spacing = 5;
  layout.fill = true;
  widget.setLayout(layout);
}
 
Example #27
Source File: CurveFittingViewer.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * execute application
 * 
 * @param args
 */
public static void main( String[] args )
{
	Display display = Display.getDefault( );
	Shell shell = new Shell( display );
	shell.setSize( 600, 400 );
	shell.setLayout( new GridLayout( ) );

	CurveFittingViewer cfViewer = new CurveFittingViewer( shell,
			SWT.NO_BACKGROUND );
	cfViewer.setLayoutData( new GridData( GridData.FILL_BOTH ) );
	cfViewer.addPaintListener( cfViewer );

	Composite cBottom = new Composite( shell, SWT.NONE );
	cBottom.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	cBottom.setLayout( new RowLayout( ) );

	Label la = new Label( cBottom, SWT.NONE );

	la.setText( "&Choose: " );//$NON-NLS-1$
	cbType = new Combo( cBottom, SWT.DROP_DOWN | SWT.READ_ONLY );
	cbType.add( "Bar Chart" );//$NON-NLS-1$
	cbType.add( "Line Chart" );//$NON-NLS-1$
	cbType.add( "Stock Chart" );//$NON-NLS-1$
	cbType.add( "Area Chart" );//$NON-NLS-1$
	cbType.select( 0 );

	btn = new Button( cBottom, SWT.NONE );
	btn.setText( "&Update" );//$NON-NLS-1$
	btn.addSelectionListener( cfViewer );
	btn.setToolTipText( "Update" );//$NON-NLS-1$

	shell.open( );
	while ( !shell.isDisposed( ) )
	{
		if ( !display.readAndDispatch( ) )
			display.sleep( );
	}
	display.dispose( );
}
 
Example #28
Source File: DiskInfoTab.java    From AppleCommander with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create the DISK INFO tab.
 */
public DiskInfoTab(CTabFolder tabFolder, FormattedDisk[] disks) {
	this.formattedDisks = disks;
	
	CTabItem ctabitem = new CTabItem(tabFolder, SWT.NULL);
	ctabitem.setText(textBundle.get("DiskInfoTab.Title")); //$NON-NLS-1$
	
	tabFolder.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent event) {
			getInfoTable().removeAll();
			buildDiskInfoTable(getFormattedDisk(0));	// FIXME!
		}
	});
	
	ScrolledComposite scrolledComposite = new ScrolledComposite(
		tabFolder, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
	scrolledComposite.setExpandHorizontal(true);
	scrolledComposite.setExpandVertical(true);
	ctabitem.setControl(scrolledComposite);
	
	composite = new Composite(scrolledComposite, SWT.NONE);
	createDiskInfoTable();
	if (disks.length > 1) {
		RowLayout layout = new RowLayout(SWT.VERTICAL);
		layout.wrap = false;
		composite.setLayout(layout);
		for (int i=0; i<disks.length; i++) {
			Label label = new Label(composite, SWT.NULL);
			label.setText(disks[i].getDiskName());
			buildDiskInfoTable(disks[i]);
		}
	} else {
		composite.setLayout(new FillLayout());
		buildDiskInfoTable(disks[0]);
	}
	composite.pack();
	scrolledComposite.setContent(composite);
	scrolledComposite.setMinSize(
		composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
 
Example #29
Source File: Regression_118773_swt.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * main() method for constructing the layout.
 * 
 * @param args
 */
public static void main( String[] args )
{
	Display display = Display.getDefault( );
	Shell shell = new Shell( display );
	shell.setSize( 600, 400 );
	shell.setLayout( new GridLayout( ) );

	Regression_118773_swt siv = new Regression_118773_swt(
			shell,
			SWT.NO_BACKGROUND );
	siv.setLayoutData( new GridData( GridData.FILL_BOTH ) );
	siv.addPaintListener( siv );

	Composite cBottom = new Composite( shell, SWT.NONE );
	cBottom.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	cBottom.setLayout( new RowLayout( ) );

	Label la = new Label( cBottom, SWT.NONE );

	la.setText( "Choose: " );//$NON-NLS-1$
	cbType = new Combo( cBottom, SWT.DROP_DOWN | SWT.READ_ONLY );
	cbType.add( "Bar Chart" );
	cbType.select( 0 );

	btn = new Button( cBottom, SWT.NONE );
	btn.setText( "Update" );//$NON-NLS-1$
	btn.addSelectionListener( siv );

	shell.open( );
	while ( !shell.isDisposed( ) )
	{
		if ( !display.readAndDispatch( ) )
			display.sleep( );
	}
	display.dispose( );
}
 
Example #30
Source File: DataItemHeaderLabel.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
public DataItemHeaderLabel ( final Composite parent )
{
    super ( parent, SWT.NONE );
    setLayout ( new RowLayout ( SWT.HORIZONTAL ) );

    this.headerIcon = new Label ( this, SWT.NONE );
    this.headerLabel = new Label ( this, SWT.NONE );
    this.headerLabel.setText ( Messages.DataItemHeaderLabel_EmptyDataItem );

    this.headerValueLabel = new Label ( this, SWT.NONE );

    this.blinker = new StyleBlinker () {

        @Override
        public void update ( final CurrentStyle style )
        {
            handleStyleUpdate ( style );
        }
    };

    this.styler = new StateStyler ( this.blinker );

    addDisposeListener ( new DisposeListener () {

        @Override
        public void widgetDisposed ( final DisposeEvent e )
        {
            handleDispose ();
        }
    } );

    handleUpdateData ( null );
}