本文整理汇总了Java中org.openide.actions.FindAction类的典型用法代码示例。如果您正苦于以下问题:Java FindAction类的具体用法?Java FindAction怎么用?Java FindAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FindAction类属于org.openide.actions包,在下文中一共展示了FindAction类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getActions
import org.openide.actions.FindAction; //导入依赖的package包/类
@NonNull
@Override
public Action[] getActions(final boolean context) {
if (context) {
return super.getActions(context);
} else {
if (actions == null) {
actions = new Action[] {
CommonProjectActions.newFileAction(),
null,
SystemAction.get(FindAction.class),
null,
SystemAction.get(PasteAction.class ),
null,
SystemAction.get(FileSystemAction.class ),
null,
SystemAction.get(ToolsAction.class )
};
}
return actions;
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:MultiModuleNodeFactory.java
示例2: loadAndInitActions
import org.openide.actions.FindAction; //导入依赖的package包/类
private void loadAndInitActions() {
RP.post(new Runnable() {
@Override
public void run() {
createActions();
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
installKBActions();
getActionMap().put("jumpPrev", //NOI18N
action(PREV_ERROR));
getActionMap().put("jumpNext", //NOI18N
action(NEXT_ERROR));
getActionMap().put(FindAction.class.getName(),
action(FIND));
getActionMap().put(
javax.swing.text.DefaultEditorKit.copyAction,
action(COPY));
actionsLoaded = true;
updateActions();
setInputVisible(isInputVisible()); // update action
}
});
}
});
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:OutputTab.java
示例3: createRootNodeActions
import org.openide.actions.FindAction; //导入依赖的package包/类
/**
* Creates actions for package root.
* @return the array of {@link Action}s
*/
@NonNull
static Action[] createRootNodeActions() {
return new Action[] {
CommonProjectActions.newFileAction(),
null,
SystemAction.get( FindAction.class ),
null,
SystemAction.get( PasteAction.class ),
null,
SystemAction.get( FileSystemAction.class ),
null,
SystemAction.get( ToolsAction.class ),
};
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:PackageView.java
示例4: getActions
import org.openide.actions.FindAction; //导入依赖的package包/类
public @Override Action[] getActions(boolean context) {
if (actions == null) {
Set<Action> result = new LinkedHashSet<Action>();
result.add(new EditTestDependencyAction(dep, testType, project));
Action[] superActions = super.getActions(false);
for (int i = 0; i < superActions.length; i++) {
if (superActions[i] instanceof FindAction) {
result.add(superActions[i]);
}
}
result.add(LibrariesChildren.REMOVE_DEPENDENCY_ACTION);
actions = result.toArray(new Action[result.size()]);
}
return actions;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:UnitTestLibrariesNode.java
示例5: getActions
import org.openide.actions.FindAction; //导入依赖的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),
};
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:LibrariesNode.java
示例6: isFindAction
import org.openide.actions.FindAction; //导入依赖的package包/类
private static boolean isFindAction(final Action action) {
if (action == null) {
return false;
}
if (action instanceof FindAction) {
return true;
}
if ("org.openide.actions.FindAction".equals(action.getValue("key"))) { //NOI18N
return true;
}
return false;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:ActionFilterNode.java
示例7: test61245
import org.openide.actions.FindAction; //导入依赖的package包/类
/**
* Issue #61245: Delegate application/*+xml -> text/xml
*/
public void test61245(){
MimeLookup lookup = MimeLookup.getMimeLookup("application/xml");
checkLookupObject(lookup, FindAction.class, true);
lookup = MimeLookup.getMimeLookup("application/xhtml+xml");
checkLookupObject(lookup, CutAction.class, true);
checkLookupObject(lookup, FindAction.class, false);
checkLookupObject(lookup, ReplaceAction.class, true);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:Depr_MimeLookupInheritanceTest.java
示例8: testAntXmlPopup
import org.openide.actions.FindAction; //导入依赖的package包/类
public void testAntXmlPopup(){
MimeLookup lookup = MimeLookup.getMimeLookup("text/xml"); //NOI18N
Class layerObjects[] = {CutAction.class, CopyAction.class, PasteAction.class, ReplaceAction.class};
testPopupItems(lookup, layerObjects);
lookup = MimeLookup.getMimeLookup("text/x-ant+xml"); //NOI18N
Class layerObjects2[] = {CutAction.class, CopyAction.class, PasteAction.class, ReplaceAction.class, FindAction.class};
testPopupItems(lookup, layerObjects2);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:Depr_MimeLookupInheritanceTest.java
示例9: initActions
import org.openide.actions.FindAction; //导入依赖的package包/类
private Action[] initActions () {
if (actionCache == null) {
List<Action> result = new ArrayList<Action>(2);
if (mode == Mode.FILE) {
for (Action superAction : super.getActions(false)) {
if (isOpenAction(superAction)) {
result.add(superAction);
}
}
result.add (SystemAction.get(ShowJavadocAction.class));
}
else if (mode.isFolder()) {
result.add (SystemAction.get(ShowJavadocAction.class));
Action[] superActions = super.getActions(false);
for (int i=0; i<superActions.length; i++) {
if (superActions[i] instanceof FindAction) {
result.add (superActions[i]);
}
}
if (mode.isRoot()) {
result.add (SystemAction.get(RemoveClassPathRootAction.class));
}
if (mode == Mode.EDITABLE_ROOT) {
result.add (SystemAction.get(EditRootAction.class));
}
}
actionCache = result.toArray(new Action[result.size()]);
}
return actionCache;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:31,代码来源:ActionFilterNode.java
示例10: setupActions
import org.openide.actions.FindAction; //导入依赖的package包/类
/**
* Sets up action Find that it is activated/deactivated appropriately
* and so that it does what it should do.
*/
private void setupActions() {
JTable bundleTable = ((BundleEditPanel) getComponent(0)).getTable();
FindAction findAction = SystemAction.get(FindAction.class);
Action action = FindPerformer.getFindPerformer(bundleTable);
getActionMap().put(findAction.getActionMapKey(), action);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:PropertiesOpen.java
示例11: FindActionManager
import org.openide.actions.FindAction; //导入依赖的package包/类
private FindActionManager() {
super(FindInFilesAction.Selection.class, FindAction.class);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:ActionManager.java
示例12: testDynamicChangeInPopupFolders
import org.openide.actions.FindAction; //导入依赖的package包/类
/** Testing Base level popup items lookup and sorting */
@RandomlyFails // NB-Core-Build #4599: resultChangedCount is:2 instead of 1
public void testDynamicChangeInPopupFolders() throws Exception {
final int resultChangedCount[] = new int[1];
resultChangedCount[0] = 0;
MimePath mp = MimePath.parse("text/x-java/text/xml/text/html");
Lookup lookup = getLookup(mp);
Lookup.Result result = lookup.lookup(new Template(PopupActions.class));
result.allInstances(); // remove this line if issue #60010 is fixed
LookupListener listener = new LookupListener(){
public void resultChanged(LookupEvent ev){
resultChangedCount[0]++;
}
};
result.addLookupListener(listener);
PopupActions actions = (PopupActions) lookup.lookup(PopupActions.class);
assertTrue("PopupActions should be found", actions != null);
List popupActions = actions.getPopupActions();
int size = popupActions.size();
assertTrue("Number of PopupActions found:"+size+" and should be:"+fsstruct.length, size == fsstruct.length);
//delete RenameAction
TestUtilities.deleteFile(getWorkDir(),
"Editors/text/html/Popup/org-openide-actions-RenameAction.instance");
checkPopupItemPresence(lookup, RenameAction.class, false);
// check firing the change
assertTrue(("resultChangedCount is:"+resultChangedCount[0]+" instead of 1"),resultChangedCount[0] == 1);
resultChangedCount[0] = 0;
//delete base CutAction
TestUtilities.deleteFile(getWorkDir(),
"Editors/Popup/org-openide-actions-CutAction.instance");
checkPopupItemPresence(lookup, CutAction.class, false);
// check firing the change
assertTrue(("resultChangedCount is:"+resultChangedCount[0]+" instead of 1"),resultChangedCount[0] == 1);
resultChangedCount[0] = 0;
//simulate module installation, new action will be added
TestUtilities.createFile(getWorkDir(),
"Editors/Popup/org-openide-actions-FindAction.instance"); //NOI18N
checkPopupItemPresence(lookup, FindAction.class, true);
// check firing the change
assertTrue(("resultChangedCount is:"+resultChangedCount[0]+" instead of 1"),resultChangedCount[0] == 1);
resultChangedCount[0] = 0;
//simulate module installation, new action will be added
TestUtilities.createFile(getWorkDir(),
"Editors/text/x-java/text/xml/text/html/Popup/org-openide-actions-ReplaceAction.instance"); //NOI18N
checkPopupItemPresence(lookup, ReplaceAction.class, true);
//ReplaceAction was created in the uppermost folder
// let's try it is missing in the lower lookup
mp = MimePath.get(MimePath.get("text/x-java"), "text/xml");
lookup = getLookup(mp);
checkPopupItemPresence(lookup, ReplaceAction.class, false);
checkPopupItemPresence(lookup, FindAction.class, true);
// lookup for ReplaceAction in the folder that doesn't exist
lookup = MimeLookup.getLookup("text/html"); //NOI18N
checkPopupItemPresence(lookup, ReplaceAction.class, false);
// create folder with ReplaceAction
TestUtilities.createFile(getWorkDir(),
"Editors/text/html/Popup/org-openide-actions-ReplaceAction.instance"); //NOI18N
checkPopupItemPresence(lookup, ReplaceAction.class, true);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:75,代码来源:MimeLookupPopupItemsChangeTest.java
示例13: testDynamicChangeInPopupFolders
import org.openide.actions.FindAction; //导入依赖的package包/类
/** Testing Base level popup items lookup and sorting */
@RandomlyFails // NB-Core-Build #3718
public void testDynamicChangeInPopupFolders() throws IOException{
final int resultChangedCount[] = new int[1];
resultChangedCount[0] = 0;
MimeLookup lookup = MimeLookup.getMimeLookup("text/x-java").childLookup("text/xml"). //NOI18N
childLookup("text/html"); //NOI18N
Lookup.Result result = lookup.lookup(new Template(PopupActions.class));
result.allInstances(); // remove this line if issue #60010 is fixed
LookupListener listener = new LookupListener(){
public void resultChanged(LookupEvent ev){
resultChangedCount[0]++;
}
};
result.addLookupListener(listener);
PopupActions actions = (PopupActions) lookup.lookup(PopupActions.class);
assertTrue("PopupActions should be found", actions != null);
List popupActions = actions.getPopupActions();
int size = popupActions.size();
assertTrue("Number of PopupActions found:"+size+" and should be:"+fsstruct.length, size == fsstruct.length);
//delete RenameAction
TestUtilities.deleteFile(getWorkDir(),
"Editors/text/html/Popup/org-openide-actions-RenameAction.instance");
checkPopupItemPresence(lookup, RenameAction.class, false);
// check firing the change
assertTrue(("resultChangedCount is:"+resultChangedCount[0]+" instead of 1"),resultChangedCount[0] == 1);
resultChangedCount[0] = 0;
//delete base CutAction
TestUtilities.deleteFile(getWorkDir(),
"Editors/Popup/org-openide-actions-CutAction.instance");
checkPopupItemPresence(lookup, CutAction.class, false);
// check firing the change
assertTrue(("resultChangedCount is:"+resultChangedCount[0]+" instead of 1"),resultChangedCount[0] == 1);
resultChangedCount[0] = 0;
//simulate module installation, new action will be added
TestUtilities.createFile(getWorkDir(),
"Editors/Popup/org-openide-actions-FindAction.instance"); //NOI18N
checkPopupItemPresence(lookup, FindAction.class, true);
// check firing the change
assertTrue(("resultChangedCount is:"+resultChangedCount[0]+" instead of 1"),resultChangedCount[0] == 1);
resultChangedCount[0] = 0;
//simulate module installation, new action will be added
TestUtilities.createFile(getWorkDir(),
"Editors/text/x-java/text/xml/text/html/Popup/org-openide-actions-ReplaceAction.instance"); //NOI18N
checkPopupItemPresence(lookup, ReplaceAction.class, true);
//ReplaceAction was created in the uppermost folder
// let's try it is missing in the lower lookup
lookup = MimeLookup.getMimeLookup("text/x-java").childLookup("text/xml"); //NOI18N
checkPopupItemPresence(lookup, ReplaceAction.class, false);
checkPopupItemPresence(lookup, FindAction.class, true);
// lookup for ReplaceAction in the folder that doesn't exist
lookup = MimeLookup.getMimeLookup("text/html"); //NOI18N
checkPopupItemPresence(lookup, ReplaceAction.class, false);
// create folder with ReplaceAction
TestUtilities.createFile(getWorkDir(),
"Editors/text/html/Popup/org-openide-actions-ReplaceAction.instance"); //NOI18N
checkPopupItemPresence(lookup, ReplaceAction.class, true);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:74,代码来源:Depr_MimeLookupPopupItemsChangeTest.java
示例14: getFindActionMapKey
import org.openide.actions.FindAction; //导入依赖的package包/类
public static String getFindActionMapKey() {
return SharedClassObject.findObject(FindAction.class, true).getActionMapKey().toString();
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:DashboardUtils.java
注:本文中的org.openide.actions.FindAction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论