當前位置: 首頁>>代碼示例>>Java>>正文


Java Utilities.disabledActionBeep方法代碼示例

本文整理匯總了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();
     }
 }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:27,代碼來源:GetLeftEditorAction.java

示例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();
     }
 }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:27,代碼來源:GetRightEditorAction.java

示例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();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:ExplorerActionsImpl.java

示例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();
            }
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:24,代碼來源:TreeTableView.java

示例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();
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:25,代碼來源:TreeView.java

示例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
        );
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:StepIntoActionProvider.java

示例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();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:36,代碼來源:CallbackSystemAction.java

示例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();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:15,代碼來源:CallableSystemAction.java

示例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);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:34,代碼來源:TreeView.java

示例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();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:PropertyPanel.java

示例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());
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:47,代碼來源:ListView.java

示例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);
            }
        }
    });
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:46,代碼來源:ProjectAction.java

示例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();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:NbPresenter.java


注:本文中的org.openide.util.Utilities.disabledActionBeep方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。