本文整理匯總了Java中com.intellij.codeInspection.ui.actions.InvokeQuickFixAction類的典型用法代碼示例。如果您正苦於以下問題:Java InvokeQuickFixAction類的具體用法?Java InvokeQuickFixAction怎麽用?Java InvokeQuickFixAction使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
InvokeQuickFixAction類屬於com.intellij.codeInspection.ui.actions包,在下文中一共展示了InvokeQuickFixAction類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createRightActionsToolbar
import com.intellij.codeInspection.ui.actions.InvokeQuickFixAction; //導入依賴的package包/類
@SuppressWarnings({"NonStaticInitializer"})
private JComponent createRightActionsToolbar() {
myIncludeAction = new AnAction(InspectionsBundle.message("inspections.result.view.include.action.text")){
{
registerCustomShortcutSet(CommonShortcuts.INSERT, myTree);
}
@Override
public void actionPerformed(AnActionEvent e) {
final TreePath[] paths = myTree.getSelectionPaths();
if (paths != null) {
for (TreePath path : paths) {
((InspectionTreeNode)path.getLastPathComponent()).amnesty();
}
}
updateView(false);
}
@Override
public void update(final AnActionEvent e) {
final TreePath[] paths = myTree.getSelectionPaths();
e.getPresentation().setEnabled(paths != null && paths.length > 0 &&
!myGlobalInspectionContext.getUIOptions().FILTER_RESOLVED_ITEMS);
}
};
myExcludeAction = new AnAction(InspectionsBundle.message("inspections.result.view.exclude.action.text")) {
{
registerCustomShortcutSet(CommonShortcuts.getDelete(), myTree);
}
@Override
public void actionPerformed(final AnActionEvent e) {
final TreePath[] paths = myTree.getSelectionPaths();
if (paths != null) {
for (TreePath path : paths) {
((InspectionTreeNode)path.getLastPathComponent()).ignoreElement();
}
}
updateView(false);
}
@Override
public void update(final AnActionEvent e) {
final TreePath[] path = myTree.getSelectionPaths();
e.getPresentation().setEnabled(path != null && path.length > 0);
}
};
DefaultActionGroup specialGroup = new DefaultActionGroup();
specialGroup.add(myGlobalInspectionContext.getUIOptions().createGroupBySeverityAction(this));
specialGroup.add(myGlobalInspectionContext.getUIOptions().createGroupByDirectoryAction(this));
specialGroup.add(myGlobalInspectionContext.getUIOptions().createFilterResolvedItemsAction(this));
specialGroup.add(myGlobalInspectionContext.getUIOptions().createShowOutdatedProblemsAction(this));
specialGroup.add(myGlobalInspectionContext.getUIOptions().createShowDiffOnlyAction(this));
specialGroup.add(new EditSettingsAction());
specialGroup.add(new InvokeQuickFixAction(this));
specialGroup.add(new InspectionsOptionsToolbarAction(this));
return createToolbar(specialGroup);
}
示例2: createRightActionsToolbar
import com.intellij.codeInspection.ui.actions.InvokeQuickFixAction; //導入依賴的package包/類
@SuppressWarnings({"NonStaticInitializer"})
private JComponent createRightActionsToolbar() {
myIncludeAction = new AnAction(InspectionsBundle.message("inspections.result.view.include.action.text")){
{
registerCustomShortcutSet(CommonShortcuts.INSERT, myTree);
}
@Override
public void actionPerformed(AnActionEvent e) {
((InspectionTreeNode)myTree.getSelectionPath().getLastPathComponent()).amnesty();
updateView(false);
}
@Override
public void update(final AnActionEvent e) {
final TreePath path = myTree.getSelectionPath();
e.getPresentation().setEnabled(path != null && !myGlobalInspectionContext.getUIOptions().FILTER_RESOLVED_ITEMS);
}
};
myExcludeAction = new AnAction(InspectionsBundle.message("inspections.result.view.exclude.action.text")) {
{
registerCustomShortcutSet(CommonShortcuts.DELETE, myTree);
}
@Override
public void actionPerformed(final AnActionEvent e) {
((InspectionTreeNode)myTree.getSelectionPath().getLastPathComponent()).ignoreElement();
updateView(false);
}
@Override
public void update(final AnActionEvent e) {
final TreePath path = myTree.getSelectionPath();
e.getPresentation().setEnabled(path != null);
}
};
DefaultActionGroup specialGroup = new DefaultActionGroup();
specialGroup.add(myGlobalInspectionContext.getUIOptions().createGroupBySeverityAction(this));
specialGroup.add(myGlobalInspectionContext.getUIOptions().createGroupByDirectoryAction(this));
specialGroup.add(myGlobalInspectionContext.getUIOptions().createFilterResolvedItemsAction(this));
specialGroup.add(myGlobalInspectionContext.getUIOptions().createShowOutdatedProblemsAction(this));
specialGroup.add(myGlobalInspectionContext.getUIOptions().createShowDiffOnlyAction(this));
specialGroup.add(new EditSettingsAction());
specialGroup.add(new InvokeQuickFixAction(this));
specialGroup.add(new InspectionsOptionsToolbarAction(this));
return createToolbar(specialGroup);
}