/** * Constructs a CheckBox with the passed text in its label. * * @param text * The label text * @since 2.0 */ public ColumnFigure(String text, Image image) { setLayoutManager(new FlowLayout(true)); checkbox = new CheckBox(); checkbox.addChangeListener(new ChangeListener() { @Override public void handleStateChanged(ChangeEvent event) { if (event.getPropertyName().equals(ButtonModel.SELECTED_PROPERTY)) handleSelectionChanged(); } }); add(checkbox); Label lbl = new Label(ConvertUtil.cleanDbNameFull(text), image); lbl.setTextPlacement(PositionConstants.WEST); add(lbl); }
private Figure makeHeader () { this.button = new CheckBox ( "Active" ); this.button.getModel ().addActionListener ( new ActionListener () { @Override public void actionPerformed ( final ActionEvent event ) { setEnabled ( RoundDetailsPart.this.button.getModel ().isSelected () ); } } ); return this.button; }
private Figure makeHeader () { this.button = new CheckBox ( Messages.BooleanAlarmDetails_active ); this.button.getModel ().addActionListener ( new ActionListener () { @Override public void actionPerformed ( final ActionEvent event ) { setEnabled ( BooleanAlarmDetails.this.button.getModel ().isSelected () ); } } ); return this.button; }
private Figure makeHeader () { this.button = new CheckBox ( "Active" ); this.button.getModel ().addActionListener ( new ActionListener () { @Override public void actionPerformed ( final ActionEvent event ) { setEnabled ( InputScaleDetails.this.button.getModel ().isSelected () ); } } ); return this.button; }
@Override public Control construct(Composite parent) { Composite content = new Composite(parent, SWT.NONE); GridDataFactory.fillDefaults().grab(true, true).applyTo(content); GridLayoutFactory.fillDefaults().applyTo(content); FigureCanvas canvas = new FigureCanvas(content); canvas.setContents(new CheckBox("Foo bar baz")); return content; }
@Override public Control construct(Composite parent) { Composite content = new Composite(parent, SWT.NONE); GridDataFactory.fillDefaults().grab(true, true).applyTo(content); Canvas cv = new Canvas(content, SWT.BORDER); GridDataFactory.fillDefaults().grab(true, false).hint(SWT.DEFAULT, 20).applyTo(cv); GridLayoutFactory.fillDefaults().applyTo(content); GraphicalViewer gv = new GraphicalViewerImpl() { @Override protected void createDefaultRoot() { setRootFigure(new CheckBox("Foo bar baz")); } }; gv.createControl(content); GridDataFactory.fillDefaults().grab(true, true).applyTo(gv.getControl()); GraphicalViewer gv2 = new ScrollingGraphicalViewer() { @Override protected void createDefaultRoot() { setRootFigure(new CheckBox("Foo2 bar2 baz2")); } }; gv2.createControl(content); GridDataFactory.fillDefaults().grab(true, true).applyTo(gv2.getControl()); return content; }
public IFigure createCheckbox() { return new CheckBox(); }