本文整理匯總了Java中org.openide.util.Utilities.disabledActionBeep方法的典型用法代碼示例。如果您正苦於以下問題:Java Utilities.disabledActionBeep方法的具體用法?Java Utilities.disabledActionBeep怎麽用?Java Utilities.disabledActionBeep使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.openide.util.Utilities
的用法示例。
在下文中一共展示了Utilities.disabledActionBeep方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: actionPerformed
import org.openide.util.Utilities; //導入方法依賴的package包/類
/** Perform the action. Sets/unsets maximzed mode. */
public void actionPerformed(java.awt.event.ActionEvent ev) {
WindowManager wm = WindowManager.getDefault();
MultiViewHandler handler = MultiViews.findMultiViewHandler(wm.getRegistry().getActivated());
if (handler != null) {
MultiViewPerspective pers = handler.getSelectedPerspective();
MultiViewPerspective[] all = handler.getPerspectives();
for (int i = 0; i < all.length; i++) {
if (pers.getDisplayName().equals(all[i].getDisplayName())) {
int newIndex = i != 0 ? i -1 : all.length - 1;
MultiViewDescription selectedDescr = Accessor.DEFAULT.extractDescription(pers);
if (selectedDescr instanceof ContextAwareDescription) {
if (((ContextAwareDescription) selectedDescr).isSplitDescription()) {
newIndex = i > 1 ? i - 2 : all.length - 1;
} else {
newIndex = i != 0 ? i - 2 : all.length - 2;
}
}
handler.requestActive(all[newIndex]);
break;
}
}
} else {
Utilities.disabledActionBeep();
}
}
示例2: actionPerformed
import org.openide.util.Utilities; //導入方法依賴的package包/類
/** Perform the action. Sets/unsets maximzed mode. */
public void actionPerformed(java.awt.event.ActionEvent ev) {
WindowManager wm = WindowManager.getDefault();
MultiViewHandler handler = MultiViews.findMultiViewHandler(wm.getRegistry().getActivated());
if (handler != null) {
MultiViewPerspective pers = handler.getSelectedPerspective();
MultiViewPerspective[] all = handler.getPerspectives();
for (int i = 0; i < all.length; i++) {
if (pers.equals(all[i])) {
int newIndex = i != all.length - 1 ? i + 1 : 0;
MultiViewDescription selectedDescr = Accessor.DEFAULT.extractDescription(pers);
if (selectedDescr instanceof ContextAwareDescription) {
if (((ContextAwareDescription) selectedDescr).isSplitDescription()) {
newIndex = i != all.length - 1 ? i + 2 : 1;
} else {
newIndex = i != all.length - 2 ? i + 2 : 0;
}
}
handler.requestActive(all[newIndex]);
break;
}
}
} else {
Utilities.disabledActionBeep();
}
}
示例3: actionPerformed
import org.openide.util.Utilities; //導入方法依賴的package包/類
@Override
public void actionPerformed(ActionEvent e) {
PasteType[] arr;
synchronized (this) {
arr = this.pasteTypes;
}
if (arr != null && arr.length > 0) {
try {
arr[0].paste();
return;
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
}
Utilities.disabledActionBeep();
}
示例4: actionPerformed
import org.openide.util.Utilities; //導入方法依賴的package包/類
/**
* Invoked when an action occurs.
*/
@Override
public void actionPerformed(ActionEvent e) {
if (treeTable.getSelectedColumn() != ((TreeTable) treeTable).getTreeColumnIndex()) {
return;
}
Node[] nodes = manager.getSelectedNodes();
if (nodes.length == 1) {
Action a = nodes[0].getPreferredAction();
if (a != null) {
if (a.isEnabled()) {
a.actionPerformed(new ActionEvent(nodes[0], ActionEvent.ACTION_PERFORMED, "")); // NOI18N
} else {
Utilities.disabledActionBeep();
}
}
}
}
示例5: performPreferredActionOnNodes
import org.openide.util.Utilities; //導入方法依賴的package包/類
static void performPreferredActionOnNodes(Node[] nodes) {
if (nodes.length > 0) {
Action a = nodes[0].getPreferredAction();
if (a == null) {
return;
}
for (int i=1; i<nodes.length; i++) {
Action ai = nodes[i].getPreferredAction();
if (ai == null || !ai.equals(a)) {
return;
}
}
// switch to replacement action if there is some
a = takeAction(a, nodes);
if (a != null && a.isEnabled()) {
a.actionPerformed(new ActionEvent(
nodes.length == 1 ? nodes[0] : nodes,
ActionEvent.ACTION_PERFORMED, "")); // NOI18N
} else {
Utilities.disabledActionBeep();
}
}
}
示例6: invokeAction
import org.openide.util.Utilities; //導入方法依賴的package包/類
private void invokeAction() {
Project p = MainProjectManager.getDefault ().getMainProject ();
ActionProvider actionProvider = p.getLookup ().lookup (
ActionProvider.class
);
if (Arrays.asList(actionProvider.getSupportedActions ()).contains(ActionProvider.COMMAND_DEBUG_STEP_INTO) &&
actionProvider.isActionEnabled(ActionProvider.COMMAND_DEBUG_STEP_INTO, p.getLookup())) {
actionProvider.invokeAction (
ActionProvider.COMMAND_DEBUG_STEP_INTO,
p.getLookup ()
);
} else {
Utilities.disabledActionBeep();
setEnabled (
ActionsManager.ACTION_STEP_INTO,
false
);
}
}
示例7: actionPerformed
import org.openide.util.Utilities; //導入方法依賴的package包/類
/** Perform the action. Tries the performer and then scans the ActionMap
* of selected topcomponent.
*/
public void actionPerformed(final ActionEvent ev) {
// First try global context action.
final Action action = GlobalManager.getDefault().findGlobalAction(getActionMapKey(), getSurviveFocusChange());
if (action != null) {
if (action.isEnabled()) {
action.actionPerformed(ev);
} else {
Utilities.disabledActionBeep();
}
return;
}
final Object ap = getActionPerformer();
if (ap != null) {
org.openide.util.actions.ActionInvoker.invokeAction(
this, ev, asynchronous(), new Runnable() {
public void run() {
if (ap == getActionPerformer()) {
getActionPerformer().performAction(CallbackSystemAction.this);
}
}
}
);
return;
}
Utilities.disabledActionBeep();
}
示例8: actionPerformed
import org.openide.util.Utilities; //導入方法依賴的package包/類
public void actionPerformed(ActionEvent ev) {
if (isEnabled()) {
org.openide.util.actions.ActionInvoker.invokeAction(
this, ev, asynchronous(), new Runnable() {
public void run() {
performAction();
}
}
);
} else {
// Should not normally happen.
Utilities.disabledActionBeep();
}
}
示例9: mouseClicked
import org.openide.util.Utilities; //導入方法依賴的package包/類
@Override
public void mouseClicked(MouseEvent e) {
tree.stopEditing();
int selRow = tree.getRowForLocation(e.getX(), e.getY());
if ((selRow != -1) && SwingUtilities.isLeftMouseButton(e) && MouseUtils.isDoubleClick(e)) {
// Default action.
if (defaultActionEnabled) {
TreePath selPath = tree.getPathForLocation(e.getX(), e.getY());
Node node = Visualizer.findNode(selPath.getLastPathComponent());
Action a = takeAction(node.getPreferredAction(), node);
if (a != null) {
if (a.isEnabled()) {
a.actionPerformed(new ActionEvent(node, ActionEvent.ACTION_PERFORMED, "")); // NOI18N
} else {
Utilities.disabledActionBeep();
}
e.consume();
return;
}
}
if (tree.isExpanded(selRow)) {
tree.collapseRow(selRow);
} else {
tree.expandRow(selRow);
}
}
}
示例10: actionPerformed
import org.openide.util.Utilities; //導入方法依賴的package包/類
public void actionPerformed(ActionEvent e) {
Action wrapped = getWrapped();
if (wrapped != null) {
wrapped.actionPerformed(e);
} else {
Utilities.disabledActionBeep();
}
}
示例11: performObjectAt
import org.openide.util.Utilities; //導入方法依賴的package包/類
/** This method is called when user double-clicks on some object or
* presses Enter key.
* @param index Index of object in current explored context
*/
final void performObjectAt(int index, int modifiers) {
if ((index < 0) || (index >= model.getSize())) {
return;
}
VisualizerNode v = (VisualizerNode) model.getElementAt(index);
Node node = v.node;
// if DefaultProcessor is set, the default action is notified to it overriding the default action on nodes
if (defaultProcessor != null) {
defaultProcessor.actionPerformed(new ActionEvent(node, 0, null, modifiers));
return;
}
if (showParentNode && NodeListModel.findVisualizerDepth(model, v) == -1) {
try {
manager.setExploredContextAndSelection(node.getParentNode(), new Node[] { node });
} catch (PropertyVetoException ex) {
// OK, let it be
}
return;
}
// on double click - invoke default action, if there is any
// (unless user holds CTRL key what means that we should always dive into the context)
Action a = node.getPreferredAction();
if ((a != null) && ((modifiers & InputEvent.CTRL_MASK) == 0)) {
a = TreeView.takeAction(a, node);
if (a.isEnabled()) {
a.actionPerformed(new ActionEvent(node, ActionEvent.ACTION_PERFORMED, "")); // NOI18N
} else {
Utilities.disabledActionBeep();
}
}
// otherwise dive into the context
else if (traversalAllowed && (!node.isLeaf())) {
manager.setExploredContext(node, manager.getSelectedNodes());
}
}
示例12: runSequentially
import org.openide.util.Utilities; //導入方法依賴的package包/類
static void runSequentially(final Queue<Project> queue, final LookupSensitiveAction a, final String command) {
Project p = queue.remove();
final ActionProvider ap = p.getLookup().lookup(ActionProvider.class);
if (ap == null) {
return;
}
if (!Arrays.asList(ap.getSupportedActions()).contains(command)) {
// #47160: was a supported command (e.g. on a freeform project) but was then removed.
Utilities.disabledActionBeep();
a.resultChanged(null);
return;
}
LogRecord r = new LogRecord(Level.FINE, "PROJECT_ACTION"); // NOI18N
r.setResourceBundle(NbBundle.getBundle(ProjectAction.class));
r.setParameters(new Object[] {
a.getClass().getName(),
p.getClass().getName(),
a.getValue(NAME)
});
r.setLoggerName(UILOG.getName());
UILOG.log(r);
Mutex.EVENT.writeAccess(new Runnable() {
@Override public void run() {
final AtomicBoolean started = new AtomicBoolean();
ap.invokeAction(command, Lookups.singleton(new ActionProgress() {
@Override protected void started() {
started.set(true);
}
@Override public void finished(boolean success) {
if (success && !queue.isEmpty()) { // OK, next...
runSequentially(queue, a, command);
} else { // stopping now; restore natural action enablement state
a.resultChanged(null);
}
}
}));
if (started.get()) {
a.setEnabled(false);
} else if (!queue.isEmpty()) {
// Did not run action for some reason; try others?
runSequentially(queue, a, command);
}
}
});
}
示例13: showHelp
import org.openide.util.Utilities; //導入方法依賴的package包/類
/** Shows a specified HelpCtx in IDE's help window.
* @param helpCtx thehelp to be shown
*/
private static void showHelp(HelpCtx helpCtx) {
if (!helpCtx.display()) {
Utilities.disabledActionBeep();
}
}