protected Input( VariableSpace space, Composite composite, int width1, int width2 ) { super( composite, SWT.NONE ); WidgetUtils.setFormLayout( this, 0 ); label = new Label( this, SWT.LEFT ); initText( space, composite, SWT.LEFT | SWT.SINGLE | SWT.BORDER ); input.setLayoutData( new FormDataBuilder().top( label ).left().right( width1, width2 ).result() ); }
insertTextInterface.insertText( extra, position ); } else { if ( control.isDisposed() ) { return; if ( !shell.isDisposed() ) { shell.dispose(); if ( !control.isDisposed() ) { control.setData( Boolean.FALSE );
public CheckBoxToolTip( Control control ) { super( control, ToolTip.RECREATE, true ); image = control.getDisplay().getSystemImage( SWT.ICON_INFORMATION ); listeners = new ArrayList<CheckBoxToolTipListener>(); visible = false; display = control.getDisplay(); super.setRespectMonitorBounds( true ); super.setRespectDisplayBounds( true ); super.setHideDelay( 50000 ); super.setPopupDelay( 0 ); super.setHideOnMouseDown( false ); }
public void keyTraversed( TraverseEvent te ) { te.doit = false; // set focus on the next control. // What is the next control? int thisOne = controlNr + 1; while ( !controls[ thisOne ].isEnabled() ) { thisOne++; if ( thisOne >= controls.length ) { thisOne = 0; } if ( thisOne == controlNr ) { return; // already tried all others, time to quit. } } controls[ thisOne ].setFocus(); } } );
public void focusLost( FocusEvent event ) { shell.dispose(); if ( !control.isDisposed() ) { control.setData( Boolean.FALSE ); } } } );
public void unEdit() { if ( text != null && !text.isDisposed() ) { text.dispose(); } if ( combo != null && !combo.isDisposed() ) { combo.dispose(); } }
protected void createGroupComposite(Composite parent) { composite = new Composite(parent, SWT.NONE); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); composite.setLayoutData(gd); GridLayout layout = new GridLayout(); layout.marginWidth = 0; layout.marginHeight = 0; composite.setLayout(layout); composite.setFont(parent.getFont()); viewer = createViewer(composite); viewer.getControl().setLayoutData(getViewerGridData()); }
private void placeControl( Shell pShell, String text, Control control, Control under ) { int middle = props.getMiddlePct(); int margin = Const.MARGIN; Label label = new Label( pShell, SWT.RIGHT ); label.setText( text ); props.setLook( label ); FormData formDataLabel = new FormData(); formDataLabel.left = new FormAttachment( 0, 0 ); if ( under != null ) { formDataLabel.top = new FormAttachment( under, margin ); } else { formDataLabel.top = new FormAttachment( 0, 0 ); } formDataLabel.right = new FormAttachment( middle, 0 ); label.setLayoutData( formDataLabel ); props.setLook( control ); FormData formDataControl = new FormData(); formDataControl.left = new FormAttachment( middle, 0 ); if ( under != null ) { formDataControl.top = new FormAttachment( under, margin ); } else { formDataControl.top = new FormAttachment( 0, 0 ); } formDataControl.right = new FormAttachment( 100, 0 ); control.setLayoutData( formDataControl ); }
private void createSourceViewer(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setLayout(new GridLayout()); Label label = new Label(composite, SWT.NONE); label.setText(PDEUIMessages.ExternalizeStringsWizardPage_sourceLabel); label.setLayoutData(new GridData()); fSourceViewer = new SourceViewer(composite, null, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER); fSourceViewer.setEditable(false); fSourceViewer.getTextWidget().setFont(JFaceResources.getTextFont()); fSourceViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH)); fEmptyDoc = new Document(); fSourceViewer.setDocument(fEmptyDoc); }
@Override protected Control createContents ( final Composite parent ) { final Composite wrapper = new Composite ( parent, SWT.NONE ); wrapper.setLayout ( new GridLayout ( 1, false ) ); final Control control = super.createContents ( wrapper ); control.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, false ) ); createDescription ( wrapper ); return wrapper; }
public JobGraph( Composite par, final Spoon spoon, final JobMeta jobMeta ) { super( par, SWT.NONE ); shell = par.getShell(); this.log = spoon.getLog(); this.spoon = spoon; setLayoutData( new GridData( GridData.FILL_BOTH ) ); mainComposite = new Composite( this, SWT.NONE ); mainComposite.setLayout( new FillLayout() ); toolbarFd.right = new FormAttachment( 100, 0 ); toolbarControl.setLayoutData( toolbarFd ); toolbarControl.setParent( this );
@Override protected Control createDialogArea(Composite parent) { Composite composite = new Composite(parent, SWT.NULL); composite.setLayout(new GridLayout()); Label header = new Label(composite,SWT.NULL); header.setText(Messages.COMPOSITE_RESET_TASK_DIALOG_MESSAGE); TableViewer viewer = new TableViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); viewer.setContentProvider(new TaskContentProvider()); viewer.setLabelProvider(new TaskLabelProvider()); viewer.setInput(tasks); GridData taskData = new GridData(); taskData.widthHint = 400; taskData.heightHint = 200; taskData.horizontalAlignment = SWT.FILL; taskData.verticalAlignment = SWT.FILL; viewer.getControl().setLayoutData(taskData); return composite; }
Control newLabeledControl(Composite composite, String labelName, Control other) { Label l = new Label(composite, SWT.NONE); l.setText(Translate.getInstance().labelName(labelName) + ": "); l.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); l.setFont(fonts.tableFontBold()); l.setBackground(bgColor); other.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); other.setBackground(bgColor); return other; }
if ( transGraph.extraViewComposite == null || transGraph.extraViewComposite.isDisposed() ) { transGraph.addExtraView(); } else { transPreviewTab.setText( BaseMessages.getString( PKG, "Spoon.TransGraph.PreviewTab.Name" ) ); transPreviewComposite = new Composite( transGraph.extraViewTabFolder, SWT.NONE ); transPreviewComposite.setLayout( new FormLayout() ); PropsUI.getInstance().setLook( transPreviewComposite, Props.WIDGET_STYLE_TOOLBAR ); toolbarControl.setLayoutData( new FormData() ); FormData fd = new FormData(); fd.left = new FormAttachment( 0, 0 ); // First one in the left top corner fd.top = new FormAttachment( 0, 0 ); fd.right = new FormAttachment( 100, 0 ); toolbarControl.setLayoutData( fd ); toolbarControl.setParent( transPreviewComposite ); previewComposite = new Composite( transPreviewComposite, SWT.NONE );
public boolean open() { shell = new Shell( parentShell, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN | SWT.APPLICATION_MODAL ); shell.setImage( GUIResource.getInstance().getImageLogoSmall() ); formLayout.marginHeight = Const.FORM_MARGIN; shell.setLayout( formLayout ); shell.setText( BaseMessages.getString( PKG, "ImportRulesDialog.Shell.Title" ) ); props.setLook( toolbarControl ); toolbarControl.setLayoutData( new FormData() ); FormData fdToolbar = new FormData(); fdToolbar.left = new FormAttachment( 0, 0 ); // First one in the left top corner fdToolbar.top = new FormAttachment( 0, 0 ); fdToolbar.right = new FormAttachment( 100, 0 ); toolbarControl.setLayoutData( fdToolbar ); toolbarControl.setParent( shell ); shell.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep();
@Override protected Control createDialogArea(Composite parent) { Composite container = (Composite) super.createDialogArea(parent); GridData gd = new GridData(GridData.FILL_BOTH); gd.widthHint = 400; gd.heightHint = 300; container.setLayoutData(gd); Label label = new Label(container, SWT.NONE); label.setText(PDEUIMessages.PluginStatusDialog_label); treeViewer = new TreeViewer(container); treeViewer.setContentProvider(new ContentProvider()); treeViewer.setLabelProvider(PDEPlugin.getDefault().getLabelProvider()); treeViewer.setComparator(new ViewerComparator()); treeViewer.setInput(fInput); treeViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH)); getShell().setText(PDEUIMessages.PluginStatusDialog_pluginValidation); Dialog.applyDialogFont(container); return container; }
if ( perfComposite.isDisposed() ) { return; for ( Control control : perfComposite.getChildren() ) { if ( !control.isDisposed() ) { control.dispose(); Label dataListLabel = new Label( perfComposite, SWT.NONE ); dataListLabel.setText( BaseMessages.getString( PKG, "StepPerformanceSnapShotDialog.Metrics.Label" ) ); spoon.props.setLook( dataListLabel ); FormData fdDataListLabel = new FormData(); fdDataListLabel.right = new FormAttachment( spoon.props.getMiddlePct() / 2, Const.MARGIN ); fdDataListLabel.top = new FormAttachment( 0, Const.MARGIN + 5 ); dataListLabel.setLayoutData( fdDataListLabel ); canvas.setLayoutData( fdCanvas ); perfComposite.addControlListener( new ControlAdapter() { public void controlResized( ControlEvent event ) { updateGraph();
@Override protected Control createDialogArea(Composite parent2) { Composite parent= (Composite) super.createDialogArea(parent2); Control c= fCompareEditorInput.createContents(parent); c.setLayoutData(new GridData(GridData.FILL_BOTH)); statusLabel = new Label(parent, SWT.NONE); statusLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Shell shell= c.getShell(); shell.setText(fCompareEditorInput.getTitle()); shell.setImage(fCompareEditorInput.getTitleImage()); applyDialogFont(parent); return parent; }
for ( Control control : wComposite.getChildren() ) { control.dispose(); wComposite.layout( true, true ); wlCondition = new Label( wComposite, SWT.RIGHT ); props.setLook( wlCondition ); wlCondition.setText( BaseMessages.getString( PKG, "TransDebugDialog.Condition.Label" ) ); wlCondition.setToolTipText( BaseMessages.getString( PKG, "TransDebugDialog.Condition.ToolTip" ) ); FormData fdlCondition = new FormData(); fdlCondition.left = new FormAttachment( 0, 0 ); wComposite.layout( true, true );
private void createSignaturePreview(Composite composite) { Label previewLabel= new Label(composite, SWT.NONE); previewLabel.setText(RefactoringMessages.ChangeSignatureInputPage_method_Signature_Preview); IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); fSignaturePreview= new JavaSourceViewer(composite, null, null, false, SWT.READ_ONLY | SWT.V_SCROLL | SWT.WRAP /*| SWT.BORDER*/, store); fSignaturePreview.configure(new JavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, null)); fSignaturePreview.getTextWidget().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT)); fSignaturePreview.getTextWidget().setBackground(composite.getBackground()); fSignaturePreview.setDocument(fSignaturePreviewDocument); fSignaturePreview.setEditable(false); //Layouting problems with wrapped text: see https://bugs.eclipse.org/bugs/show_bug.cgi?id=9866 Control signaturePreviewControl= fSignaturePreview.getControl(); PixelConverter pixelConverter= new PixelConverter(signaturePreviewControl); GridData gdata= new GridData(GridData.FILL_BOTH); gdata.widthHint= pixelConverter.convertWidthInCharsToPixels(50); gdata.heightHint= pixelConverter.convertHeightInCharsToPixels(2); signaturePreviewControl.setLayoutData(gdata); }