/** * Constructor. * * @param parent The parent {@link Composite}. * @param style The InfoBar {@link Composite#getStyle() style}. */ public InfoBar(Composite parent, int style) { super(parent, style); setVisible(false); FormLayout layout = new FormLayout(); layout.marginTop = 5; layout.marginBottom = 5; layout.marginLeft = 5; layout.marginRight = 5; layout.spacing = 5; setLayout(layout); Color backgroundColor = parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND); setBackground(backgroundColor); _Label = new Label(this, SWT.LEAD | SWT.WRAP); _Label.setBackground(backgroundColor); FormData labelFormData = new FormData(); labelFormData.top = new FormAttachment(0, 0); labelFormData.left = new FormAttachment(0, 0); _Label.setLayoutData(labelFormData); }
@Override protected void createContent() { FormToolkit toolkit = getToolkit(); _Text = toolkit.createText(this, "", SWT.BORDER | SWT.SINGLE); _Text.setFont(JFaceResources.getTextFont()); FormData formData = new FormData(); formData.top = new FormAttachment(0, 0); formData.left = new FormAttachment(0, 0); formData.right = new FormAttachment(100, 0); _Text.setLayoutData(formData); _Text.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { setDirtyInternal(true); } }); }
@Override protected void createModelFormContent(IManagedForm managedForm, Composite client) { FormToolkit toolkit = managedForm.getToolkit(); _ScrolledFormText = new ScrolledFormText(client, false); _ScrolledFormText.setExpandHorizontal(true); toolkit.adapt(_ScrolledFormText, false, false); _JmxDocFormText = toolkit.createFormText(_ScrolledFormText, true); _ScrolledFormText.setFormText(_JmxDocFormText); JmxDocFormText.initFormText(_JmxDocFormText); FormData scrolledFormTextFormData = new FormData(); scrolledFormTextFormData.top = new FormAttachment(0, 0); scrolledFormTextFormData.left = new FormAttachment(0, 0); scrolledFormTextFormData.right = new FormAttachment(100, 0); scrolledFormTextFormData.bottom = new FormAttachment(100, 0); _ScrolledFormText.setLayoutData(scrolledFormTextFormData); }
@Override protected Section createDetailSection(ScrolledForm form, Composite client, FormToolkit toolkit) { Section section = createSection(form, client, toolkit, DETAIL_SECTION_TITLE, JmxActivator .getManagedImage(JmxActivator.IMAGE_KEY_OBJECT_JMX_DOC)); Composite sectionClient = createSectionClient(section, toolkit); _JmxDocFormText = toolkit.createFormText(sectionClient, false); JmxDocFormText.initFormText(_JmxDocFormText); FormData jmxdocFormTextFormData = new FormData(); jmxdocFormTextFormData.top = new FormAttachment(0, 0); jmxdocFormTextFormData.left = new FormAttachment(0, 0); _JmxDocFormText.setLayoutData(jmxdocFormTextFormData); GridData detailSectionGridData = new GridData(GridData.FILL_HORIZONTAL); section.setLayoutData(detailSectionGridData); return section; }
private SWTSkinObjectContainer getGroupSO(String groupID) { String soID = "toolbar-group-" + groupID; SWTSkinObjectContainer soGroup = (SWTSkinObjectContainer) skin.getSkinObjectByID( soID, soMain); if (soGroup == null) { soGroup = (SWTSkinObjectContainer) skin.createSkinObject(soID, "toolbar.group", soMain); FormData fd = (FormData) soGroup.getControl().getLayoutData(); if (soLastGroup != null) { fd.left = new FormAttachment(soLastGroup.getControl(), 0, SWT.RIGHT); } else { fd.left = new FormAttachment(0, 2); } } soLastGroup = soGroup; return soGroup; }
@Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); Composite buttonComposite = (Composite) composite.getChildren()[0]; Button browseRegisteredExtensionsButton = new Button(buttonComposite, SWT.PUSH); browseRegisteredExtensionsButton .setText(Messages.LoadExtensionDialog_ExtensionRegistry); prepareBrowseRegisteredPackagesButton(browseRegisteredExtensionsButton); { FormData data = new FormData(); Control[] children = buttonComposite.getChildren(); data.right = new FormAttachment(children[0], -CONTROL_OFFSET); browseRegisteredExtensionsButton.setLayoutData(data); } return composite; }
@Override public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) { super.createControls(parent, aTabbedPropertySheetPage); Composite composite=this.getWidgetFactory().createFlatFormComposite(parent); composite.setLayout(new FormLayout()); Label la=this.getWidgetFactory().createLabel(composite,"名称:"); FormData laData=new FormData(); laData.top=new FormAttachment(0,12); laData.left=new FormAttachment(0,10); la.setLayoutData(laData); this.labelText=this.getWidgetFactory().createText(composite, ""); FormData textData=new FormData(); textData.left=new FormAttachment(la,1); textData.top=new FormAttachment(0,12); textData.right=new FormAttachment(100,-10); this.labelText.setLayoutData(textData); }
/** * Set the layout of the widgets for the no progress case. * */ private void setLayoutsForNoProgress() { FormData buttonData = new FormData(); buttonData.top = new FormAttachment(progressLabel, 0, SWT.TOP); buttonData.right = new FormAttachment(100, IDialogConstants.HORIZONTAL_SPACING * -1); actionBar.setLayoutData(buttonData); if (taskEntries.size() > 0) { FormData linkData = new FormData(); linkData.top = new FormAttachment(progressLabel, IDialogConstants.VERTICAL_SPACING); linkData.left = new FormAttachment(progressLabel, 0, SWT.LEFT); linkData.right = new FormAttachment(actionBar, 0, SWT.LEFT); taskEntries.get(0).setLayoutData(linkData); } }
public TagListCombinedWidget(Composite parent, int style, Composite callLayoutOnMe) { super(parent, style); FormLayout layout = new FormLayout(); setLayout(layout); FormData selfFormData = new FormData(); selfFormData.top = new FormAttachment(0, 0); selfFormData.left = new FormAttachment(0, 0); selfFormData.right = new FormAttachment(100, 0); setLayoutData(selfFormData); tagList = new TagListCombo(this, SWT.NONE); FormData tagListFormData = new FormData(); tagListFormData.top = new FormAttachment(0, 0); tagListFormData.left = new FormAttachment(0, 0); tagListFormData.right = new FormAttachment(100, 0); tagList.getControl().setLayoutData(tagListFormData); tagListSelected = new TagListSelected(this, SWT.NONE, callLayoutOnMe); FormData tagListSelectedFormData = new FormData(); tagListSelectedFormData.top = new FormAttachment(tagList.getControl(), 0); tagListSelectedFormData.left = new FormAttachment(0, 0); tagListSelectedFormData.right = new FormAttachment(100, 0); tagListSelected.getWidget().setLayoutData(tagListSelectedFormData); }
private void addCodeButton() { wbCodes = new Button(wSettingComp, SWT.PUSH); wbCodes.setText( BaseMessages.getString( PKG, "SdmxDialog.AddCodes.Button")); props.setLook(wbCodes); fdCodes = new FormData(); fdCodes.left = new FormAttachment( wCodeList, margin ); fdCodes.top = new FormAttachment( wbDimensions, margin ); wbCodes.setLayoutData( fdCodes ); wbCodes.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event e) { StringBuilder builder = new StringBuilder(); int ind[] = wCodeList.getSelectionIndices(); for (int anInd : ind) { if (builder.length() > 0) { builder.append("+"); } builder.append(wCodeList.getItem(anInd)[0]); } updateDimensionTable( sdmxDialogData.getActiveDimensionId(), builder.toString() ); } }); }
private void addTableView() { int margin = Const.MARGIN; ColumnInfo[] colinf = new ColumnInfo[rowMeta.size()]; for ( int i = 0; i < rowMeta.size(); i++ ) { ValueMetaInterface v = rowMeta.getValueMeta( i ); colinf[i] = new ColumnInfo( v.getName(), ColumnInfo.COLUMN_TYPE_TEXT, v.isNumeric() ); colinf[i].setToolTip( v.toStringMeta() ); colinf[i].setValueMeta( v ); } wSeriesTable = new TableView( variables, shell, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI, colinf, 0, null, props ); wSeriesTable.setShowingBlueNullValues( true ); //// TODO: 25/05/16 wat? fdSeriesTable = new FormData(); fdSeriesTable.left = new FormAttachment( 0, 0 ); fdSeriesTable.top = new FormAttachment( 0, margin ); fdSeriesTable.right = new FormAttachment( 100, 0 ); fdSeriesTable.bottom = new FormAttachment( 100, -50 ); wSeriesTable.setLayoutData( fdSeriesTable ); fillTableView(); }
@Override public void createControl(final Composite parent) { final Composite container = new Composite(parent, SWT.NULL); final FormLayout formLayout = new FormLayout(); formLayout.marginHeight = FormHelper.MarginHeight(); formLayout.marginWidth = FormHelper.MarginWidth(); formLayout.spacing = FormHelper.Spacing(); container.setLayout(formLayout); setControl(container); final Label errorLabel = new Label(container, SWT.WRAP); final FormData errorLabelData = new FormData(); errorLabelData.top = new FormAttachment(0, 0); errorLabelData.left = new FormAttachment(0, 0); errorLabel.setLayoutData(errorLabelData); errorLabel.setText(Messages.getString("SelectMergeTargetMappingWizardPage.ErrorLabelText")); //$NON-NLS-1$ ControlSize.setCharWidthHint(errorLabel, MergeWizard.TEXT_CHARACTER_WIDTH); }
private void createBaselessWarningMessage(final Composite container, final Control imageNeighbour) { final Image baselessWarningImage = imageHelper.getImage("images/common/warning.gif"); //$NON-NLS-1$ baselessWarningImageLabel = new Label(container, SWT.NONE); baselessWarningImageLabel.setImage(baselessWarningImage); baselessWarningImageLabel.setToolTipText( Messages.getString("SelectMergeSourceTargetWizardPage.BaselessWarningText")); //$NON-NLS-1$ final FormData baselessWarningImageLabelData = new FormData(); final int warningImageTopOffset = FormHelper.VerticalOffset(baselessWarningImageLabel, imageNeighbour); baselessWarningImageLabelData.top = new FormAttachment(imageNeighbour, warningImageTopOffset, SWT.TOP); baselessWarningImageLabelData.left = new FormAttachment(imageNeighbour, 2, SWT.RIGHT); baselessWarningImageLabel.setLayoutData(baselessWarningImageLabelData); baselessWarningLabel = new Label(container, SWT.NONE); final FormData baselessWarningLabelData = new FormData(); baselessWarningLabelData.top = new FormAttachment(targetCombo, 5, SWT.BOTTOM); baselessWarningLabelData.left = new FormAttachment(0, 0); baselessWarningLabel.setLayoutData(baselessWarningLabelData); baselessWarningLabel.setText(Messages.getString("SelectMergeSourceTargetWizardPage.BaselessWarningText")); //$NON-NLS-1$ setBaselessWarningVisibility(false); }
private void addDateChooser(final Composite compositeFields) { final Button open = new Button(compositeFields, SWT.PUSH); final FormData fd_dtPasswordExpire = new FormData(); fd_dtPasswordExpire.left = new FormAttachment(txtPasswordExpire, 10, SWT.RIGHT); fd_dtPasswordExpire.top = new FormAttachment(txtPasswordExpire, 0, SWT.TOP); fd_dtPasswordExpire.bottom = new FormAttachment(txtPasswordExpire, 0, SWT.BOTTOM); open.setLayoutData(fd_dtPasswordExpire); open.setText(Messages.getString("EditDialog.Calendar")); //$NON-NLS-1$ open.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { final DateDialog dialog = new DateDialog(shell); dialog.setDate(entryToEdit.getExpires()); final Date result = dialog.open(); if (result != null && !result.equals(entryToEdit.getExpires())) { txtPasswordExpire.setText(format(result)); setDirty(true); } } }); }
public void resetLayoutData() { if (text != null) { FormData fd_styledText = new FormData(); if (composite.getVisible()) fd_styledText.bottom = new FormAttachment(composite, 1); else fd_styledText.bottom = new FormAttachment(100); fd_styledText.right = new FormAttachment(100); fd_styledText.top = new FormAttachment(0); if (tree.getVisible()) fd_styledText.left = new FormAttachment(tree, 1); else fd_styledText.left = new FormAttachment(0); text.setLayoutData(fd_styledText); layout(); } }
private void addRowHandlingGroup() { wgRowHandling = new Group( wcConfig, SWT.SHADOW_NONE ); props.setLook( wgRowHandling ); wgRowHandling.setText( BaseMessages.getString( PKG, "CPythonScriptExecutorDialog.ConfigTab.RowHandlingGroup" ) ); FormLayout wglRowHandling = new FormLayout(); wglRowHandling.marginWidth = 10; wglRowHandling.marginHeight = 10; wgRowHandling.setLayout( wglRowHandling ); fd = new FormData(); fd.left = new FormAttachment( 0, 0 ); fd.right = new FormAttachment( 100, 0 ); fd.top = new FormAttachment( 0, 0 ); wgRowHandling.setLayoutData( fd ); addRowsToProcessControllers(); // Number of Rows to Process addReservoirSamplingControllers(); // Reservoir Sampling addRandomSeedControllers(); // Random Seed }
private void addOptionsGroup() { // add second group wgOptions = new Group( wcConfig, SWT.SHADOW_NONE ); props.setLook( wgOptions ); wgOptions.setText( BaseMessages.getString( PKG, "CPythonScriptExecutorDialog.ConfigTab.OptionsGroup" ) ); FormLayout optionsGroupLayout = new FormLayout(); optionsGroupLayout.marginWidth = 10; optionsGroupLayout.marginHeight = 10; wgOptions.setLayout( optionsGroupLayout ); FormData fd = new FormData(); fd.left = new FormAttachment( 0, 0 ); fd.right = new FormAttachment( 100, 0 ); fd.top = new FormAttachment( wgRowHandling, MARGIN ); wgOptions.setLayoutData( fd ); addIncludeInputInOutputControllers(); }
/*************************************************************************** * Define the split layout **************************************************************************/ private void defineSectionsLayout() { FormData section1_data = new FormData(); section1_data.left = new FormAttachment(0, 0); section1_data.right = new FormAttachment(100, 0); section1_data.top = new FormAttachment(0, 0); section1_data.bottom = new FormAttachment(m_sash, 0); m_presentationSection.setLayoutData(section1_data); FormData section2_data = new FormData(); section2_data.left = new FormAttachment(0, 0); section2_data.right = new FormAttachment(100, 0); section2_data.top = new FormAttachment(m_sash, 0); section2_data.bottom = new FormAttachment(100, 0); m_controlSection.setLayoutData(section2_data); m_sashData = new FormData(); m_sashData.top = new FormAttachment(0, 500); m_sashData.left = new FormAttachment(0, 0); m_sashData.right = new FormAttachment(100, 0); m_sash.setLayoutData(m_sashData); m_sash.addListener(SWT.Selection, this); }
/*************************************************************************** * Handle sash events, takes place when user drags the sash **************************************************************************/ public void handleEvent(Event e) { Rectangle sashRect = m_sash.getBounds(); Rectangle shellRect = getClientArea(); int height = shellRect.height - sashRect.height - m_sizeLimit; e.y = Math.max(Math.min(e.y, height), m_sizeLimit); if (e.y != sashRect.y) { m_sashData.top = new FormAttachment(0, e.y); layout(); } for(ISashListener listener : m_listeners) { listener.onSashMoved( shellRect.height - e.y ); } }
/** * Create the main composite. */ protected void createMainComposite() { mainComposite = factory.createComposite(this, SWT.NO_FOCUS); mainComposite.setBackgroundMode(SWT.INHERIT_FORCE); GridLayout layout = new GridLayout(); layout.marginHeight = 0; layout.marginWidth = 0; mainComposite.setLayout(layout); FormData formData = new FormData(); formData.left = new FormAttachment(0, 0); formData.right = new FormAttachment(100, 0); formData.top = new FormAttachment(0, 0); formData.bottom = new FormAttachment(100, 0); mainComposite.setLayoutData(formData); createMainContents(); }
private void onResize() { final Rectangle sashRect = _sash.getBounds(); final Rectangle parentRect = _parent.getClientArea(); final int visibleHeight = parentRect.height - sashRect.height; final int sashBottom = sashRect.y + sashRect.height; // set default height if (_fixedHeight < MINIMUM_PART_HEIGHT) { _fixedHeight = parentRect.height / 2; } /* * Ensure that the minimum height at the top and the bottom is preserved. */ final int requestedSashBottom = Math.max(MINIMUM_PART_HEIGHT, visibleHeight - _fixedHeight); if (requestedSashBottom != sashBottom) { _fixedFD.top = new FormAttachment(0, requestedSashBottom); _parent.layout(); } }
private FormData standardSpacing(Control control, boolean isLabel) { FormData fd = new FormData(); if (isLabel) fd.left = new FormAttachment(0, 0); else fd.left = new FormAttachment(middle, 0); if (isLabel) fd.right = new FormAttachment(middle, -Const.MARGIN); else fd.right = new FormAttachment(100, 0); if (control != null) fd.top = new FormAttachment(control, Const.MARGIN+verticalPadding); else fd.top = new FormAttachment(0, Const.MARGIN+verticalPadding); verticalPadding = 0; return fd; }
private void createNotificationsTabFolder() { _notificationTabFolder = new TabFolder(_form.getBody(), SWT.NONE); FormData layoutData = new FormData(); layoutData.left = new FormAttachment(0); layoutData.top = new FormAttachment(0); layoutData.right = new FormAttachment(100); layoutData.bottom = new FormAttachment(100); _notificationTabFolder.setLayoutData(layoutData); _notificationTabFolder.setVisible(false); VHNotificationsTabControl controller = new VHNotificationsTabControl(_notificationTabFolder); TabItem tab = new TabItem(_notificationTabFolder, SWT.NONE); tab.setText(NOTIFICATIONS); tab.setData(TabControl.CONTROLLER, controller); tab.setControl(controller.getControl()); }
/** * @param factory * factory to use. */ protected void buildFastloadLine(final PluginWidgetFactory factory) { final Control topControl = this.wVariableSubstitution; this.wlFastLoadPath = factory.createRightLabel(BaseMessages.getString(PKG, "TeraFastDialog.FastloadPath.Label")); this.props.setLook(this.wlFastLoadPath); this.wlFastLoadPath.setLayoutData(factory.createLabelLayoutData(topControl)); this.wbFastLoadPath = factory.createPushButton(BaseMessages.getString(PKG, "TeraFastDialog.Browse.Button")); this.props.setLook(this.wbFastLoadPath); FormData formData = factory.createControlLayoutData(topControl); formData.left = null; this.wbFastLoadPath.setLayoutData(formData); this.wFastLoadPath = factory.createSingleTextVarLeft(); this.props.setLook(this.wFastLoadPath); formData = factory.createControlLayoutData(topControl); formData.right = new FormAttachment(this.wbFastLoadPath, -factory.getMargin()); this.wFastLoadPath.setLayoutData(formData); }
protected void placeWidget( Control widget ) { FormData data = new FormData(); if ( this.topPlacement >= 0 ) { data.top = new FormAttachment( this.topPlacement, this.topMargin ); } else if ( this.top != null ) { data.top = new FormAttachment( this.top, this.topMargin ); } if ( this.leftPlacement >= 0 ) { data.left = new FormAttachment( this.leftPlacement, this.leftMargin ); } else if ( this.left != null ) { data.left = new FormAttachment( this.left, this.leftMargin ); } if ( this.rightPlacement >= 0 ) { data.right = new FormAttachment( this.rightPlacement, -this.rightMargin ); } else if ( this.width > 0 ) { data.width = this.width; } if ( this.bottomPlacement >= 0 ) { data.bottom = new FormAttachment( this.bottomPlacement, -this.bottomMargin ); } else if ( this.height > 0 ) { data.height = this.height; } widget.setLayoutData( data ); }
/** * Open the dialog. * @return the result */ public Object open() { createContents(); createTriggers(); lblSavedPath = new Label(shlUSBLogviewer, SWT.NONE); FormData fd_lblSavedPath = new FormData(); fd_lblSavedPath.right = new FormAttachment(btnParse, -6); fd_lblSavedPath.bottom = new FormAttachment(100, -15); fd_lblSavedPath.left = new FormAttachment(0, 10); lblSavedPath.setLayoutData(fd_lblSavedPath); shlUSBLogviewer.open(); shlUSBLogviewer.layout(); Display display = getParent().getDisplay(); while (!shlUSBLogviewer.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } return result; }
public void setBottomControl(Control control){ FormData controlData = new FormData (); if(layout == SWT.HORIZONTAL){ controlData.left = new FormAttachment (0, 0); controlData.right = new FormAttachment (100, 0); controlData.top = new FormAttachment (sash, 0); controlData.bottom = new FormAttachment (100, 0); } else{ controlData.left = new FormAttachment (sash, 0); controlData.right = new FormAttachment (100, 0); controlData.top = new FormAttachment (0, 0); controlData.bottom = new FormAttachment (100, 0); } control.setLayoutData (controlData); }
/** * Initializes the {@link InfoBar} with "Yes" and "No" {@link Button buttons}. * * @param managedForm The {@link IManagedForm} instance. * @param yesListener The {@link SelectionListener} to handle the Yes button selection. */ protected void initYesNoInfoBar(IManagedForm managedForm, SelectionListener yesListener, SelectionListener noListener) { InfoBar infoBar = getInfoBar(); FormToolkit toolkit = managedForm.getToolkit(); Button yesButton = toolkit.createButton(infoBar, "Yes", SWT.PUSH); if (yesListener != null) { yesButton.addSelectionListener(yesListener); } Button noButton = toolkit.createButton(infoBar, "No", SWT.PUSH); if (noListener != null) { noButton.addSelectionListener(noListener); } FormData yesButtonFormData = new FormData(); yesButtonFormData.top = new FormAttachment(0, 0); yesButtonFormData.right = new FormAttachment(noButton); yesButton.setLayoutData(yesButtonFormData); FormData noButtonFormData = new FormData(); noButtonFormData.top = new FormAttachment(0, 0); noButtonFormData.right = new FormAttachment(100, 0); noButton.setLayoutData(noButtonFormData); FormData labelFormData = new FormData(); labelFormData.top = new FormAttachment(yesButton, 0, SWT.CENTER); labelFormData.left = new FormAttachment(0, 0); infoBar.getLabel().setLayoutData(labelFormData); }
@Override protected void contributeToToolBar(IToolBarManager toolBarManager) { super.contributeToToolBar(toolBarManager); ControlContribution toolBarCompositeContribution = new ControlContribution(getToolBarCompositeContributionId()) { @Override protected Control createControl(Composite parent) { FormToolkit toolkit = getManagedForm().getToolkit(); Composite toolBarComposite = toolkit.createComposite(parent); FormLayout toolBarCompositeLayout = new FormLayout(); toolBarCompositeLayout.marginTop = 0; toolBarCompositeLayout.marginBottom = 0; toolBarCompositeLayout.marginLeft = 4; toolBarCompositeLayout.marginRight = 4; toolBarCompositeLayout.spacing = 4; toolBarComposite.setLayout(toolBarCompositeLayout); _ToolBarLabel = toolkit.createLabel(toolBarComposite, "", SWT.RIGHT); FormData toolBarLabelFormData = new FormData(); toolBarLabelFormData.top = new FormAttachment(0, 0); toolBarLabelFormData.left = new FormAttachment(0, 0); toolBarLabelFormData.right = new FormAttachment(100, 0); // HACK: I really struggled to get this label to show up. toolBarLabelFormData.width = 100; _ToolBarLabel.setLayoutData(toolBarLabelFormData); return toolBarComposite; } }; toolBarManager.add(toolBarCompositeContribution); }
@Override protected FormData getTableFormData() { FormData formData = new FormData(); formData.top = new FormAttachment(0, 0); formData.left = new FormAttachment(0, 0); formData.bottom = new FormAttachment(100, 0); formData.right = new FormAttachment(_ZnodeAclComposite.getAddButton(), 0, SWT.LEFT); return formData; }
protected void fillComposite (Composite composite) { composite.setLayout(new FormLayout()); viewer = createViewer(composite); Control control = viewer.getControl(); control.setEnabled(false); FormData fd_javaScript = new FormData(); fd_javaScript.left = new FormAttachment(0, 10); fd_javaScript.right = new FormAttachment(100, -5); fd_javaScript.top = new FormAttachment(0, 10); setHeight (fd_javaScript, control, 10); control.setLayoutData(fd_javaScript); }
private void workaround_383750 (Composite composite) { // List dummy = new List(composite, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL); dummy.setBackground(composite.getBackground()); FormData fd_dummy = new FormData(); fd_dummy.top = new FormAttachment(0, 0); fd_dummy.left = new FormAttachment(0, 1); fd_dummy.right = new FormAttachment(0, 1); dummy.setLayoutData(fd_dummy); }
protected void fillComposite (Composite composite) { composite.setLayout(new FormLayout()); viewer = ViewerHelper.createEditor(composite); viewer.getControl().setData(WIDGET_ID, WIDGET_SCRIPT); FocusListener listener = new FocusListener() { @Override public void focusGained(FocusEvent e) { } @Override public void focusLost(FocusEvent event) { if (!notification) return; GW4EVertexEditPartProperties properties = (GW4EVertexEditPartProperties) node.getAdapter(IPropertySource.class); if (viewer.getDocument() == null) return; String content = viewer.getDocument().get(); properties.setPropertyValue(ModelProperties.PROPERTY_VERTEX_INIT, content); } }; viewer.getControl().addFocusListener(listener); Control control = viewer.getControl(); control.setEnabled(false); FormData fd_javaScript = new FormData(); fd_javaScript.left = new FormAttachment(0, 10); fd_javaScript.right = new FormAttachment(100, -5); fd_javaScript.top = new FormAttachment(0, 10); setHeight (fd_javaScript, control, 10); control.setLayoutData(fd_javaScript); }
protected void createViewer() { FormLayout formLayout = new FormLayout(); setLayout(formLayout); Composite con = new Composite(this, SWT.NONE); FormData topData = new FormData(); topData.left = new FormAttachment(0,0); topData.right = new FormAttachment(100,0); topData.top = new FormAttachment(0,0); con.setLayoutData(topData); con.setLayout(new GridLayout(3,false)); createTopArea(con); viewer = new TreeViewer(this, SWT.FULL_SELECTION | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); contentProvider = new PrefsContentProvider(); viewer.setContentProvider(contentProvider); viewer.getTree().setHeaderVisible(true); viewer.getTree().setLinesVisible(true); FormData viewerData = new FormData(); viewerData.top = new FormAttachment(con, 5); viewerData.bottom = new FormAttachment(100,0); viewerData.left = new FormAttachment(0,0); viewerData.right = new FormAttachment(100,0); viewer.getTree().setLayoutData(viewerData); viewerFilter = new PreferenceFilter(); viewer.addFilter(viewerFilter); filterJob = new SetFilterJob(viewer, viewerFilter); }
private void addSeperator(String id, String groupID) { SWTSkinObjectContainer soGroup = getGroupSO(groupID); Control lastControl = getLastControl(groupID); SWTSkinObject so = skin.createSkinObject("toolbar_sep" + Math.random(), id, soGroup); if (so != null) { if (lastControl != null) { FormData fd = (FormData) so.getControl().getLayoutData(); fd.left = new FormAttachment(lastControl, fd.left == null ? 0 : fd.left.offset); } } }
private void addNonToolBar(String skinid, String groupID) { SWTSkinObjectContainer soGroup = getGroupSO(groupID); Control lastControl = getLastControl(groupID); SWTSkinObject so = skin.createSkinObject("toolbar_d" + Math.random(), skinid, soGroup); if (so != null) { if (lastControl != null) { FormData fd = (FormData) so.getControl().getLayoutData(); fd.left = new FormAttachment(lastControl, fd.left == null ? 0 : fd.left.offset); } } }
public void initialize( Composite parent_composite ) { composite = new Composite( parent_composite, SWT.NULL ); FormLayout layout = new FormLayout(); layout.marginTop = 4; layout.marginLeft = 4; layout.marginRight = 4; layout.marginBottom = 4; composite.setLayout( layout ); FormData data = new FormData(); data.left = new FormAttachment(0,0); data.right = new FormAttachment(100,0); data.top = new FormAttachment(composite,0); data.bottom = new FormAttachment(100,0); Label label = new Label( composite, SWT.NULL ); label.setText( "Nothing to show for " + getTitle()); label.setLayoutData( data ); }
private void createNameText(Composite parent) { this.nameText = new Text(parent, SWT.SINGLE | SWT.BORDER); FormData data = new FormData(); data.top = new FormAttachment(0, 5); data.left = new FormAttachment(0, STANDARD_LABEL_WIDTH); data.right = new FormAttachment(100, 0); this.nameText.setLayoutData(data); }