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 ); }
public void createControl ( final Composite parent ) { this.wrapper = new Composite ( parent, SWT.NONE ); this.wrapper.setLayout ( GridLayoutFactory.slimStack () ); final Composite extensionSpace = new Composite ( this.wrapper, SWT.NONE ); extensionSpace.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, false ) ); extensionSpace.setLayout ( new RowLayout ( SWT.HORIZONTAL ) ); this.chartArea = new ChartArea ( this.wrapper, SWT.NONE ); this.chartArea.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true ) ); this.viewer = new ChartViewer ( this.chartArea.getDisplay (), this.chartArea.getChartRenderer (), this.configuration, new CompositeExtensionSpace ( extensionSpace ), null ); parent.addDisposeListener ( new DisposeListener () { @Override public void widgetDisposed ( final DisposeEvent e ) { handleDispose (); } } ); }
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 () ); }
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 ); } } ); }
@Override protected void createParentControls(Composite composite) { Label label = new Label(composite, SWT.WRAP); label.setText("Preference scope:"); Composite group = new Composite(composite, SWT.NONE); group.setLayout(new RowLayout()); for (int i = 0; i < SCOPE_LABELS.length; i++) { Button btn = new Button(group, SWT.RADIO); btn.setText(SCOPE_LABELS[i]); btn.setData(SCOPE_VALUES[i]); if (SCOPE_VALUES[i].equals(scope) || (scope.isEmpty() && i == 0)) { btn.setSelection(true); } scopeRadios[i] = btn; } super.createParentControls(composite); }
protected Control createDialogArea(Composite parent) { Composite area = (Composite) super.createDialogArea(parent); Composite container = new Composite(area, SWT.NONE); RowLayout layout = new RowLayout(SWT.HORIZONTAL); container.setLayout(layout); // container.setLayoutData(new GridData(GridData.FILL_BOTH)); // TitleArea中的Title setTitle("属性文件更新"); // TitleArea中的Message setMessage("输入正确的url地址,以更新文件。\n可提示的属性数量会根据当前项目存在的jar包,对已有属性增加或者删除!"); Label label = new Label(container, SWT.NONE); label.setText("项目URL: "); combo = new Combo(container, SWT.DROP_DOWN); String[] items = new String[getUrlMap().size()]; getUrlMap().values().toArray(items); combo.setItems(items); String url = getPreferedUrl(projectName); combo.setText(url); combo.setLayoutData(new RowData(400, 30)); return area; }
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); }
@Override public void createControl(Composite parent) { Preconditions.checkNotNull(libraryGroups, "Library groups must be set"); //$NON-NLS-1$ Composite composite = new Group(parent, SWT.NONE); IProjectFacetVersion facetVersion = AppEngineStandardFacet.getProjectFacetVersion(project.getProject()); boolean java7AppEngineStandardProject = AppEngineStandardFacet.JRE7.equals(facetVersion); // create the library selector libraryGroups for (Entry<String, String> group : libraryGroups.entrySet()) { LibrarySelectorGroup librariesSelector = new LibrarySelectorGroup(composite, group.getKey(), group.getValue(), java7AppEngineStandardProject); librariesSelectors.add(librariesSelector); } setSelectedLibraries(initialSelection); composite.setLayout(new RowLayout(SWT.HORIZONTAL)); setControl(composite); }
private void createModuleTypeRadioGroup(Composite container) { moduleTypeGroup = new Group(container, SWT.SHADOW_IN); moduleTypeGroup.setText("Module type"); moduleTypeGroup.setLayout(new RowLayout(SWT.HORIZONTAL)); UefiApplicationRadioBtn = new Button(moduleTypeGroup, SWT.RADIO); UefiApplicationRadioBtn.setText("UEFI Application"); UefiStdLibApplicationRadioBtn = new Button(moduleTypeGroup, SWT.RADIO); UefiStdLibApplicationRadioBtn.setText("UEFI StdLib Application"); UefiDriverApplicationRadioBtn = new Button(moduleTypeGroup, SWT.RADIO); UefiDriverApplicationRadioBtn.setText("UEFI Driver"); UefiLibraryRadioBtn = new Button(moduleTypeGroup, SWT.RADIO); UefiLibraryRadioBtn.setText("UEFI Library"); UefiApplicationRadioBtn.setData(Edk2ModuleType.UEFI_APPLICATION); UefiStdLibApplicationRadioBtn.setData(Edk2ModuleType.UEFI_STDLIB_APPLICATION); UefiDriverApplicationRadioBtn.setData(Edk2ModuleType.UEFI_DRIVER); UefiLibraryRadioBtn.setData(Edk2ModuleType.LIBRARY_CLASS_IMPLEMENTATION); UefiApplicationRadioBtn.setSelection(true); }
private void initGUI() { try { RowLayout thisLayout = new RowLayout(org.eclipse.swt.SWT.HORIZONTAL); thisLayout.pack = false; thisLayout.justify = true; thisLayout.fill = true; this.setLayout(thisLayout); jLabel1 = new CLabel(this, SWT.NONE); jLabel1.setText("Flower:"); jLabel2 = new CLabel(this, SWT.NONE); jLabel2.setText("(Family)"); flowerLabel = new CLabel(this, SWT.NONE); flowerLabel.setText("$NAME$"); jLabel3 = new CLabel(this, SWT.NONE); jLabel3.setText("Quantity:"); quantityTextField = new Text(this, SWT.NONE); } catch (Exception e) { e.printStackTrace(); } }
/** * 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); }
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(); } }); }
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(); } }); }
/** * @see eclox.ui.editor.editors.IEditor#createContent(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit) */ public void createContent(Composite parent, FormToolkit formToolkit) { // Initialize the parent control. RowLayout layout = new RowLayout(SWT.VERTICAL); layout.marginWidth = 0; parent.setLayout(layout); // Creates the buttons. yesButton = formToolkit.createButton(parent, "Yes", SWT.RADIO); noButton = formToolkit.createButton(parent, "No", SWT.RADIO); defaultButton = formToolkit.createButton(parent, "Default", SWT.RADIO); // Attaches a selection listener instance to each button. yesButton.addSelectionListener(new MySelectionListener()); noButton.addSelectionListener(new MySelectionListener()); defaultButton.addSelectionListener(new MySelectionListener()); }
/** * Creates a row layout with default values * @param isHorziontal If true the layout will be horizontal, otherwise * vertical. * @return A new RowLayout object. */ public static RowLayout createRowLayout( boolean isHorziontal ) { RowLayout layout = new RowLayout(); layout.wrap = false; layout.pack = true; layout.justify = false; layout.spacing = 0; layout.fill = true; if( isHorziontal ) { layout.type = SWT.HORIZONTAL; } else { layout.type = SWT.VERTICAL; } return layout; }
protected Control createPluginsTabButtons(Composite parent) { Composite container = new Composite(parent, SWT.NONE); container.setLayout(new RowLayout(SWT.HORIZONTAL)); translatePluginButton = new Button(container, SWT.PUSH); languageSet.associate(translatePluginButton, Messages.LocalizeDialog_Command_Translate); translatePluginButton.setEnabled(false); translatePluginButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { IStructuredSelection selection = (IStructuredSelection)pluginTableViewer.getSelection(); AboutBundleData selected = (AboutBundleData) selection.getFirstElement(); PluginLocalizationDialog dialog = new PluginLocalizationDialog(getShell(), selected, targetLanguageSet); dialog.open(); } }); return container; }
private void addServer(Composite parent, final IServerMonitor server) { final Composite composite = new Composite(parent, SWT.NONE); RowLayout layout = new RowLayout(); layout.marginTop = 0; layout.marginBottom = 0; layout.marginLeft = 2; layout.marginRight = 2; composite.setLayout(layout); final Label icon = new Label(composite, SWT.CENTER); final Label text = new Label(composite, SWT.CENTER); text.setText(server.getShortName()); updateStatusIconAndTooltip(server, composite, icon, text); composite.addMouseTrackListener(new CompositeMouseTrackListener(text, icon, server, composite)); composite.addMouseListener(new CompositeMouseListener(text, icon, server, composite)); server.addListener(new CompositeServerMonitorListener(text, icon, server, composite)); final String host = server.getHost(); final int port = server.getPort(); final Option<IServerStatusWidgetListenerProvider> provider = widgetListenerProviders._1().find(matches(host, port)); if (provider.isSome()) { final MouseListener mouseListener = provider.some().getMouseListener(); composite.addMouseListener(mouseListener); icon.addMouseListener(mouseListener); text.addMouseListener(mouseListener); } }
public static Section createCategorySection(FormToolkit toolkit, Composite parent, String category, Image icon, boolean hasTwistie) { if (EMFDetailUtils.isCategoryHeaderHidden(category)) { category = null; } Section categorySection = DetailFormToolkit.createSection(toolkit, parent, category, icon, hasTwistie); categorySection.clientVerticalSpacing = 0; if ((parent.getLayout() instanceof RowLayout) || (parent.getLayout() instanceof ColumnLayout)) { categorySection.setLayoutData(null); } Composite categorySubSection = toolkit.createComposite(categorySection); GridLayout layout = new GridLayout(2, false); layout.marginHeight = 3; layout.verticalSpacing = 2; layout.horizontalSpacing = 10; categorySubSection.setLayout(layout); categorySection.setClient(categorySubSection); return categorySection; }
private void createNavigation(Composite parent) { Label label = new Label(parent, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.operatenavigation")); RowLayout layout = new RowLayout(); Composite comp = new Composite(parent, SWT.NONE); comp.setLayout(layout); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.inputlicenseid")); label.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE)); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.seperate")); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.getactivekey")); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.seperate")); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.getgrantfile")); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.seperate")); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.activefinish")); }
private void createNavigation(Composite parent) { Label label = new Label(parent, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.operatenavigation")); RowLayout layout = new RowLayout(); Composite comp = new Composite(parent, SWT.NONE); comp.setLayout(layout); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.inputlicenseid")); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.seperate")); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.getactivekey")); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.seperate")); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.getgrantfile")); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.seperate")); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.activefinish")); label.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE)); }
private void createNavigation(Composite parent) { Label label = new Label(parent, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.operatenavigation")); RowLayout layout = new RowLayout(); Composite comp = new Composite(parent, SWT.NONE); comp.setLayout(layout); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.inputlicenseid")); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.seperate")); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.getactivekey")); label.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE)); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.seperate")); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.getgrantfile")); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.seperate")); label = new Label(comp, SWT.NONE); label.setText(Messages.getString("license.OfflineActiveDialog.activefinish")); }
public Composite createContents(Composite parent) { area = new Composite(parent, SWT.NO_SCROLL); RowLayout layout = new RowLayout(); layout.type = SWT.VERTICAL; area.setLayout(layout); WidgetHelper.trim(area, 0); WidgetHelper.setSpacing(area, 0); WidgetHelper.setMargin(area, 0, 0); // create row for each option rows = new ArrayList<Composite>(); for (Option o : transpiler.getOptions().values()) { rows.add(createRow(area, o)); } return area; }
/** * Copies the given RowLayout instance * * @param layout * layout to copy * @return a new RowLayout */ public static RowLayout copyLayout(RowLayout layout) { RowLayout result = new RowLayout(layout.type); result.marginBottom = layout.marginBottom; result.marginTop = layout.marginTop; result.marginLeft = layout.marginLeft; result.marginRight = layout.marginRight; result.marginHeight = layout.marginHeight; result.marginWidth = layout.marginWidth; result.fill = layout.fill; result.justify = layout.justify; result.pack = layout.pack; result.spacing = layout.spacing; result.wrap = layout.wrap; result.type = layout.type; return result; }
/** * Creates the window's contents * * @param shell * the parent shell */ private void createContents(Shell shell) { shell.setLayout(new GridLayout(1, true)); // Create the buttons to create tabs Composite composite = new Composite(shell, SWT.NONE); composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); composite.setLayout(new RowLayout()); // Create the tabs tabFolder = new CTabFolder(shell, SWT.TOP); tabFolder.setBorderVisible(true); tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH)); CTabItem item1 = new CTabItem(tabFolder, SWT.NONE); item1.setText("Tab-1"); Group group = new Group(tabFolder, SWT.NONE); group.setText("Knob-1"); group.setLayout(new FillLayout()); item1.setControl(group); // Create Knob new Knob<Integer>(group, SWT.NULL, new KnobRange.Integer(0, 10)); }
/** * */ protected void createToolBar() { CoolBar bar = new CoolBar(shell, SWT.FLAT); bar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); bar.setLayout(new RowLayout()); CoolItem item = new CoolItem(bar, SWT.NONE); Button button = new Button(bar, SWT.FLAT); // button.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, true)); button.setText("Button"); Point size = button.computeSize(SWT.DEFAULT, SWT.DEFAULT); item.setPreferredSize(item.computeSize(size.x, size.y)); item.setControl(button); Rectangle clientArea = shell.getClientArea(); bar.setLocation(clientArea.x, clientArea.y); bar.pack(); }
private void createExtensionsGroup(Composite container, boolean editSupport) { Group grpConfiguredComponents = new Group(container, SWT.NONE); grpConfiguredComponents.setText("configured components"); grpConfiguredComponents.setLayout(WidgetUtils.createGridLayout(2)); extensionsViewer = createViewerControl(grpConfiguredComponents, editSupport); viewerControl = extensionsViewer.getControl(); Composite buttonComp = new Composite(grpConfiguredComponents, SWT.NONE); buttonComp.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false)); RowLayout buttonCompLayout = new RowLayout(SWT.VERTICAL); buttonCompLayout.fill = true; buttonCompLayout.center = true; buttonCompLayout.pack = false; buttonCompLayout.spacing = WidgetUtils.DEFAULT_VERTICAL_SPACING; buttonComp.setLayout(buttonCompLayout); createButtons(buttonComp, editSupport); }
private void addControls(Composite localParent, int style) { horizontalEmailPanel = new Composite(localParent, style); horizontalEmailPanelLayout = new RowLayout(); horizontalEmailPanelLayout.type = SWT.HORIZONTAL; horizontalEmailPanel.setLayout(horizontalEmailPanelLayout); loginEmailLabel = new Label(horizontalEmailPanel, SWT.NONE); loginEmailLabel.setText(stringResources.getLoginEmailLabelText()); emailTextField = new Text(horizontalEmailPanel, SWT.BORDER); //emailTextField.setText(); horizontalKeyPanel = new Composite(localParent, style); horizontalKeyPanelLayout = new RowLayout(); horizontalKeyPanelLayout.type = SWT.HORIZONTAL; horizontalKeyPanel.setLayout(horizontalKeyPanelLayout); loginKeyLabel = new Label(horizontalKeyPanel, SWT.NONE); loginKeyLabel.setText(stringResources.getLoginKeyLabelText()); keyTextField = new Text(horizontalKeyPanel, SWT.BORDER); //keyTextField.setText(); }
private Composite createFooter ( final Composite parent ) { final Composite footer = new Composite ( parent, SWT.NONE ); footer.setLayout ( new RowLayout () ); footer.setData ( RWT.CUSTOM_VARIANT, "footer" ); footer.setBackgroundMode ( SWT.INHERIT_DEFAULT ); final Label label = new Label ( footer, SWT.NONE ); label.setText ( System.getProperty ( Properties.FOOTER_TEXT, "Eclipse SCADA Admin Console" ) ); return footer; }
private void createAllEntries () { final Composite extensionSpace = this.extensionSpaceProvider.getExtensionSpace (); if ( extensionSpace == null ) { return; } this.wrapper = new Composite ( extensionSpace, SWT.NONE ); final RowLayout layout = new RowLayout ( SWT.HORIZONTAL ); layout.marginTop = layout.marginBottom = 0; this.wrapper.setLayout ( layout ); int i = 0; for ( final Profile profile : this.profiles ) { final ProfileEntry entry = createProfileEntry ( profile, i ); if ( entry != null ) { this.profileEntries.put ( profile.getId (), entry ); } i++; } final Label sep = new Label ( this.wrapper, SWT.SEPARATOR | SWT.VERTICAL ); sep.setLayoutData ( new RowData ( SWT.DEFAULT, 20 ) ); extensionSpace.layout (); }
protected void createView ( final Chart configuration ) { final Composite extensionSpace = new Composite ( this.wrapper, SWT.NONE ); extensionSpace.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, false ) ); extensionSpace.setLayout ( new RowLayout ( SWT.HORIZONTAL ) ); this.chartArea = new ChartArea ( this.wrapper, SWT.NONE ); this.chartArea.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true ) ); this.viewer = new ChartViewer ( this.chartArea.getDisplay (), this.chartArea.getChartRenderer (), configuration, new CompositeExtensionSpace ( extensionSpace ), null ); getSite ().setSelectionProvider ( this.viewer ); getSite ().getWorkbenchWindow ().getSelectionService ().addPostSelectionListener ( new ISelectionListener () { @Override public void selectionChanged ( final IWorkbenchPart part, final ISelection selection ) { final ChartInput sel = SelectionHelper.first ( selection, ChartInput.class ); if ( sel == null ) { AbstractChartView.this.viewer.setSelection ( (ChartInput)null ); } else { AbstractChartView.this.viewer.setSelection ( sel ); } // else: don't select anything which we do not care about } } ); }
public AddAssertionComposite ( final OrCondition orCondition, final Composite parent ) { // fields super ( parent, SWT.NONE ); this.orCondition = orCondition; // widgets this.attributeCombo = createAttributeCombo (); createTypeCombo (); createAddButton (); // layout final RowLayout layout = new RowLayout (); this.setLayout ( layout ); }
@Override protected void activateView () { if ( this.chart != null ) { return; } this.wrapper = new SashForm ( this.viewHolder, SWT.HORIZONTAL ); this.wrapper.setLayout ( new FillLayout ( SWT.HORIZONTAL ) ); final Composite subWrapper = new Composite ( this.wrapper, SWT.NONE ); subWrapper.setLayout ( GridLayoutFactory.slimStack () ); final Composite extensionSpace = new Composite ( subWrapper, SWT.NONE ); extensionSpace.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, false ) ); extensionSpace.setLayout ( new RowLayout ( SWT.HORIZONTAL ) ); this.chartArea = new ChartArea ( subWrapper, SWT.NONE ); this.chartArea.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true ) ); this.configuration = ChartHelper.loadConfiguraton ( this.descriptor.getUri ().toString () ); this.chart = new ChartViewer ( this.chartArea.getDisplay (), this.chartArea.getChartRenderer (), this.configuration, new CompositeExtensionSpace ( extensionSpace ), new ResetHandler () { @Override public void reset () { reload (); } } ); if ( this.showSelector ) { this.selector = new ChartInputSelector ( this.wrapper, this.chart, true ); this.wrapper.setWeights ( new int[] { 85, 15 } ); } this.viewManagerContext.setSelectionProvider ( this.chart ); this.chart.setFocus (); }
/** * Get the client space and create if it does not yet exists. * <p> * Note that if the client space is not filled, the default size of the * empty composite will be 64x64 due to some strange SWT philosophy. * </p> * * @return The client space composite */ public Composite getClientSpace () { if ( this.clientSpace == null ) { this.clientSpace = new Composite ( this, SWT.NONE ); this.clientSpace.setLayout ( new RowLayout ( SWT.HORIZONTAL ) ); } return this.clientSpace; }
public ValueComposite ( final Composite parent, final int style, final DataItemDescriptor descriptor, final String format, final String decimal, final boolean isText, final String attribute, final Boolean isDate, final String hdConnectionId, final String hdItemId, final String queryString ) { super ( parent, style, format, decimal, isText, attribute ); this.isDate = isDate; final RowLayout layout = new RowLayout (); layout.wrap = false; layout.center = true; layout.spacing = 7; layout.pack = true; setLayout ( layout ); this.controlImage = new ControlImage ( this, this.registrationManager ); Helper.createTrendButton ( this.controlImage, hdConnectionId, hdItemId, queryString ); this.dataLabel = new Label ( this, SWT.NONE ); final RowData rowData = new RowData ( 80, SWT.DEFAULT ); this.dataLabel.setAlignment ( SWT.RIGHT ); this.dataLabel.setLayoutData ( rowData ); this.dataLabel.setText ( "" ); //$NON-NLS-1$ new DescriptorLabel ( this, SWT.NONE, format, descriptor ); if ( descriptor != null ) { this.controlImage.setDetailItem ( descriptor.asItem () ); this.registrationManager.registerItem ( "value", descriptor.getItemId (), descriptor.getConnectionInformation (), false, false ); //$NON-NLS-1$ } }
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 ); }
/** * 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)); }