本文整理汇总了Java中org.openide.util.actions.SystemAction.get方法的典型用法代码示例。如果您正苦于以下问题:Java SystemAction.get方法的具体用法?Java SystemAction.get怎么用?Java SystemAction.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.util.actions.SystemAction
的用法示例。
在下文中一共展示了SystemAction.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetActions
import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
public void testGetActions () throws Exception {
final SystemAction[] arr1 = {
SystemAction.get (PropertiesAction.class)
};
final SystemAction[] arr2 = {
};
AbstractNode an = new AbstractNode (Children.LEAF) {
@Override
public SystemAction[] getActions () {
return arr1;
}
@Override
public SystemAction[] getContextActions () {
return arr2;
}
};
assertEquals ("getActions(false) properly delegates to getActions()", arr1, an.getActions (false));
assertEquals ("getActions(true) properly delegates to getContextActions()", arr2, an.getActions (true));
}
示例2: getActions
import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
public Action[] getActions(boolean context) {
if (catalog instanceof CatalogWriter)
return new Action[] {
SystemAction.get(AddCatalogEntryAction.class),
SystemAction.get(RefreshAction.class),
SystemAction.get(CatalogNode.UnmountAction.class),
null,
//??? #24349 CustimizeAction sometimes added by BeanNode here
SystemAction.get(PropertiesAction.class)
};
else
return new Action[] {
SystemAction.get(RefreshAction.class),
SystemAction.get(CatalogNode.UnmountAction.class),
null,
//??? #24349 CustimizeAction sometimes added by BeanNode here
SystemAction.get(PropertiesAction.class)
};
}
示例3: getActions
import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
@Override
public Action[] getActions(boolean context) {
if ( context ) {
return super.getActions(context);
} else {
return new SystemAction[] {
SystemAction.get(CreateDatabaseAction.class),
SystemAction.get(StartAction.class),
SystemAction.get(StopAction.class),
SystemAction.get(ConnectServerAction.class),
SystemAction.get(DisconnectServerAction.class),
SystemAction.get(DeleteAction.class),
SystemAction.get(RefreshServerAction.class),
SystemAction.get(AdministerAction.class),
SystemAction.get(PropertiesAction.class)
};
}
}
示例4: testIconsSystemAction24
import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
/**
* Test whether pressed, rollover and disabled 24x24 icons
* work for SystemAction.
*/
public void testIconsSystemAction24() throws Exception {
Action saInstance = SystemAction.get(TestSystemAction.class);
JButton jb = new JButton();
jb.putClientProperty("PreferredIconSize",new Integer(24));
Actions.connect(jb, saInstance);
Icon icon = jb.getIcon();
assertNotNull(icon);
checkIfLoadedCorrectIcon(icon, jb, 4, "Enabled icon");
Icon rolloverIcon = jb.getRolloverIcon();
assertNotNull(rolloverIcon);
checkIfLoadedCorrectIcon(rolloverIcon, jb, 5, "Rollover icon");
Icon pressedIcon = jb.getPressedIcon();
assertNotNull(pressedIcon);
checkIfLoadedCorrectIcon(pressedIcon, jb, 6, "Pressed icon");
Icon disabledIcon = jb.getDisabledIcon();
assertNotNull(disabledIcon);
checkIfLoadedCorrectIcon(disabledIcon, jb, 7, "Disabled icon");
}
示例5: getProvider
import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
public static ShelveChangesActionProvider getProvider () {
if (ACTION_PROVIDER == null) {
ACTION_PROVIDER = new ShelveChangesActionProvider() {
@Override
public Action getAction () {
Action a = SystemAction.get(SaveStashAction.class);
Utils.setAcceleratorBindings("Actions/Git", a); //NOI18N
return a;
}
@Override
public JComponent[] getUnshelveActions (VCSContext ctx, boolean popup) {
JComponent[] cont = UnshelveMenu.getInstance().getMenu(ctx, popup);
if (cont == null) {
cont = super.getUnshelveActions(ctx, popup);
}
return cont;
}
};
}
return ACTION_PROVIDER;
}
示例6: getActions
import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public Action[] getActions(boolean context) {
if (!context) {
return new Action[]{
getPreferredAction(),
SystemAction.get(HideResultAction.class)
};
} else {
return new Action[0];
}
}
示例7: setUp
import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
protected void setUp() throws Exception {
global = SystemAction.get(actionClass());
map = new ActionMap ();
map.put (actionKey (), action);
lookup = Lookups.singleton(map);
// Retrieve context sensitive action instance if possible.
clone = global.createContextAwareInstance(lookup);
listener = new CntListener ();
clone.addPropertyChangeListener(listener);
}
示例8: testEnable
import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
private void testEnable (final PropertySet [] pros) throws Exception {
Node n = new AbstractNode (Children.LEAF) {
public PropertySet [] getPropertySets () {
return pros;
}
};
assertEquals ("Node has the given properties.", pros, n.getPropertySets ());
PropertiesAction pa = SystemAction.get(PropertiesAction.class);
Action a = pa.createContextAwareInstance (n.getLookup ());
assertTrue ("PropertiesAction is enabled.", a.isEnabled ());
}
示例9: getPreferredAction
import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
@Override
public Action getPreferredAction() {
if ((node.getInformation().getStatus() & FileInformation.STATUS_VERSIONED_CONFLICT) != 0) {
return SystemAction.get(ResolveConflictsAction.class);
}
return SystemAction.get(DiffAction.class);
}
示例10: getActions
import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
public Action[] getActions(boolean context) {
return new Action[]{
new EditDependencyAction(dep.getModuleEntry().getCodeNameBase(), project),
SystemAction.get(FindAction.class),
new ShowJavadocAction(dep, project),
SystemAction.get(RemoveAction.class),
};
}
示例11: getActions
import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
@Override
public Action[] getActions(boolean context) {
if ( context ) {
return super.getActions(context);
} else {
return new SystemAction[] {
SystemAction.get(ConnectAction.class),
SystemAction.get(DeleteAction.class)
};
}
}
示例12: getProvider
import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
public static ShelveChangesActionProvider getProvider () {
if (ACTION_PROVIDER == null) {
ACTION_PROVIDER = new ShelveChangesActionProvider() {
@Override
public Action getAction () {
Action a = SystemAction.get(ShelveChangesAction.class);
Utils.setAcceleratorBindings("Actions/Mercurial", a); //NOI18N
return a;
}
};
};
return ACTION_PROVIDER;
}
示例13: undo
import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
private void undo() throws Exception {
final UndoAction ua = SystemAction.get(UndoAction.class);
assertNotNull("Cannot obtain UndoAction", ua);
while (ua.isEnabled()) {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
ua.performAction();
}
});
}
}
示例14: getActions
import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
@Override
public Action[] getActions(boolean context) {
return new Action[]{SystemAction.get(OpenAction.class)};
}
示例15: getActions
import org.openide.util.actions.SystemAction; //导入方法依赖的package包/类
@Override
public Action[] getActions(boolean context) {
return new Action[] {
SystemAction.get(RefreshAction.class)
};
}