本文整理匯總了Java中org.eclipse.jface.window.Window.setDefaultImage方法的典型用法代碼示例。如果您正苦於以下問題:Java Window.setDefaultImage方法的具體用法?Java Window.setDefaultImage怎麽用?Java Window.setDefaultImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.window.Window
的用法示例。
在下文中一共展示了Window.setDefaultImage方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: configureShell
import org.eclipse.jface.window.Window; //導入方法依賴的package包/類
/**
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
*/
@Override
protected void configureShell(final Shell newShell) {
super.configureShell(newShell);
newShell.setText(PasswordSafeJFace.APP_NAME);
// in macOS, the icon gets installed into the .app and this lower resolution one
// just gets in the way.
if (!System.getProperty("os.name").toLowerCase().contains("mac")) {
final Image jpwIcon = IOUtils.getImage(PasswordSafeJFace.class,
"/org/pwsafe/passwordsafeswt/images/cpane.ico"); //$NON-NLS-1$
newShell.setImage(jpwIcon);
// provide it for the rest of jpwsafe:
JFaceResources.getImageRegistry().put(JPW_ICON, jpwIcon);
Window.setDefaultImage(jpwIcon);
}
WidgetPreferences.tuneShell(newShell, getClass());
startOpeningDialogThread(newShell);
}
示例2: execute
import org.eclipse.jface.window.Window; //導入方法依賴的package包/類
@Execute
public void execute(final Shell shell, final ArticleService articleService, final OrderService orderService) {
LOGGER.info(this.getClass().getSimpleName() + " called");
OrdersSearchDialog dialog = new OrdersSearchDialog(shell, articleService, orderService);
Window.setDefaultImage(OrderPluginImages.ORDER_SEARCH.getImage());
dialog.create();
Shell innerShell = dialog.getShell();
Point point = innerShell.getSize();
point.x = point.x + 150;
point.y = point.y + 150;
innerShell.setSize(point);
if (dialog.open() == Window.OK) {
List<Order> ordersToOpen = dialog.getSelectedOrders();
for (Order orderToOpen : ordersToOpen) {
postEvent(orderToOpen);
}
}
}
示例3: execute
import org.eclipse.jface.window.Window; //導入方法依賴的package包/類
@Execute
public void execute(final Shell shell, final OrderService orderService, final ArticleService articleSerice) {
LOGGER.info(this.getClass().getSimpleName() + " called");
WizardDialog dialog = new WizardDialog(shell, new NewOrderWizard(orderService, articleSerice));
Window.setDefaultImage(OrderPluginImages.ORDER.getImage());
dialog.open();
}
示例4: run
import org.eclipse.jface.window.Window; //導入方法依賴的package包/類
/**
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
final PasswordSafeJFace app = PasswordSafeJFace.getApp();
// Create the preference manager
PreferenceManager mgr = new PreferenceManager();
// Create the nodes
PreferenceNode displayPrefs = new PreferenceNode(
"display", Messages.getString("OptionsAction.DisplayNode"), null, DisplayPreferences.class.getName()); //$NON-NLS-1$ //$NON-NLS-2$
PreferenceNode securityPrefs = new PreferenceNode(
"security", Messages.getString("OptionsAction.SecurityNode"), null, SecurityPreferences.class //$NON-NLS-1$ //$NON-NLS-2$
.getName());
PreferenceNode passwordPolicyPrefs = new PreferenceNode(
"policy", Messages.getString("OptionsAction.PolicyNode"), null, //$NON-NLS-1$ //$NON-NLS-2$
PasswordPolicyPreferences.class.getName());
PreferenceNode usernamePrefs = new PreferenceNode(
"username", Messages.getString("OptionsAction.UserNameNode"), null, UsernamePreferences.class //$NON-NLS-1$ //$NON-NLS-2$
.getName());
PreferenceNode miscPrefs = new PreferenceNode(
"misc", Messages.getString("OptionsAction.MiscNode"), null, MiscPreferences.class.getName()); //$NON-NLS-1$ //$NON-NLS-2$
// Add the nodes
mgr.addToRoot(displayPrefs);
mgr.addToRoot(securityPrefs);
mgr.addToRoot(passwordPolicyPrefs);
mgr.addToRoot(usernamePrefs);
mgr.addToRoot(miscPrefs);
// Create the preferences dialog
PreferenceDialog dlg = new PreferenceDialog(app.getShell(), mgr);
Window.setDefaultImage(IOUtils.getImage(PasswordSafeJFace.class,
"/org/pwsafe/passwordsafeswt/images/clogo.gif")); //$NON-NLS-1$
// Set the preference store
dlg.setPreferenceStore(JFacePreferences.getPreferenceStore());
// Open the dialog
dlg.open();
try {
if (JFacePreferences.getPreferenceStore().needsSaving()) {
// Be Paranoid - Save the preferences now
UserPreferences.getInstance().savePreferences();
}
} catch (IOException e) {
e.printStackTrace();
}
}