本文整理匯總了Java中com.apple.eawt.Application.setPreferencesHandler方法的典型用法代碼示例。如果您正苦於以下問題:Java Application.setPreferencesHandler方法的具體用法?Java Application.setPreferencesHandler怎麽用?Java Application.setPreferencesHandler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.apple.eawt.Application
的用法示例。
在下文中一共展示了Application.setPreferencesHandler方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: integrate
import com.apple.eawt.Application; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
public static void integrate()
{
try
{
Application appleEawtApplication = Application.getApplication();
appleEawtApplication.setDockIconImage(ImageIO.read(new URL(JavaFxHelper.buildResourcePath("icon.png"))));
appleEawtApplication.setEnabledAboutMenu(false);
appleEawtApplication.setAboutHandler(null);
appleEawtApplication.setEnabledPreferencesMenu(false);
appleEawtApplication.setPreferencesHandler(null);
}
catch (Throwable e)
{
e.printStackTrace();
}
}
示例2: install
import com.apple.eawt.Application; //導入方法依賴的package包/類
static void install() {
try {
Application app = Application.getApplication();
NbApplicationAdapterJDK8 al = new NbApplicationAdapterJDK8();
app.setAboutHandler(al);
app.setOpenFileHandler(al);
app.setPreferencesHandler(al);
app.setQuitHandler(al);
} catch (Throwable ex) {
ErrorManager.getDefault().notify(ErrorManager.WARNING, ex);
} finally {
}
NbApplicationAdapter.install();
}
示例3: uninstall
import com.apple.eawt.Application; //導入方法依賴的package包/類
static void uninstall() {
Application app = Application.getApplication();
app.setAboutHandler(null);
app.setOpenFileHandler(null);
app.setPreferencesHandler(null);
app.setQuitHandler(null);
}
示例4: initMac
import com.apple.eawt.Application; //導入方法依賴的package包/類
private void initMac() {
Application macApplication = Application.getApplication();
macApplication.setAboutHandler((AppEvent.AboutEvent ae) -> {
mActionManager.getAction(ActionManager.ABOUT).actionPerformed(null);
});
macApplication.setPreferencesHandler((AppEvent.PreferencesEvent pe) -> {
mActionManager.getAction(ActionManager.OPTIONS).actionPerformed(null);
});
}
示例5: OSXSetup
import com.apple.eawt.Application; //導入方法依賴的package包/類
public void OSXSetup() {
Application app = Application.getApplication();
app.setAboutHandler(new AboutHandler() {
public void handleAbout(AboutEvent ae) {
about();
}
});
app.setPreferencesHandler(new PreferencesHandler() {
public void handlePreferences(PreferencesEvent pe) {
PreferencesDialog.showPreferences(frame);
//EditPreferences editPreferences = new EditPreferences(frame, async);
//editPreferences.preferences();
tree.setExpandibleIcons(!IBioSimPreferences.INSTANCE.isPlusMinusIconsEnabled());
if (sbolDocument != null) {
sbolDocument.setDefaultURIprefix(SBOLEditorPreferences.INSTANCE.getUserInfo().getURI().toString());
}
}
});
app.setQuitHandler(new QuitHandler() {
public void handleQuitRequestWith(QuitEvent event, QuitResponse response) {
exit();
}
});
}
示例6: OpenCardsWrapper4MacOSX
import com.apple.eawt.Application; //導入方法依賴的package包/類
public OpenCardsWrapper4MacOSX() {
// set some mac-specific properties
System.setProperty("apple.awt.graphics.EnableQ2DX", "true");
System.setProperty("apple.laf.useScreenMenuBar", "true");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "OpenCards");
oc = new OpenCards();
MacAppHandler macAppHandler = new MacAppHandler(oc);
// create an instance of the Mac Application class, so i can handle the
// mac quit event with the Mac ApplicationAdapter
Application macApplication = Application.getApplication();
// need to enable the preferences option manually
macApplication.setPreferencesHandler(macAppHandler);
macApplication.setAboutHandler(macAppHandler);
macApplication.setQuitHandler(macAppHandler);
macApplication.setQuitStrategy(QuitStrategy.CLOSE_ALL_WINDOWS);
macApplication.addAppEventListener(macAppHandler);
// display the jframe
SwingUtilities.invokeLater(new Runnable() {
public void run() {
oc.setVisible(true);
oc.doAfterSetup();
}
});
}
示例7: setupUserInterfaceForOsx
import com.apple.eawt.Application; //導入方法依賴的package包/類
/**
* Setup the UI for OS X
*/
private void setupUserInterfaceForOsx() {
final Application application = Application.getApplication();
application.disableSuddenTermination();
application.setAboutHandler(aboutEvent -> showAboutDialog());
application.setPreferencesHandler(preferencesEvent -> showSettingsDialog());
application.setQuitHandler((quitEvent, quitResponse) -> {
if (!beenden(false, false)) {
quitResponse.cancelQuit();
} else {
quitResponse.performQuit();
}
});
//setup the MediathekView Dock Icon
try {
final URL url = this.getClass().getResource("/mediathek/res/MediathekView.png");
final BufferedImage appImage = ImageIO.read(url);
application.setDockIconImage(appImage);
} catch (IOException ex) {
Log.errorLog(165623698, "OS X Application image could not be loaded");
}
//Remove all menu items which don´t need to be displayed due to OS X´s native menu support
if (SystemInfo.isMacOSX()) {
//Datei->Beenden
jMenuDatei.remove(jSeparator2);
jMenuDatei.remove(jMenuItemBeenden);
//Datei->Einstellungen
jMenuDatei.remove(jMenuItemEinstellungen);
}
setupOsxDockIconBadge();
}
示例8: App
import com.apple.eawt.Application; //導入方法依賴的package包/類
/** Creates a new {@link App}. */
protected App() {
if (Platform.isMacintosh()) {
Application app = Application.getApplication();
app.setAboutHandler(AboutCommand.INSTANCE);
app.setPreferencesHandler(PreferencesCommand.INSTANCE);
app.setOpenFileHandler(OpenCommand.INSTANCE);
app.setPrintFileHandler(PrintCommand.INSTANCE);
app.setQuitHandler(QuitCommand.INSTANCE);
app.setQuitStrategy(QuitStrategy.SYSTEM_EXIT_0);
app.disableSuddenTermination();
}
}
示例9: MacOSAppEventDispatcher
import com.apple.eawt.Application; //導入方法依賴的package包/類
public MacOSAppEventDispatcher(final Application app,
final EventService eventService)
{
this.eventService = eventService;
app.setAboutHandler(this);
app.setPreferencesHandler(this);
app.setPrintFileHandler(this);
app.setQuitHandler(this);
app.addAppEventListener(this);
app.setOpenFileHandler(this);
}
示例10: doInstallPreferencesHandler
import com.apple.eawt.Application; //導入方法依賴的package包/類
protected boolean doInstallPreferencesHandler(final MacUtils.PreferencesHandler preferencesHandler) {
Application application = Application.getApplication();
application.setPreferencesHandler(preferencesEvent -> AwtUtils.doLaterOnEventThread(preferencesHandler::preferencesRequested));
return true;
}