/** * Sets the background of the control and its content. * * @param bg * the new background color */ @Override public void setBackground(Color bg) { super.setBackground(bg); if (getContent() != null) getContent().setBackground(bg); }
/** * Sets the background of the control and its content. * * @param bg * the new background color */ @Override public void setBackground(Color bg) { super.setBackground(bg); if (getContent() != null) getContent().setBackground(bg); }
@Override public void createPartControl(Composite parent) { parent.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE)); parent.setLayout(new FillLayout(SWT.HORIZONTAL)); ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); scrolledComposite.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE)); scrolledComposite.setExpandHorizontal(true); scrolledComposite.setExpandVertical(true); scrolledComposite.setMinWidth(400); scrolledComposite.setMinHeight(400); Composite myViewParent = new Composite(scrolledComposite, SWT.NONE); myViewParent.setBackground(SWTResourceManager.getColor(SWT.COLOR_CYAN)); myViewParent.setLayout(null); Button btnNewButton = new Button(myViewParent, SWT.NONE); btnNewButton.setBounds(45, 237, 90, 30); btnNewButton.setText("New Button"); scrolledComposite.setContent(myViewParent); scrolledComposite.setMinSize(myViewParent.computeSize(SWT.DEFAULT, SWT.DEFAULT)); parent.setSize(600, 300);
public ClassifierEditor(final SwtFlowgrid flowgrid, Classifier classifier) { this.flowgrid = flowgrid; this.classifier = classifier; flowgrid.shell().setText(classifier.name() + " - FlowGrid"); flowgrid.shell().setLayout(new FillLayout()); GridLayout contentLayout = new GridLayout(4, true); contentLayout.marginHeight = 0; contentLayout.marginWidth = 0; flowgrid.shell().setLayout(contentLayout); propertyScrolledComposite = flowgrid.createVerticalScrolledComposite(flowgrid.shell()); propertyPanel = new Composite(propertyScrolledComposite, SWT.NONE); propertyPanel.setLayout(flowgrid.resourceManager.createGridLayout(1)); propertyScrolledComposite.setContent(propertyPanel); propertyScrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); operationScrolledComposite = flowgrid.createVerticalScrolledComposite(flowgrid.shell()); operationPanel = new Composite(operationScrolledComposite, SWT.NONE); operationPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1)); GridLayout operationLayout = new GridLayout(2, true); operationLayout.marginHeight = 0; operationLayout.marginWidth = 0; operationPanel.setLayout(operationLayout); operationScrolledComposite.setContent(operationPanel); operationScrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1)); operationScrolledComposite.setBackground(flowgrid.resourceManager.background); refresh(); // contentPanel.layout(true, true); //flowgrid.shell().layout(true, true); }
scrollComposite = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.BORDER); scrollComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); scrollComposite.setBackground(toolkit.getColors().getBackground());
scrolledComposite.setExpandHorizontal(true); scrolledComposite.setExpandVertical(true); scrolledComposite.setBackground(display.getSystemColor(SWT.COLOR_CYAN)); final List list = new List(scrolledComposite, SWT.NONE); list.setEnabled(false);
scrolledComposite.setBackground(scrolledComposite.getParent().getBackground()); scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); scrolledComposite.setExpandHorizontal(true);