本文整理汇总了Java中org.openide.util.actions.NodeAction类的典型用法代码示例。如果您正苦于以下问题:Java NodeAction类的具体用法?Java NodeAction怎么用?Java NodeAction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NodeAction类属于org.openide.util.actions包,在下文中一共展示了NodeAction类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initToolbar
import org.openide.util.actions.NodeAction; //导入依赖的package包/类
private void initToolbar() {
Toolbar toolbar = new Toolbar();
Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N
toolbar.setBorder(b);
this.add(toolbar, BorderLayout.NORTH);
toolbar.add(ImportAction.get(ImportAction.class));
toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup()));
toolbar.add(SaveAllAction.get(SaveAllAction.class));
toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup()));
toolbar.add(RemoveAllAction.get(RemoveAllAction.class));
toolbar.add(GarbageCollectAction.get(GarbageCollectAction.class).getToolbarPresenter());
for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) {
tb.setVisible(false);
}
}
示例2: initToolbar
import org.openide.util.actions.NodeAction; //导入依赖的package包/类
private void initToolbar() {
Toolbar toolbar = new Toolbar();
Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N
toolbar.setBorder(b);
this.add(toolbar, BorderLayout.NORTH);
toolbar.add(ImportAction.get(ImportAction.class));
toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup()));
toolbar.add(SaveAllAction.get(SaveAllAction.class));
toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup()));
toolbar.add(RemoveAllAction.get(RemoveAllAction.class));
toolbar.add(GarbageCollectAction.get(GarbageCollectAction.class).getToolbarPresenter());
for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) {
tb.setVisible(false);
}
}
示例3: initToolbar
import org.openide.util.actions.NodeAction; //导入依赖的package包/类
private void initToolbar() {
Toolbar toolbar = new Toolbar();
Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N
toolbar.setBorder(b);
this.add(toolbar, BorderLayout.NORTH);
toolbar.add(ImportAction.get(ImportAction.class));
toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup()));
toolbar.add(RemoveAllAction.get(RemoveAllAction.class));
toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup()));
toolbar.add(SaveAllAction.get(SaveAllAction.class));
toolbar.add(StructuredViewAction.get(StructuredViewAction.class).getToolbarPresenter());
for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) {
tb.setVisible(false);
}
initOrganizers();
}
示例4: isMethodOverridden
import org.openide.util.actions.NodeAction; //导入依赖的package包/类
private boolean isMethodOverridden(NodeAction d, String name) {
try {
Method m = d.getClass().getMethod(name, new Class[0]);
return m.getDeclaringClass() != CallableSystemAction.class;
} catch (java.lang.NoSuchMethodException ex) {
ex.printStackTrace();
throw new IllegalStateException("Error searching for method " + name + " in " + d); // NOI18N
}
}
示例5: performAction
import org.openide.util.actions.NodeAction; //导入依赖的package包/类
protected void performAction(Node[] activatedNodes) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JrxmlVisualView view = IReportManager.getInstance().getActiveVisualView();
ReportObjectScene scene = view.getReportDesignerPanel().getScene();
// Find the backgound image layer...
BackgroundImageLayer layer = BackgroundImageUtilities.getBackgroundImageLayer(view, false);
JasperDesign jd = view.getModel().getJasperDesign();
jd.removeProperty("ireport.background.image");
jd.removeProperty("ireport.background.image.properties");
if (layer != null)
{
layer.removeChildren();
scene.validate();
scene.revalidate(true);
}
(SystemAction.get(ShowBackgroundImageAction.class)).resultChanged(null);
firePropertyChange(NodeAction.PROP_ENABLED,true ,false);
IReportManager.getInstance().notifyReportChange();
BackgroundImageUtilities.notifyBackgroundOptionsChange();
setEnabled(false);
}
});
}
示例6: IndexedEditorPanel
import org.openide.util.actions.NodeAction; //导入依赖的package包/类
/** Creates new form IndexedEditorPanel */
public IndexedEditorPanel(Node node, Node.Property[] props) {
initComponents();
detailsPanel.setLayout(new java.awt.BorderLayout());
getExplorerManager().setRootContext(node);
rootNode = node;
prop = props[0];
getExplorerManager().addPropertyChangeListener(this);
treeTableView1.setProperties(props);
treeTableView1.setRootVisible(false);
treeTableView1.setDefaultActionAllowed(false);
treeTableView1.setTreePreferredWidth(200);
node.addPropertyChangeListener(this);
try {
moveUp = (NodeAction)SystemAction.get(Class.forName("org.openide.actions.MoveUpAction")); // NOI18N
moveDown = (NodeAction)SystemAction.get(Class.forName("org.openide.actions.MoveDownAction")); // NOI18N
newAction = (NodeAction)SystemAction.get(Class.forName("org.openide.actions.NewAction")); // NOI18N
} catch (ClassNotFoundException cnfe) {
}
java.util.ResourceBundle bundle = NbBundle.getBundle(IndexedEditorPanel.class);
propertiesLabel.setDisplayedMnemonic(bundle.getString("CTL_Properties_Mnemonic").charAt(0));
newButton.setMnemonic(bundle.getString("CTL_New_Mnemonic").charAt(0));
deleteButton.setMnemonic(bundle.getString("CTL_Delete_Mnemonic").charAt(0));
upButton.setMnemonic(bundle.getString("CTL_MoveUp_Mnemonic").charAt(0));
downButton.setMnemonic(bundle.getString("CTL_MoveDown_Mnemonic").charAt(0));
treeTableView1.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_Properties"));
newButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_New"));
deleteButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_Delete"));
upButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_MoveUp"));
downButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_MoveDown"));
getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_IndexedEditorPanel"));
}
示例7: IndexedEditorPanel
import org.openide.util.actions.NodeAction; //导入依赖的package包/类
/** Creates new form IndexedEditorPanel */
public IndexedEditorPanel(Node node, Node.Property[] props) {
treeTableView1 = new TreeTableView();
// install proper border
setBorder((Border) UIManager.get("Nb.ScrollPane.border")); // NOI18N
initComponents();
propertiesLabel.setLabelFor(treeTableView1);
jPanel2.setLayout(new java.awt.BorderLayout());
jPanel2.add(treeTableView1);
detailsPanel.setLayout(new java.awt.BorderLayout());
getExplorerManager().setRootContext(node);
rootNode = node;
prop = props[0];
getExplorerManager().addPropertyChangeListener(this);
treeTableView1.setProperties(props);
treeTableView1.setRootVisible(false);
treeTableView1.setDefaultActionAllowed(false);
treeTableView1.setTreePreferredWidth(200);
node.addPropertyChangeListener(this);
try {
ClassLoader l = Lookup.getDefault().lookup(ClassLoader.class);
if (l == null) {
l = Thread.currentThread().getContextClassLoader();
}
if (l == null) {
l = getClass().getClassLoader();
}
selectedLookup = org.openide.util.lookup.Lookups.proxy(this);
NodeAction globalMoveUp = SystemAction.get(Class.forName("org.openide.actions.MoveUpAction", true, l).asSubclass(NodeAction.class)); // NOI18N
NodeAction globalMoveDown = SystemAction.get(Class.forName("org.openide.actions.MoveDownAction", true, l).asSubclass(NodeAction.class)); // NOI18N
NodeAction globalNewAction = SystemAction.get(Class.forName("org.openide.actions.NewAction", true, l).asSubclass(NodeAction.class)); // NOI18N
// Get context aware instances.
moveUp = globalMoveUp.createContextAwareInstance(selectedLookup);
moveDown = globalMoveDown.createContextAwareInstance(selectedLookup);
newAction = globalNewAction.createContextAwareInstance(selectedLookup);
} catch (ClassNotFoundException cnfe) {
LOG.log(Level.INFO, "Maybe missing openide.actions module?", cnfe);
}
java.util.ResourceBundle bundle = NbBundle.getBundle(IndexedEditorPanel.class);
treeTableView1.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_Properties"));
newButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_New"));
deleteButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_Delete"));
upButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_MoveUp"));
downButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_MoveDown"));
getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_IndexedEditorPanel"));
}
示例8: DelegateAction
import org.openide.util.actions.NodeAction; //导入依赖的package包/类
public DelegateAction(NodeAction a, Lookup actionContext) {
this.delegate = a;
this.model = new ActSubMenuModel(actionContext);
}