/** * * @param shell * the shell. */ public OlapInputAboutDialog( final Shell shell ) { this.dialog = new Shell( shell, SWT.BORDER | SWT.CLOSE | SWT.APPLICATION_MODAL | SWT.SHEET ); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; this.dialog.setLayout( gridLayout ); this.dialog.setText( BaseMessages.getString( PKG, "OlapInputDialog.About.Shell.Title" ) ); this.dialog.setImage( shell.getImage() ); this.buildIconCell(); this.buildPluginInfoCell(); this.buildOkButton(); this.dialog.pack(); Rectangle shellBounds = shell.getBounds(); Point dialogSize = this.dialog.getSize(); this.dialog.setLocation( shellBounds.x + ( shellBounds.width - dialogSize.x ) / 2, shellBounds.y + ( shellBounds.height - dialogSize.y ) / 2 ); }
private static void renderImage( Shell shell ) { if( ( shell.getStyle() & SWT.TITLE ) != 0 ) { Image image = shell.getImage(); if( image == null ) { Image[] defaultImages = shell.getImages(); if( defaultImages.length > 0 ) { image = defaultImages[0]; } } renderProperty( shell, PROP_IMAGE, image, null ); } }
/** * * @param shell * the shell. */ public SapInputAboutDialog( final Shell shell ) { this.dialog = new Shell( shell, SWT.BORDER | SWT.CLOSE | SWT.APPLICATION_MODAL | SWT.SHEET ); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; this.dialog.setLayout( gridLayout ); this.dialog.setText( BaseMessages.getString( PKG, "SapInputDialog.About.Shell.Title" ) ); this.dialog.setImage( shell.getImage() ); this.buildIconCell(); this.buildPluginInfoCell(); this.buildOkButton(); this.dialog.pack(); Rectangle shellBounds = shell.getBounds(); Point dialogSize = this.dialog.getSize(); this.dialog.setLocation( shellBounds.x + ( shellBounds.width - dialogSize.x ) / 2, shellBounds.y + ( shellBounds.height - dialogSize.y ) / 2 ); }
private static void writeImage( final Shell shell ) throws IOException { if( ( shell.getStyle() & SWT.TITLE ) != 0 ) { Image image = shell.getImage(); if( image == null ) { Image[] defaultImages = shell.getImages(); if( defaultImages.length > 0 ) { image = defaultImages[0]; } } if( WidgetLCAUtil.hasChanged( shell, PROP_IMAGE, image, null ) ) { JSWriter writer = JSWriter.getWriterFor( shell ); writer.set( JSConst.QX_FIELD_ICON, ImageFactory.getImagePath( image ) ); } } }
/** * * @param shell * the shell. */ public TeraFastAboutDialog( final Shell shell ) { this.dialog = new Shell( shell, SWT.BORDER | SWT.CLOSE | SWT.APPLICATION_MODAL | SWT.SHEET ); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; this.dialog.setLayout( gridLayout ); this.dialog.setText( BaseMessages.getString( PKG, "TeraFastDialog.About.Shell.Title" ) ); this.dialog.setImage( shell.getImage() ); this.buildIconCell(); this.buildPluginInfoCell(); this.buildOkButton(); this.dialog.pack(); Rectangle shellBounds = shell.getBounds(); Point dialogSize = this.dialog.getSize(); this.dialog.setLocation( shellBounds.x + ( shellBounds.width - dialogSize.x ) / 2, shellBounds.y + ( shellBounds.height - dialogSize.y ) / 2 ); }
public static Image getWorkbenchShellImage(int maximumHeight) { // always use the launching workbench window IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); if (windows != null && windows.length > 0) { IWorkbenchWindow workbenchWindow = windows[0]; if (workbenchWindow != null && !workbenchWindow.getShell().isDisposed()) { Image image = getShell().getImage(); int diff = Integer.MAX_VALUE; if (image != null && image.getBounds().height <= maximumHeight) { diff = maximumHeight - image.getBounds().height; } else { image = null; } Image[] images = getShell().getImages(); if (images != null && images.length > 0) { // find the icon that is closest in size, but not larger than maximumHeight for (Image image2 : images) { int newDiff = maximumHeight - image2.getBounds().height; if (newDiff >= 0 && newDiff <= diff) { diff = newDiff; image = image2; } } } return image; } } return null; }
props = PropsUI.getInstance(); props.setLook( shell ); shell.setImage( parent.getImage() ); shell.setLayout( new FormLayout() ); shell.setText( BaseMessages.getString( PKG, "ArgumentsDialog.Arguments.Label" ) );
public static void storeDefaultImage(Shell shell) { storeDefaultImage(shell, DEFAULT_IMAGE, shell.getImage()); }
private void handleDialogPageIcon() { if ( getShell().getImage() != null ) { return; // nothing todo, because there is already an image on shell } Shell toHandle = getShell(); while ( (toHandle = getParentShell(toHandle)) != null ) { Image img = toHandle.getImage(); if ( img != null ) { getShell().setImage(img); break; } } }
private void handleDialogPageIcon() { if ( getShell().getImage() != null ) { return; // nothing todo, because there is already an image on shell } Shell toHandle = getShell(); while ( (toHandle = getParentShell(toHandle)) != null ) { Image img = toHandle.getImage(); if ( img != null ) { getShell().setImage(img); break; } } }
if ( p_Parent != null ) shell.setImage(p_Parent.getImage()); GridLayout layTmp = new GridLayout(); layTmp.marginBottom = 0;
shell = new Shell(parent, SWT.CLOSE | SWT.TITLE | SWT.RESIZE | SWT.APPLICATION_MODAL); shell.setText(Res.getString("RuleDialog.caption")); //$NON-NLS-1$ shell.setImage(parent.getImage()); shell.setLayout(new GridLayout());
private void create(Shell parent, boolean readOnly) { shell.setText(Res.getString("EditorCaption")); if (parent != null) shell.setImage(parent.getImage()); GridLayout layTmp = new GridLayout(); layTmp.marginBottom = 0;
if ( parent != null ) shell.setImage(parent.getImage()); GridLayout layTmp = new GridLayout(); layTmp.marginBottom = 0;
if ( p_Parent != null ) shell.setImage(p_Parent.getImage()); GridLayout layTmp = new GridLayout(); layTmp.marginBottom = 0;
if ( p_Parent != null ) shell.setImage(p_Parent.getImage()); GridLayout layTmp = new GridLayout(); layTmp.marginBottom = 0;
@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() ); }
if (parent != null) { shell = new Shell(parent, dialogStyle | modalStyle | resizeStyle); shell.setImage(parent.getImage()); } else { shell = new Shell(Display.getDefault(), dialogStyle | modalStyle | resizeStyle);
if (parent != null) { shell = new Shell(parent, dialogStyle | modalStyle | resizeStyle); shell.setImage(parent.getImage()); } else { shell = new Shell(Display.getDefault(), dialogStyle | modalStyle | resizeStyle);
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 ); }