当前位置: 首页>>代码示例>>Java>>正文


Java DomModelTreeView类代码示例

本文整理汇总了Java中com.intellij.util.xml.tree.DomModelTreeView的典型用法代码示例。如果您正苦于以下问题:Java DomModelTreeView类的具体用法?Java DomModelTreeView怎么用?Java DomModelTreeView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DomModelTreeView类属于com.intellij.util.xml.tree包,在下文中一共展示了DomModelTreeView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DomElementsToggleAction

import com.intellij.util.xml.tree.DomModelTreeView; //导入依赖的package包/类
public DomElementsToggleAction(final DomModelTreeView treeView, final Class aClass) {
  myTreeView = treeView;
  myClass = aClass;

  Icon myIcon = ElementPresentationManager.getIcon(myClass);
  if (myIcon == null) {
    myIcon = AllIcons.Nodes.Pointcut;
  }
  this.myIcon = myIcon;

  myText = TypePresentationService.getService().getTypePresentableName(myClass);

  if(getHiders() == null) DomUtil.getFile(myTreeView.getRootElement()).putUserData(AbstractDomElementNode.TREE_NODES_HIDERS_KEY, new HashMap<Class, Boolean>());

  if(getHiders().get(myClass) == null) getHiders().put(myClass, true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:DomElementsToggleAction.java

示例2: getDomCollectionChildDescriptions

import com.intellij.util.xml.tree.DomModelTreeView; //导入依赖的package包/类
@Override
@NotNull
protected DomCollectionChildDescription[] getDomCollectionChildDescriptions(final AnActionEvent e) {
  final DomModelTreeView view = getTreeView(e);

  SimpleNode node = view.getTree().getSelectedNode();
  if (node instanceof BaseDomElementNode) {
    List<DomCollectionChildDescription> consolidated = ((BaseDomElementNode)node).getConsolidatedChildrenDescriptions();
    if (consolidated.size() > 0) {
      return consolidated.toArray(new DomCollectionChildDescription[consolidated.size()]);
    }
  }

  final DomElementsGroupNode groupNode = getDomElementsGroupNode(view);

  return groupNode == null
         ? DomCollectionChildDescription.EMPTY_ARRAY
         : new DomCollectionChildDescription[]{groupNode.getChildDescription()};
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:AddElementInCollectionAction.java

示例3: actionPerformed

import com.intellij.util.xml.tree.DomModelTreeView; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e, DomModelTreeView treeView) {
  final SimpleNode selectedNode = treeView.getTree().getSelectedNode();

  if (selectedNode instanceof BaseDomElementNode) {

    if (selectedNode instanceof DomFileElementNode) {
      e.getPresentation().setVisible(false);
      return;
    }
    
    final DomElement domElement = ((BaseDomElementNode)selectedNode).getDomElement();

    final int ret = Messages.showOkCancelDialog(getPresentationText(selectedNode, "Remove") + "?", "Remove",
                                                Messages.getQuestionIcon());
    if (ret == Messages.OK) {
    new WriteCommandAction(domElement.getManager().getProject(), DomUtil.getFile(domElement)) {
      @Override
      protected void run(@NotNull final Result result) throws Throwable {
        domElement.undefine();
      }
    }.execute();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:DeleteDomElement.java

示例4: DomElementsToggleAction

import com.intellij.util.xml.tree.DomModelTreeView; //导入依赖的package包/类
public DomElementsToggleAction(final DomModelTreeView treeView, final Class aClass) {
  myTreeView = treeView;
  myClass = aClass;

  Icon myIcon = ElementPresentationManager.getIcon(myClass);
  if (myIcon == null) {
    myIcon = AllIcons.Nodes.Pointcut;
  }
  this.myIcon = myIcon;

  myText = TypePresentationService.getService().getTypePresentableName(myClass);

  if(getHiders() == null) DomUtil.getFile(myTreeView.getRootElement()).putUserData(BaseDomElementNode.TREE_NODES_HIDERS_KEY, new HashMap<Class, Boolean>());

  if(getHiders().get(myClass) == null) getHiders().put(myClass, true);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:DomElementsToggleAction.java

示例5: getDomCollectionChildDescriptions

import com.intellij.util.xml.tree.DomModelTreeView; //导入依赖的package包/类
@NotNull
protected DomCollectionChildDescription[] getDomCollectionChildDescriptions(final AnActionEvent e) {
  final DomModelTreeView view = getTreeView(e);

  SimpleNode node = view.getTree().getSelectedNode();
  if (node instanceof BaseDomElementNode) {
    List<DomCollectionChildDescription> consolidated = ((BaseDomElementNode)node).getConsolidatedChildrenDescriptions();
    if (consolidated.size() > 0) {
      return consolidated.toArray(new DomCollectionChildDescription[consolidated.size()]);
    }
  }

  final DomElementsGroupNode groupNode = getDomElementsGroupNode(view);

  return groupNode == null
         ? DomCollectionChildDescription.EMPTY_ARRAY
         : new DomCollectionChildDescription[]{groupNode.getChildDescription()};
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:AddElementInCollectionAction.java

示例6: actionPerformed

import com.intellij.util.xml.tree.DomModelTreeView; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e, DomModelTreeView treeView) {
  final SimpleNode selectedNode = treeView.getTree().getSelectedNode();

  if (selectedNode instanceof BaseDomElementNode) {

    if (selectedNode instanceof DomFileElementNode) {
      e.getPresentation().setVisible(false);
      return;
    }
    
    final DomElement domElement = ((BaseDomElementNode)selectedNode).getDomElement();

    final int ret = Messages.showOkCancelDialog(getPresentationText(selectedNode) + "?", ApplicationBundle.message("action.remove"),
                                                Messages.getQuestionIcon());
    if (ret == 0) {
    new WriteCommandAction(domElement.getManager().getProject(), DomUtil.getFile(domElement)) {
      protected void run(final Result result) throws Throwable {
        domElement.undefine();
      }
    }.execute();
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:DeleteDomElement.java

示例7: DomElementsToggleAction

import com.intellij.util.xml.tree.DomModelTreeView; //导入依赖的package包/类
public DomElementsToggleAction(final DomModelTreeView treeView, final Class aClass) {
  myTreeView = treeView;
  myClass = aClass;

  Icon myIcon = ElementPresentationManager.getIcon(myClass);
  if (myIcon == null) {
    myIcon = AllIcons.Nodes.Pointcut;
  }
  this.myIcon = myIcon;

  myText = TypePresentationService.getInstance().getTypePresentableName(myClass);

  if(getHiders() == null) DomUtil.getFile(myTreeView.getRootElement()).putUserData(BaseDomElementNode.TREE_NODES_HIDERS_KEY, new HashMap<Class, Boolean>());

  if(getHiders().get(myClass) == null) getHiders().put(myClass, true);
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:17,代码来源:DomElementsToggleAction.java

示例8: isEnabled

import com.intellij.util.xml.tree.DomModelTreeView; //导入依赖的package包/类
@Override
protected boolean isEnabled(final AnActionEvent e) {
  final DomModelTreeView treeView = getTreeView(e);

  final boolean enabled = treeView != null;
  e.getPresentation().setEnabled(enabled);

  return enabled;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:AddElementInCollectionAction.java

示例9: showPopup

import com.intellij.util.xml.tree.DomModelTreeView; //导入依赖的package包/类
@Override
protected void showPopup(final ListPopup groupPopup, final AnActionEvent e) {
  if (myTreeView == null) {
    if (e.getPlace().equals(DomModelTreeView.DOM_MODEL_TREE_VIEW_POPUP)) {
      groupPopup.showInCenterOf(getTreeView(e).getTree());
    }
    else {
      groupPopup.showInBestPositionFor(e.getDataContext());
    }
  }
  else {
    super.showPopup(groupPopup, e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:AddElementInCollectionAction.java

示例10: getParentDomElement

import com.intellij.util.xml.tree.DomModelTreeView; //导入依赖的package包/类
@Override
protected DomElement getParentDomElement(final AnActionEvent e) {
  final DomModelTreeView view = getTreeView(e);
  SimpleNode node = view.getTree().getSelectedNode();
  if (node instanceof BaseDomElementNode) {
    if (((BaseDomElementNode)node).getConsolidatedChildrenDescriptions().size() > 0) {
      return ((BaseDomElementNode)node).getDomElement();
    }
  }
  final DomElementsGroupNode groupNode = getDomElementsGroupNode(view);

  return groupNode == null ? null : groupNode.getDomElement();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:AddElementInCollectionAction.java

示例11: getDomElementsGroupNode

import com.intellij.util.xml.tree.DomModelTreeView; //导入依赖的package包/类
@Nullable
private static DomElementsGroupNode getDomElementsGroupNode(final DomModelTreeView treeView) {
  SimpleNode simpleNode = treeView.getTree().getSelectedNode();
  while (simpleNode != null) {
    if (simpleNode instanceof DomElementsGroupNode) return (DomElementsGroupNode)simpleNode;

    simpleNode = simpleNode.getParent();
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:AddElementInCollectionAction.java

示例12: actionPerformed

import com.intellij.util.xml.tree.DomModelTreeView; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e, DomModelTreeView treeView) {
  final SimpleNode simpleNode = treeView.getTree().getSelectedNode();

  if(simpleNode instanceof BaseDomElementNode) {
    final DomElement domElement = ((BaseDomElementNode)simpleNode).getDomElement();
    final DomElementNavigationProvider provider =
      DomElementsNavigationManager.getManager(domElement.getManager().getProject()).getDomElementsNavigateProvider(DomElementsNavigationManager.DEFAULT_PROVIDER_NAME);

    provider.navigate(domElement, true);

  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:GotoDomElementDeclarationAction.java

示例13: update

import com.intellij.util.xml.tree.DomModelTreeView; //导入依赖的package包/类
@Override
final public void update(AnActionEvent e) {
  final DomModelTreeView treeView = getTreeView(e);

  if (treeView != null) {
    update(e, treeView);
  }
  else {
    e.getPresentation().setEnabled(false);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:BaseDomTreeAction.java

示例14: actionPerformed

import com.intellij.util.xml.tree.DomModelTreeView; //导入依赖的package包/类
@Override
final public void actionPerformed(AnActionEvent e) {
  final DomModelTreeView treeView = getTreeView(e);
  if (treeView != null) {
    actionPerformed(e, treeView);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:BaseDomTreeAction.java

示例15: update

import com.intellij.util.xml.tree.DomModelTreeView; //导入依赖的package包/类
@Override
public void update(AnActionEvent e, DomModelTreeView treeView) {
  final SimpleNode selectedNode = treeView.getTree().getSelectedNode();

  if (selectedNode instanceof DomFileElementNode) {
    e.getPresentation().setVisible(false);
    return;
  }

  boolean enabled = false;
  if (selectedNode instanceof BaseDomElementNode) {
    final DomElement domElement = ((BaseDomElementNode)selectedNode).getDomElement();
    if (domElement.isValid() && DomUtil.hasXml(domElement) && !(domElement.getParent() instanceof DomFileElement)) {
      enabled = true;
    }
  }

  e.getPresentation().setEnabled(enabled);


  if (enabled) {
    e.getPresentation().setText(getPresentationText(selectedNode, ApplicationBundle.message("action.remove")));
  }
  else {
    e.getPresentation().setText(ApplicationBundle.message("action.remove"));
  }

  e.getPresentation().setIcon(AllIcons.General.Remove);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:DeleteDomElement.java


注:本文中的com.intellij.util.xml.tree.DomModelTreeView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。