@Override public void shellActivated( ShellEvent shellEvent ) { super.shellActivated( shellEvent ); if ( deprecation ) { return; } String deprecated = BaseMessages.getString( PKGBASE, "JobCategory.Category.Deprecated" ).toLowerCase(); shell.setText( shell.getText() + " (" + deprecated + ")" ); deprecation = true; } } );
public WindowProperty( Shell shell ) { name = shell.getText(); maximized = shell.getMaximized(); rectangle = shell.getBounds(); }
@Override public void shellActivated( ShellEvent shellEvent ) { super.shellActivated( shellEvent ); if ( !stepMeta.isDeprecated() || deprecation ) { return; } String deprecated = BaseMessages.getString( PKG, "BaseStep.Category.Deprecated" ).toLowerCase(); shell.setText( shell.getText() + " (" + deprecated + ")" ); deprecation = true; } } );
Shell shell = canvas.getShell(); MessageBox dialog = new MessageBox( shell, SWT.ICON_WARNING | SWT.OK ); dialog.setText( shell.getText() ); dialog.setMessage( "Warning: Device is not tracking resource allocation" ); dialog.open();
public static void setSize( Shell shell, int prefWidth, int prefHeight ) { PropsUI props = PropsUI.getInstance(); WindowProperty winprop = props.getScreen( shell.getText() ); if ( winprop != null ) { winprop.setShell( shell, prefWidth, prefHeight ); } else { shell.layout(); winprop = new WindowProperty( shell.getText(), false, new Rectangle( 0, 0, prefWidth, prefHeight ) ); winprop.setShell( shell ); // Now, as this is the first time it gets opened, try to put it in the middle of the screen... Rectangle shellBounds = shell.getBounds(); Monitor monitor = shell.getDisplay().getPrimaryMonitor(); if ( shell.getParent() != null ) { monitor = shell.getParent().getMonitor(); } Rectangle monitorClientArea = monitor.getClientArea(); int middleX = monitorClientArea.x + ( monitorClientArea.width - shellBounds.width ) / 2; int middleY = monitorClientArea.y + ( monitorClientArea.height - shellBounds.height ) / 2; shell.setLocation( middleX, middleY ); } }
try { databaseDialogInstance = new DatabaseConnectionDialog(); if ( ( (Shell) this.parentShell ).getText().contains( "Metadata Editor" ) ) { databaseDialogInstance.registerClass( EXTENDED_WIDGET_ID, PMD_WIDGET_CLASSNAME ); } else {
public static void setSize( Shell shell, int minWidth, int minHeight, boolean packIt ) { PropsUI props = PropsUI.getInstance(); WindowProperty winprop = props.getScreen( shell.getText() ); if ( winprop != null ) { winprop.setShell( shell, minWidth, minHeight ); } else { if ( packIt ) { shell.pack(); } else { shell.layout(); } // OK, sometimes this produces dialogs that are waay too big. // Try to limit this a bit, m'kay? // Use the same algorithm by cheating :-) // winprop = new WindowProperty( shell ); winprop.setShell( shell, minWidth, minHeight ); // Now, as this is the first time it gets opened, try to put it in the middle of the screen... Rectangle shellBounds = shell.getBounds(); Monitor monitor = shell.getDisplay().getPrimaryMonitor(); if ( shell.getParent() != null ) { monitor = shell.getParent().getMonitor(); } Rectangle monitorClientArea = monitor.getClientArea(); int middleX = monitorClientArea.x + ( monitorClientArea.width - shellBounds.width ) / 2; int middleY = monitorClientArea.y + ( monitorClientArea.height - shellBounds.height ) / 2; shell.setLocation( middleX, middleY ); } }
PropsUI props = PropsUI.getInstance(); WindowProperty winprop = props.getScreen( shell.getText() ); if ( winprop != null ) { winprop.setShell( shell, minWidth, minHeight );
@Override String doGetStringValue(Object source) { return ((Shell) source).getText(); }
public String getTitle() { return shell.getText(); } /**
@Override public String getTitle() { Shell shell = window.getShell(); if (shell != null && !shell.isDisposed()) { // update the cached title windowTitle = shell.getText(); } return windowTitle; }
private static void renderText( Shell shell ) { renderProperty( shell, PROP_TEXT, shell.getText(), "" ); }
public RefactoringStatusDialog(Shell parent, ErrorWizardPage page, boolean backButton) { this(page.getStatus(), parent, parent.getText(), backButton); }
@Override public void showBlocked(Shell parentShell, IProgressMonitor blockingMonitor, IStatus blockingStatus, String blockedName) { nestingDepth++; if (outerMonitor == null) { outerMonitor = blockingMonitor; //Try to get a name as best as possible if (blockedName == null && parentShell != null) { blockedName = parentShell.getText(); } BlockedJobsDialog.createBlockedDialog(parentShell, blockingMonitor, blockingStatus, blockedName); } }
/** * Creates the dialog area. * * @param parent the parent * @param existing the existing * @return the control */ protected Control createDialogArea(Composite parent, Object existing) { Composite composite = (Composite) super.createDialogArea(parent); createWideLabel(composite, dialogDescription); if (null != existing) getShell().setText(getShell().getText().replaceFirst("Add", "Edit")); return composite; }
private static void writeText( final Shell shell ) throws IOException { String text = shell.getText(); if( WidgetLCAUtil.hasChanged( shell, PROP_TEXT, text, "" ) ) { JSWriter writer = JSWriter.getWriterFor( shell ); text = WidgetLCAUtil.escapeText( text, false ); writer.set( JSConst.QX_FIELD_CAPTION, text ); } }
/** * Add an additional, optional filter to the viewer. If the filter text * is cleared, this filter will be removed from the TreeViewer. * * @param filter */ protected void addFilter(ViewerFilter filter) { viewerFilter = filter; getViewer().addFilter(filter); if (filterText != null) { setFilterText(WorkbenchMessages.FilteredTree_FilterMessage); textChanged(); } cachedTitle = getShell().getText(); getShell().setText( NLS.bind( WorkbenchMessages.FilteredTree_FilteredDialogTitle, cachedTitle)); }
private void resetDisabledIssues () { MessageBox dlg = new MessageBox(shell, SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL); dlg.setText(shell.getText()); dlg.setMessage("This command will re-enabled all issues that have been disabled.\nDo you want to proceed?"); if ( dlg.open() != SWT.YES ) return; // Proceed session.resetDisabledIssues(); issuesModel.updateTable(0, displayType, issueType); }
@Override public void preserveValues( Shell shell ) { preserveProperty( shell, PROP_ACTIVE_CONTROL, getActiveControl( shell ) ); preserveProperty( shell, PROP_ACTIVE_SHELL, shell.getDisplay().getActiveShell() ); preserveProperty( shell, PROP_TEXT, shell.getText() ); preserveProperty( shell, PROP_IMAGE, shell.getImage() ); preserveProperty( shell, PROP_ALPHA, Integer.valueOf( shell.getAlpha() ) ); preserveProperty( shell, PROP_MODE, getMode( shell ) ); preserveProperty( shell, PROP_FULLSCREEN, Boolean.valueOf( shell.getFullScreen() ) ); preserveProperty( shell, PROP_MINIMUM_SIZE, shell.getMinimumSize() ); preserveProperty( shell, PROP_DEFAULT_BUTTON, shell.getDefaultButton() ); }
public void preserveValues( final Widget widget ) { ControlLCAUtil.preserveValues( ( Control )widget ); Shell shell = ( Shell )widget; IWidgetAdapter adapter = WidgetUtil.getAdapter( shell ); adapter.preserve( PROP_ACTIVE_CONTROL, getActiveControl( shell ) ); adapter.preserve( PROP_ACTIVE_SHELL, shell.getDisplay().getActiveShell() ); adapter.preserve( PROP_TEXT, shell.getText() ); adapter.preserve( PROP_IMAGE, shell.getImage() ); adapter.preserve( PROP_ALPHA, new Integer( shell.getAlpha() ) ); adapter.preserve( PROP_MODE, getMode( shell ) ); adapter.preserve( PROP_FULLSCREEN, Boolean.valueOf( shell.getFullScreen() ) ); adapter.preserve( PROP_SHELL_LISTENER, Boolean.valueOf( ShellEvent.hasListener( shell ) ) ); adapter.preserve( PROP_SHELL_MENU, shell.getMenuBar() ); adapter.preserve( PROP_MINIMUM_SIZE, shell.getMinimumSize() ); WidgetLCAUtil.preserveCustomVariant( shell ); }