本文整理汇总了Java中com.apple.eawt.ApplicationEvent.setHandled方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationEvent.setHandled方法的具体用法?Java ApplicationEvent.setHandled怎么用?Java ApplicationEvent.setHandled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.apple.eawt.ApplicationEvent
的用法示例。
在下文中一共展示了ApplicationEvent.setHandled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handlePreferences
import com.apple.eawt.ApplicationEvent; //导入方法依赖的package包/类
@Override
public void handlePreferences(ApplicationEvent event) {
PreferencesEditorDialog myPrefs =
new PreferencesEditorDialog(
parent,
true,
((ETReduxFrame)parent).getMyState().getReduxPreferences());
myPrefs.setSize(375, 540);
myPrefs.setVisible(true);
((ETReduxFrame)parent)
.getTheSample()
.setFractionDataOverriddenOnImport(
myPrefs.getReduxPreferences().isFractionDataOverriddenOnImport());
event.setHandled(true);
}
示例2: handleQuit
import com.apple.eawt.ApplicationEvent; //导入方法依赖的package包/类
/** This is called when the user does Application->Quit */
@Override
public void handleQuit(ApplicationEvent event) {
// TODO this should not be hardcoded --> look up by menuitem name
Component[] sampleFile = parent.getJMenuBar().getMenu(0).getMenuComponents();
for (Component sampleFile1 : sampleFile) {
if (sampleFile1.getClass().getName().equalsIgnoreCase("javax.swing.JMenuItem")) {
if (((AbstractButton) sampleFile1).getText().equalsIgnoreCase("Exit")) {
((AbstractButton) sampleFile1).doClick();
event.setHandled(true);
}
}
}
}
示例3: handleAbout
import com.apple.eawt.ApplicationEvent; //导入方法依赖的package包/类
@Override
public void handleAbout(ApplicationEvent ae) {
if (mainApp != null) {
ae.setHandled(true);
// We need to invoke modal About Dialog asynchronously
// otherwise the Application queue is locked for the duration
// of the about Dialog, which results in a deadlock if a URL is
// selected, and we get a ReOpenApplication event when user
// switches back to Findbugs.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
mainApp.about();
}
});
} else {
throw new IllegalStateException("handleAbout: " +
"MyApp instance detached from listener");
}
}
示例4: handleQuit
import com.apple.eawt.ApplicationEvent; //导入方法依赖的package包/类
@Override
public void handleQuit(ApplicationEvent ae) {
if (mainApp != null) {
/*
* You MUST setHandled(false) if you want to
* delay or cancel the quit. This is important
* for cross-platform development -- have a
* universal quit routine that chooses whether
* or not to quit, so the functionality is
* identical on all platforms. This example
* simply cancels the AppleEvent-based quit and
* defers to that universal method.
*/
ae.setHandled(false);
mainApp.exitFindBugs();
} else {
throw new IllegalStateException("handleQuit: MyApp instance detached " +
"from listener");
}
}
示例5: handleAbout
import com.apple.eawt.ApplicationEvent; //导入方法依赖的package包/类
@Override
public void handleAbout(ApplicationEvent ae) {
if (mainApp != null) {
ae.setHandled(true);
// We need to invoke modal About Dialog asynchronously
// otherwise the Application queue is locked for the duration
// of the about Dialog, which results in a deadlock if a URL is
// selected, and we get a ReOpenApplication event when user
// switches back to Findbugs.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
mainApp.about();
}
});
} else {
throw new IllegalStateException("handleAbout: " + "MyApp instance detached from listener");
}
}
示例6: handleQuit
import com.apple.eawt.ApplicationEvent; //导入方法依赖的package包/类
@Override
public void handleQuit(ApplicationEvent ae) {
if (mainApp != null) {
/*
* You MUST setHandled(false) if you want to delay or cancel the
* quit. This is important for cross-platform development -- have a
* universal quit routine that chooses whether or not to quit, so
* the functionality is identical on all platforms. This example
* simply cancels the AppleEvent-based quit and defers to that
* universal method.
*/
ae.setHandled(false);
mainApp.callOnClose();
} else {
throw new IllegalStateException("handleQuit: MyApp instance detached " + "from listener");
}
}
示例7: handleOpenFile
import com.apple.eawt.ApplicationEvent; //导入方法依赖的package包/类
public void handleOpenFile(final ApplicationEvent event) {
File f = new File(event.getFilename());
try {
IdeaDocument document = ReaderFactory.getInstance().read(f);
Main.getMainframe().setDocument(document);
} catch (ReaderException re) {
re.printStackTrace();
}
event.setHandled(true);
}
示例8: handleAbout
import com.apple.eawt.ApplicationEvent; //导入方法依赖的package包/类
public void handleAbout(ApplicationEvent ae) {
if (aboutAction != null) {
ae.setHandled(true);
aboutAction.actionPerformed(new ActionEvent(this, 0, null));
} else {
throw new IllegalStateException("handleAbout: about action is null");
}
}
示例9: handlePreferences
import com.apple.eawt.ApplicationEvent; //导入方法依赖的package包/类
public void handlePreferences(ApplicationEvent ae) {
if (prefsAction != null) {
ae.setHandled(true);
prefsAction.actionPerformed(new ActionEvent(this, 0, null));
} else {
throw new IllegalStateException("handlePreferences: prefs action is null");
}
}
示例10: handleQuit
import com.apple.eawt.ApplicationEvent; //导入方法依赖的package包/类
public void handleQuit(ApplicationEvent ae) {
if (quitAction != null) {
/*
/ You MUST setHandled(false) if you want to delay or cancel the quit.
/ This is important for cross-platform development -- have a universal quit
/ routine that chooses whether or not to quit, so the functionality is identical
/ on all platforms. This example simply cancels the AppleEvent-based quit and
/ defers to that universal method.
*/
ae.setHandled(false);
quitAction.actionPerformed(new ActionEvent(this, 0, null));
} else {
throw new IllegalStateException("handleQuit: quit action is null");
}
}
示例11: handleAbout
import com.apple.eawt.ApplicationEvent; //导入方法依赖的package包/类
@Override
public void handleAbout(ApplicationEvent event) {
AboutBox myBox = new AboutBox(parent, true);
//myBox.setSize(290, 310);
myBox.setVisible(true);
event.setHandled(true);
}
示例12: handlePreferences
import com.apple.eawt.ApplicationEvent; //导入方法依赖的package包/类
@Override
public void handlePreferences(ApplicationEvent ae) {
if (mainApp != null) {
// mainApp.preferences();
ae.setHandled(true);
} else {
throw new IllegalStateException("handlePreferences: MyApp instance " +
"detached from listener");
}
}
示例13: handlePreferences
import com.apple.eawt.ApplicationEvent; //导入方法依赖的package包/类
@Override
public void handlePreferences(ApplicationEvent ae) {
if (mainApp != null) {
mainApp.preferences();
ae.setHandled(true);
} else {
throw new IllegalStateException("handlePreferences: MyApp instance " + "detached from listener");
}
}
示例14: handleAbout
import com.apple.eawt.ApplicationEvent; //导入方法依赖的package包/类
public void handleAbout(ApplicationEvent e) {
if (aboutBox == null) {
aboutBox = new MacAboutBox();
}
LOG.info("Got About describeChange");
aboutBox.setResizable(false);
aboutBox.setVisible(true);
e.setHandled(true);
}
示例15: handleAbout
import com.apple.eawt.ApplicationEvent; //导入方法依赖的package包/类
public void handleAbout(ApplicationEvent e) {
if (aboutBox == null) {
aboutBox = new MacAboutBox();
}
LOG.info("Got About event");
aboutBox.setVisible(true);
e.setHandled(true);
}