本文整理了Java中org.eclipse.swt.widgets.Shell.getImage()
方法的一些代码示例,展示了Shell.getImage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shell.getImage()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Shell
类名称:Shell
方法名:getImage
暂无
代码示例来源:origin: pentaho/pentaho-kettle
/**
*
* @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 );
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
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 );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
*
* @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 );
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
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 ) );
}
}
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
*
* @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 );
}
代码示例来源:origin: org.eclipse.mylyn.commons/workbench
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;
}
代码示例来源:origin: pentaho/pentaho-kettle
props = PropsUI.getInstance();
props.setLook( shell );
shell.setImage( parent.getImage() );
shell.setLayout( new FormLayout() );
shell.setText( BaseMessages.getString( PKG, "ArgumentsDialog.Arguments.Label" ) );
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt
public static void storeDefaultImage(Shell shell) {
storeDefaultImage(shell, DEFAULT_IMAGE, shell.getImage());
}
代码示例来源:origin: org.codehaus.openxma/xmartserver
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;
}
}
}
代码示例来源:origin: org.codehaus.openxma/xmartclient
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;
}
}
}
代码示例来源:origin: net.sf.okapi.filters/okapi-filter-markdown-ui
if ( p_Parent != null ) shell.setImage(p_Parent.getImage());
GridLayout layTmp = new GridLayout();
layTmp.marginBottom = 0;
代码示例来源:origin: net.sf.okapi.filters/okapi-filter-regex-ui
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());
代码示例来源:origin: net.sf.okapi.filters/okapi-filter-xliff-ui
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;
代码示例来源:origin: net.sf.okapi.filters/okapi-filter-mif-ui
if ( parent != null ) shell.setImage(parent.getImage());
GridLayout layTmp = new GridLayout();
layTmp.marginBottom = 0;
代码示例来源:origin: net.sf.okapi.filters/okapi-filter-properties-ui
if ( p_Parent != null ) shell.setImage(p_Parent.getImage());
GridLayout layTmp = new GridLayout();
layTmp.marginBottom = 0;
代码示例来源:origin: net.sf.okapi.filters/okapi-filter-regex-ui
if ( p_Parent != null ) shell.setImage(p_Parent.getImage());
GridLayout layTmp = new GridLayout();
layTmp.marginBottom = 0;
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@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() );
}
代码示例来源:origin: org.codehaus.openxma/xmartserver
if (parent != null) {
shell = new Shell(parent, dialogStyle | modalStyle | resizeStyle);
shell.setImage(parent.getImage());
} else {
shell = new Shell(Display.getDefault(), dialogStyle | modalStyle | resizeStyle);
代码示例来源:origin: org.codehaus.openxma/xmartclient
if (parent != null) {
shell = new Shell(parent, dialogStyle | modalStyle | resizeStyle);
shell.setImage(parent.getImage());
} else {
shell = new Shell(Display.getDefault(), dialogStyle | modalStyle | resizeStyle);
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
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 );
}
内容来源于网络,如有侵权,请联系作者删除!