本文整理了Java中org.eclipse.swt.widgets.Button.setImage()
方法的一些代码示例,展示了Button.setImage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.setImage()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Button
类名称:Button
方法名:setImage
[英]Sets the receiver's image to the argument, which may be null
indicating that no image should be displayed.
Note that a Button can display an image and text simultaneously on Windows (starting with XP), GTK+ and OSX. On other platforms, a Button that has an image and text set into it will display the image or text that was set most recently.
[中]将接收器图像设置为参数,该参数可能为null
,表示不应显示图像。
请注意,按钮可以在Windows(从XP开始)、GTK+和OSX上同时显示图像和文本。在其他平台上,设置了图像和文本的按钮将显示最近设置的图像或文本。
代码示例来源:origin: pentaho/pentaho-kettle
private static Button newButton( final Composite parent ) {
Button button = new Button( parent, SWT.PUSH );
button.setImage( GUIResource.getInstance().getImageHelpWeb() );
button.setText( BaseMessages.getString( PKG, "System.Button.Help" ) );
button.setToolTipText( BaseMessages.getString( PKG, "System.Tooltip.Help" ) );
FormData fdButton = new FormData();
fdButton.left = new FormAttachment( 0, 0 );
fdButton.bottom = new FormAttachment( 100, 0 );
button.setLayoutData( fdButton );
return button;
}
代码示例来源:origin: caoxinyu/RedisClient
btnBackward.setImage(leftImage);
btnForward.setImage(rightImage);
btnUP.setImage(upImage);
btnRefresh.setImage(refreshImage);
代码示例来源:origin: pentaho/pentaho-kettle
btnHelp.setImage( GUIResource.getInstance().getImageHelpWeb() );
btnHelp.setText( BaseMessages.getString( PKG, "System.Button.Help" ) );
btnHelp.setToolTipText( BaseMessages.getString( PKG, "System.Tooltip.Help" ) );
代码示例来源:origin: caoxinyu/RedisClient
btnExecButton.setImage(runImage);
btnExecButton.setToolTipText(RedisClient.i18nFile.getText(I18nFile.RUNCURRENTTIP)+"\tF7");
btnExecSelectButton.setImage(runImage);
btnExecSelectButton.setToolTipText(RedisClient.i18nFile.getText(I18nFile.RUNSELECTTIP)+"\tF8");
btnExecNextButton.setImage(runImage);
btnExecNextButton.setToolTipText(RedisClient.i18nFile.getText(I18nFile.RUNFOLLOWTIP)+"\tF9");
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Setting the layout of a <i>Reset</i> option button. Either a button image is set - if existing - or a text.
*
* @param button
* The button
*/
private FormData layoutResetOptionButton( Button button ) {
FormData fd = new FormData();
Image editButton = GUIResource.getInstance().getResetOptionButton();
if ( editButton != null ) {
button.setImage( editButton );
button.setBackground( GUIResource.getInstance().getColorWhite() );
fd.width = editButton.getBounds().width + 20;
fd.height = editButton.getBounds().height;
} else {
button.setText( BaseMessages.getString( PKG, "EnterOptionsDialog.Button.Reset" ) );
}
button.setToolTipText( BaseMessages.getString( PKG, "EnterOptionsDialog.Button.Reset.Tooltip" ) );
return fd;
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Setting the layout of an <i>Edit</i> option button. Either a button image is set - if existing - or a text.
*
* @param button
* The button
*/
private FormData layoutEditOptionButton( Button button ) {
FormData fd = new FormData();
Image editButton = GUIResource.getInstance().getEditOptionButton();
if ( editButton != null ) {
button.setImage( editButton );
button.setBackground( GUIResource.getInstance().getColorWhite() );
fd.width = editButton.getBounds().width + 20;
fd.height = editButton.getBounds().height;
} else {
button.setText( BaseMessages.getString( PKG, "EnterOptionsDialog.Button.Edit" ) );
}
button.setToolTipText( BaseMessages.getString( PKG, "EnterOptionsDialog.Button.Edit.Tooltip" ) );
return fd;
}
代码示例来源:origin: pentaho/pentaho-kettle
btnHelp.setImage( GUIResource.getInstance().getImageHelpWeb() );
btnHelp.setText( BaseMessages.getString( PKG, "System.Button.Help" ) );
btnHelp.setToolTipText( BaseMessages.getString( PKG, "System.Tooltip.Help" ) );
代码示例来源:origin: pentaho/pentaho-kettle
btnHelp.setImage( GUIResource.getInstance().getImageHelpWeb() );
FormData fd_btnHelp = new FormData();
fd_btnHelp.top = new FormAttachment( separator, 12 );
代码示例来源:origin: pentaho/pentaho-kettle
wbDirectory.setImage( GUIResource.getInstance().getImageArrow() );
props.setLook( wbDirectory );
fdbDirectory = new FormData();
代码示例来源:origin: pentaho/pentaho-kettle
wbDirectory.setImage( GUIResource.getInstance().getImageArrow() );
props.setLook( wbDirectory );
FormData fdbDirectory = new FormData();
代码示例来源:origin: pentaho/pentaho-kettle
button.setText( buttonText );
button.setImage( GUIResource.getInstance().getImage( "ui/images/edittext.svg" ) );
代码示例来源:origin: pentaho/pentaho-kettle
wbFontColorChange.setImage( guiresource.getImageColor() );
wbFontColorChange.setToolTipText( BaseMessages.getString( PKG, "NotePadDialog.Font.Color.Change.Tooltip" ) );
props.setLook( wbFontColorChange );
wbBackGroundColorChange.setImage( guiresource.getImageColor() );
wbBackGroundColorChange.setToolTipText( BaseMessages.getString(
PKG, "NotePadDialog.Font.BackGroundColor.Change.Tooltip" ) );
wbBorderColorChange.setImage( guiresource.getImageColor() );
wbBorderColorChange.setToolTipText( BaseMessages.getString(
PKG, "NotePadDialog.Font.BorderColor.Change.Tooltip" ) );
代码示例来源:origin: pentaho/pentaho-kettle
wbFoldername.setImage( GUIResource.getInstance().getImageBol() );
fdbFoldername = new FormData();
fdbFoldername.right = new FormAttachment( 100, 0 );
代码示例来源:origin: pentaho/pentaho-kettle
wSelectFolder.setImage( GUIResource.getInstance().getImageBol() );
wSelectFolder.setToolTipText( BaseMessages.getString( PKG, "MailInput.SelectFolderConnection.Label" ) );
props.setLook( wSelectFolder );
open.setImage( GUIResource.getInstance().getImageCalendar() );
open.setToolTipText( BaseMessages.getString( PKG, "MailInput.OpenCalendar" ) );
FormData fdlButton = new FormData();
opento.setImage( GUIResource.getInstance().getImageCalendar() );
opento.setToolTipText( BaseMessages.getString( PKG, "MailInput.OpenCalendar" ) );
FormData fdlButtonto = new FormData();
代码示例来源:origin: pentaho/pentaho-kettle
open.setImage( GUIResource.getInstance().getImageCalendar() );
open.setToolTipText( BaseMessages.getString( PKG, "SalesforceInputDialog.OpenCalendar" ) );
FormData fdlButton = new FormData();
opento.setImage( GUIResource.getInstance().getImageCalendar() );
opento.setToolTipText( BaseMessages.getString( PKG, "SalesforceInputDialog.OpenCalendar" ) );
FormData fdlButtonto = new FormData();
代码示例来源:origin: pentaho/pentaho-kettle
open.setImage( GUIResource.getInstance().getImageCalendar() );
open.setToolTipText( BaseMessages.getString( PKG, "JobGetPOP.OpenCalendar" ) );
FormData fdlButton = new FormData();
opento.setImage( GUIResource.getInstance().getImageCalendar() );
opento.setToolTipText( BaseMessages.getString( PKG, "JobGetPOP.OpenCalendar" ) );
FormData fdlButtonto = new FormData();
代码示例来源:origin: org.codehaus.openxma/xmartclient
/**
* Sets the icon of the back button.
*/
public void setBackIcon(Image icon) {
((Button)backW).setImage(icon);
}
代码示例来源:origin: org.codehaus.openxma/xmartclient
/**
* Sets the icon of the end button.
*/
public void setEndIcon(Image icon) {
((Button)endW).setImage(icon);
}
代码示例来源:origin: org.codehaus.openxma/xmartclient
/**
* Sets the icon for the export icon
*/
public void setExportIcon(Image icon) {
((Button)exportW).setImage(icon);
}
代码示例来源:origin: BiglySoftware/BiglyBT
public Image setButtonImage(Button btn, final String key) {
Image bg = getImage(key);
btn.setImage(bg);
btn.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
releaseImage(key);
}
});
return( bg );
}
内容来源于网络,如有侵权,请联系作者删除!