本文整理汇总了Java中com.intellij.openapi.actionSystem.AnSeparator类的典型用法代码示例。如果您正苦于以下问题:Java AnSeparator类的具体用法?Java AnSeparator怎么用?Java AnSeparator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AnSeparator类属于com.intellij.openapi.actionSystem包,在下文中一共展示了AnSeparator类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createToolbarActions
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
@Nonnull
@Override
protected List<AnAction> createToolbarActions() {
List<AnAction> group = new ArrayList<>();
group.add(new MyIgnorePolicySettingAction());
group.add(new MyHighlightPolicySettingAction());
group.add(new MyToggleExpandByDefaultAction());
group.add(new MyToggleAutoScrollAction());
group.add(new MyEditorReadOnlyLockAction());
group.add(myEditorSettingsAction);
group.add(AnSeparator.getInstance());
group.add(new TextShowPartialDiffAction(PartialDiffMode.LEFT_BASE));
group.add(new TextShowPartialDiffAction(PartialDiffMode.BASE_RIGHT));
group.add(new TextShowPartialDiffAction(PartialDiffMode.LEFT_RIGHT));
group.add(AnSeparator.getInstance());
group.addAll(super.createToolbarActions());
return group;
}
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:SimpleThreesideDiffViewer.java
示例2: createPopupActions
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
@Nonnull
@Override
protected List<AnAction> createPopupActions() {
List<AnAction> group = new ArrayList<>();
group.add(AnSeparator.getInstance());
group.add(new MyIgnorePolicySettingAction().getPopupGroup());
//group.add(Separator.getInstance());
//group.add(new MyHighlightPolicySettingAction().getPopupGroup());
group.add(AnSeparator.getInstance());
group.add(new MyToggleAutoScrollAction());
group.add(new MyToggleExpandByDefaultAction());
group.add(AnSeparator.getInstance());
group.addAll(super.createPopupActions());
return group;
}
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:SimpleThreesideDiffViewer.java
示例3: getChildren
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
@Nonnull
@Override
public AnAction[] getChildren(@Nullable AnActionEvent e) {
List<AnAction> actions = ContainerUtil.newArrayList();
if (e != null) {
if (e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES) != null) {
actions.add(new AnSeparator("Highlight"));
for (VcsLogHighlighterFactory factory : Extensions.getExtensions(VcsLogUiImpl.LOG_HIGHLIGHTER_FACTORY_EP, e.getProject())) {
if (factory.showMenuItem()) {
actions.add(new EnableHighlighterAction(factory));
}
}
}
}
return actions.toArray(new AnAction[actions.size()]);
}
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:HighlightersActionGroup.java
示例4: getComponentAction
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
@Nullable
public AnAction getComponentAction(){
if (myComponent instanceof AnSeparator){
return AnSeparator.getInstance();
}
if (myComponent instanceof String){
return ActionManager.getInstance().getAction((String)myComponent);
}
if (myComponent instanceof Group){
final String id = ((Group)myComponent).getId();
if (id == null || id.length() == 0){
return ((Group)myComponent).constructActionGroup(true);
}
return ActionManager.getInstance().getAction(id);
}
return null;
}
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:ActionUrl.java
示例5: readExternal
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
public void readExternal(Element element) throws InvalidDataException {
myGroupPath = new ArrayList<String>();
for (Object o : element.getChildren(PATH)) {
myGroupPath.add(((Element)o).getAttributeValue(VALUE));
}
final String attributeValue = element.getAttributeValue(VALUE);
if (element.getAttributeValue(IS_ACTION) != null) {
myComponent = attributeValue;
}
else if (element.getAttributeValue(SEPARATOR) != null) {
myComponent = AnSeparator.getInstance();
}
else if (element.getAttributeValue(IS_GROUP) != null) {
final AnAction action = ActionManager.getInstance().getAction(attributeValue);
myComponent = action instanceof ActionGroup
? ActionsTreeUtil.createGroup((ActionGroup)action, true, null)
: new Group(attributeValue, attributeValue, null);
}
myActionType = Integer.parseInt(element.getAttributeValue(ACTION_TYPE));
myAbsolutePosition = Integer.parseInt(element.getAttributeValue(POSITION));
DefaultJDOMExternalizer.readExternal(this, element);
}
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:ActionUrl.java
示例6: writeExternal
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
public void writeExternal(Element element) throws WriteExternalException {
for (String s : myGroupPath) {
Element path = new Element(PATH);
path.setAttribute(VALUE, s);
element.addContent(path);
}
if (myComponent instanceof String) {
element.setAttribute(VALUE, (String)myComponent);
element.setAttribute(IS_ACTION, Boolean.TRUE.toString());
}
else if (myComponent instanceof AnSeparator) {
element.setAttribute(SEPARATOR, Boolean.TRUE.toString());
}
else if (myComponent instanceof Group) {
final String groupId = ((Group)myComponent).getId() != null && ((Group)myComponent).getId().length() != 0
? ((Group)myComponent).getId()
: ((Group)myComponent).getName();
element.setAttribute(VALUE, groupId != null ? groupId : "");
element.setAttribute(IS_GROUP, Boolean.TRUE.toString());
}
element.setAttribute(ACTION_TYPE, Integer.toString(myActionType));
element.setAttribute(POSITION, Integer.toString(myAbsolutePosition));
DefaultJDOMExternalizer.writeExternal(this, element);
}
开发者ID:consulo,项目名称:consulo,代码行数:25,代码来源:ActionUrl.java
示例7: enableSetIconButton
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
protected void enableSetIconButton(ActionManager actionManager) {
final TreePath selectionPath = myTree.getSelectionPath();
Object userObject = null;
if (selectionPath != null) {
userObject = ((DefaultMutableTreeNode)selectionPath.getLastPathComponent()).getUserObject();
if (userObject instanceof String) {
final AnAction action = actionManager.getAction((String)userObject);
if (action != null &&
action.getTemplatePresentation() != null &&
action.getTemplatePresentation().getIcon() != null) {
mySetIconButton.setEnabled(true);
return;
}
}
}
mySetIconButton.setEnabled(myTextField.getText().length() != 0 &&
selectionPath != null &&
new DefaultMutableTreeNode(selectionPath).isLeaf() &&
!(userObject instanceof AnSeparator));
}
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:CustomizableActionsPanel.java
示例8: AnnotateActionGroup
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
public AnnotateActionGroup(@Nonnull List<AnnotationFieldGutter> gutters,
@Nonnull EditorGutterComponentEx gutterComponent,
@Nullable Couple<Map<VcsRevisionNumber, Color>> bgColorMap) {
super("View", true);
final List<AnAction> actions = new ArrayList<>();
for (AnnotationFieldGutter g : gutters) {
if (g.getID() != null) {
actions.add(new ShowHideAspectAction(g, gutterComponent));
}
}
actions.add(AnSeparator.getInstance());
if (bgColorMap != null) {
actions.add(new ShowAnnotationColorsAction(gutterComponent));
}
actions.add(new ShowShortenNames(gutterComponent));
myActions = actions.toArray(new AnAction[actions.size()]);
}
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:AnnotateActionGroup.java
示例9: getChildren
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
@Override
@Nonnull
public AnAction[] getChildren(@Nullable AnActionEvent e) {
if (e == null) return AnAction.EMPTY_ARRAY;
final Project project = e.getProject();
if (project == null) {
return AnAction.EMPTY_ARRAY;
}
final List<String> availableFavoritesLists = FavoritesManager.getInstance(project).getAvailableFavoritesListNames();
availableFavoritesLists.remove(e.getDataContext().getData(FavoritesTreeViewPanel.FAVORITES_LIST_NAME_DATA_KEY));
if (availableFavoritesLists.isEmpty()) {
return new AnAction[]{new AddToNewFavoritesListAction()};
}
AnAction[] actions = new AnAction[availableFavoritesLists.size() + 2];
int idx = 0;
for (String favoritesList : availableFavoritesLists) {
actions[idx++] = new AddToFavoritesAction(favoritesList);
}
actions[idx++] = AnSeparator.getInstance();
actions[idx] = new AddToNewFavoritesListAction();
return actions;
}
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:AddToFavoritesActionGroup.java
示例10: getChildren
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
@Override
@Nonnull
public AnAction[] getChildren(@Nullable AnActionEvent e) {
if (e == null) return AnAction.EMPTY_ARRAY;
final Project project = e.getProject();
if (project == null) {
return AnAction.EMPTY_ARRAY;
}
final List<String> listNames = FavoritesManager.getInstance(project).getAvailableFavoritesListNames();
final List<String> availableFavoritesLists = FavoritesManager.getInstance(project).getAvailableFavoritesListNames();
availableFavoritesLists.remove(e.getDataContext().getData(FavoritesTreeViewPanel.FAVORITES_LIST_NAME_DATA_KEY));
if (availableFavoritesLists.isEmpty()) {
return new AnAction[]{new AddAllOpenFilesToNewFavoritesListAction()};
}
AnAction[] actions = new AnAction[listNames.size() + 2];
int idx = 0;
for (String favoritesList : listNames) {
actions[idx++] = new AddAllOpenFilesToFavorites(favoritesList);
}
actions[idx++] = AnSeparator.getInstance();
actions[idx] = new AddAllOpenFilesToNewFavoritesListAction();
return actions;
}
开发者ID:consulo,项目名称:consulo,代码行数:25,代码来源:AddAllToFavoritesActionGroup.java
示例11: getChildren
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
@NotNull
public AnAction[] getChildren(@Nullable AnActionEvent e) {
if (!isEnabled(e)) return AnAction.EMPTY_ARRAY;
final Project project = getEventProject(e);
if (project == null) return AnAction.EMPTY_ARRAY;
final PsiFile psiFile = getPsiFile(e);
if (psiFile == null) return AnAction.EMPTY_ARRAY;
final FileAssociationsManager fileAssociationsManager = FileAssociationsManager.getInstance(project);
final PsiFile[] associationsFor = fileAssociationsManager.getAssociationsFor(psiFile, FileAssociationsManager.XML_FILES);
final AnAction[] children;
if (associationsFor.length == 0) {
children = new AnAction[2];
} else {
children = new AnAction[associationsFor.length + 3];
for (int i = 0; i < associationsFor.length; i++) {
PsiFile assoc = associationsFor[i];
children[i] = new ToggleAssociationAction(fileAssociationsManager, psiFile, assoc);
}
children[children.length - 3] = AnSeparator.getInstance();
}
children[children.length - 2] = new AddAssociationAction(fileAssociationsManager);
children[children.length - 1] = new ConfigureAssociationsAction();
return children;
}
开发者ID:consulo,项目名称:consulo-xslt,代码行数:27,代码来源:AssociationsGroup.java
示例12: setToolbarActions
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
public final void setToolbarActions(final AnAction... actions) {
final DefaultActionGroup actionGroup = new DefaultActionGroup();
for (final AnAction action : actions) {
actionGroup.add(action);
}
if (getHelpId() != null) {
actionGroup.add(AnSeparator.getInstance());
actionGroup.add(new ContextHelpAction(getHelpId()));
}
final ActionManager actionManager = ActionManager.getInstance();
final ToolbarPosition position = getToolbarPosition();
final ActionToolbar myActionToolbar = actionManager.createActionToolbar(ActionPlaces.PROJECT_VIEW_TOOLBAR, actionGroup, position == ToolbarPosition.TOP || position == ToolbarPosition.BOTTOM);
myActionToolbar.setTargetComponent(myInnerPanel);
final JComponent toolbarComponent = myActionToolbar.getComponent();
final MatteBorder matteBorder = BorderFactory.createMatteBorder(0, 0, position == ToolbarPosition.TOP ? 1 : 0, 0, JBColor.DARK_GRAY);
toolbarComponent.setBorder(BorderFactory.createCompoundBorder(matteBorder, toolbarComponent.getBorder()));
getTable().getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
myActionToolbar.updateActionsImmediately();
}
});
add(toolbarComponent, position.getPosition());
}
开发者ID:consulo,项目名称:consulo-xml,代码行数:27,代码来源:AbstractTableView.java
示例13: getChildren
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
@NotNull
@Override
public AnAction[] getChildren(@Nullable AnActionEvent e) {
Project project = e.getProject();
if(project == null) {
return AnAction.EMPTY_ARRAY;
}
List<AnAction> actions = new ArrayList<AnAction>();
Collections.addAll(actions, myDefaultActions);
AntBuildFileGroup[] groups;
if(myGroup == null) {
groups = AntBuildFileGroupManager.getInstance(project).getFirstLevelGroups();
}
else {
groups = myGroup.getChildren();
}
if(groups.length != 0) {
actions.add(AnSeparator.getInstance());
for (AntBuildFileGroup group : groups) {
actions.add(new AntGroupManagerActionGroup(group, myTree));
}
}
return actions.toArray(new AnAction[actions.size()]);
}
开发者ID:consulo,项目名称:consulo-apache-ant,代码行数:29,代码来源:AntGroupManagerActionGroup.java
示例14: getChildren
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
@Nonnull
@Override
public AnAction[] getChildren(@javax.annotation.Nullable AnActionEvent e) {
if (e == null) return EMPTY_ARRAY;
final Project project = e.getProject();
if (project == null) return EMPTY_ARRAY;
final Collection<String> filePaths = TestHistoryConfiguration.getInstance(project).getFiles();
final File testHistoryRoot = TestStateStorage.getTestHistoryRoot(project);
final List<File> fileNames = ContainerUtil.map(filePaths, new Function<String, File>() {
@Override
public File fun(String fileName) {
return new File(testHistoryRoot, fileName);
}
});
Collections.sort(fileNames, new Comparator<File>() {
@Override
public int compare(File f1, File f2) {
return f1.lastModified() > f2.lastModified() ? -1 : 1;
}
});
final int historySize = fileNames.size();
final AnAction[] actions = new AnAction[historySize + 2];
for (int i = 0; i < historySize; i++) {
actions[i] = new ImportTestsFromHistoryAction(myProperties, project, fileNames.get(i).getName());
}
actions[historySize] = AnSeparator.getInstance();
actions[historySize + 1] = new ImportTestsFromFileAction(myProperties);
return actions;
}
开发者ID:consulo,项目名称:consulo,代码行数:30,代码来源:ImportTestsGroup.java
示例15: createToolbarActions
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
@Override
protected List<AnAction> createToolbarActions() {
List<AnAction> group = new ArrayList<>();
group.add(new MyAcceptSideAction(Side.LEFT));
group.add(new MyAcceptSideAction(Side.RIGHT));
group.add(AnSeparator.getInstance());
group.add(myTransferableStateSupport.createToggleAction());
group.addAll(super.createToolbarActions());
return group;
}
开发者ID:consulo,项目名称:consulo,代码行数:14,代码来源:TwosideBinaryDiffViewer.java
示例16: createToolbarActions
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
@Nonnull
@Override
protected List<AnAction> createToolbarActions() {
List<AnAction> group = new ArrayList<>();
group.add(new MyIgnorePolicySettingAction());
group.add(new MyHighlightPolicySettingAction());
group.add(new MyReadOnlyLockAction());
group.add(myEditorSettingsAction);
group.add(AnSeparator.getInstance());
group.addAll(super.createToolbarActions());
return group;
}
开发者ID:consulo,项目名称:consulo,代码行数:16,代码来源:SimpleOnesideDiffViewer.java
示例17: createPopupActions
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
@Nonnull
@Override
protected List<AnAction> createPopupActions() {
List<AnAction> group = new ArrayList<>();
group.add(AnSeparator.getInstance());
group.add(new MyIgnorePolicySettingAction().getPopupGroup());
group.add(AnSeparator.getInstance());
group.add(new MyHighlightPolicySettingAction().getPopupGroup());
group.add(AnSeparator.getInstance());
group.addAll(super.createPopupActions());
return group;
}
开发者ID:consulo,项目名称:consulo,代码行数:16,代码来源:SimpleOnesideDiffViewer.java
示例18: registerAdditionalActions
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
@Override
public void registerAdditionalActions(@NotNull DefaultActionGroup leftToolbar, @NotNull DefaultActionGroup topToolbar, @NotNull DefaultActionGroup settings)
{
Constraints beforeRunner = new Constraints(Anchor.BEFORE, "Runner.Layout");
leftToolbar.add(AnSeparator.getInstance(), beforeRunner);
leftToolbar.add(ActionManager.getInstance().getAction(DebuggerActions.DUMP_THREADS), beforeRunner);
leftToolbar.add(AnSeparator.getInstance(), beforeRunner);
Constraints beforeSort = new Constraints(Anchor.BEFORE, "XDebugger.ToggleSortValues");
settings.addAction(new WatchLastMethodReturnValueAction(), beforeSort);
settings.addAction(new AutoVarsSwitchAction(), beforeSort);
}
开发者ID:consulo,项目名称:consulo-java,代码行数:13,代码来源:JavaDebugProcess.java
示例19: calcChildren
import com.intellij.openapi.actionSystem.AnSeparator; //导入依赖的package包/类
private static AnAction[] calcChildren(List<JavaValue> values)
{
List<AnAction> renderers = new ArrayList<>();
List<NodeRenderer> allRenderers = NodeRendererSettings.getInstance().getAllRenderers();
boolean anyValueDescriptor = false;
for(NodeRenderer nodeRenderer : allRenderers)
{
boolean allApp = true;
for(JavaValue value : values)
{
if(value instanceof JavaReferringObjectsValue)
{ // disable for any referrers at all
return AnAction.EMPTY_ARRAY;
}
ValueDescriptorImpl valueDescriptor = value.getDescriptor();
anyValueDescriptor = true;
if(!valueDescriptor.isValueValid() || !nodeRenderer.isApplicable(valueDescriptor.getType()))
{
allApp = false;
break;
}
}
if(!anyValueDescriptor)
{
return AnAction.EMPTY_ARRAY;
}
if(allApp)
{
renderers.add(new RendererAction(nodeRenderer));
}
}
List<AnAction> children = new ArrayList<>();
AnAction[] viewAsActions = ((DefaultActionGroup) ActionManager.getInstance().getAction(DebuggerActions.REPRESENTATION_LIST)).getChildren(null);
for(AnAction viewAsAction : viewAsActions)
{
if(viewAsAction instanceof AutoRendererAction)
{
if(renderers.size() > 1)
{
viewAsAction.getTemplatePresentation().setVisible(true);
children.add(viewAsAction);
}
}
else
{
children.add(viewAsAction);
}
}
if(!children.isEmpty())
{
children.add(AnSeparator.getInstance());
}
children.addAll(renderers);
return children.toArray(new AnAction[children.size()]);
}
开发者ID:consulo,项目名称:consulo-java,代码行数:65,代码来源:ViewAsGroup.java
注:本文中的com.intellij.openapi.actionSystem.AnSeparator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论