當前位置: 首頁>>代碼示例>>Java>>正文


Java StructureNodeRenderer類代碼示例

本文整理匯總了Java中com.intellij.ide.structureView.impl.StructureNodeRenderer的典型用法代碼示例。如果您正苦於以下問題:Java StructureNodeRenderer類的具體用法?Java StructureNodeRenderer怎麽用?Java StructureNodeRenderer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


StructureNodeRenderer類屬於com.intellij.ide.structureView.impl包,在下文中一共展示了StructureNodeRenderer類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: MethodList

import com.intellij.ide.structureView.impl.StructureNodeRenderer; //導入依賴的package包/類
public MethodList(PsiClass psiClass)
{
    super(new BorderLayout());
    model = new SortedListModel<PsiMethod>(comparator);
    list = new JBList(model);
    this.psiClass = psiClass;
    evaluate(psiClass.getAllMethods(), new TestMethodFilter());
    add(ScrollPaneFactory.createScrollPane(list));
    list.setCellRenderer(new ColoredListCellRenderer() {

        @Override
        protected void customizeCellRenderer(JList jlist, Object obj, int i, boolean flag, boolean flag1)
        {
            PsiMethod psimethod = (PsiMethod)obj;
            append(PsiFormatUtil.formatMethod(psimethod, PsiSubstitutor.EMPTY, PsiFormatUtilBase.SHOW_NAME, 0), StructureNodeRenderer.applyDeprecation(psimethod, SimpleTextAttributes.REGULAR_ATTRIBUTES));
            PsiClass psiclass1 = psimethod.getContainingClass();
            if(!MethodList.this.psiClass.equals(psiclass1)) {
                append(" (" + psiclass1.getQualifiedName() + ')', StructureNodeRenderer.applyDeprecation(psiclass1, SimpleTextAttributes.GRAY_ATTRIBUTES));
            }
        }
    });
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    ListScrollingUtil.ensureSelectionExists(list);
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:25,代碼來源:MethodList.java

示例2: MethodListDlg

import com.intellij.ide.structureView.impl.StructureNodeRenderer; //導入依賴的package包/類
public MethodListDlg(final PsiClass psiClass, final Condition<PsiMethod> filter, final JComponent parent) {
  super(parent, false);
  myClass = psiClass;
  createList(psiClass.getAllMethods(), filter);
  myWholePanel.add(ScrollPaneFactory.createScrollPane(myList));
  myList.setCellRenderer(new ColoredListCellRenderer() {
    protected void customizeCellRenderer(final JList list, final Object value, final int index, final boolean selected, final boolean hasFocus) {
      final PsiMethod psiMethod = (PsiMethod)value;
      append(PsiFormatUtil.formatMethod(psiMethod, PsiSubstitutor.EMPTY, PsiFormatUtil.SHOW_NAME, 0),
             StructureNodeRenderer.applyDeprecation(psiMethod, SimpleTextAttributes.REGULAR_ATTRIBUTES));
      final PsiClass containingClass = psiMethod.getContainingClass();
      if (!myClass.equals(containingClass))
        append(" (" + containingClass.getQualifiedName() + ")",
               StructureNodeRenderer.applyDeprecation(containingClass, SimpleTextAttributes.GRAY_ATTRIBUTES));
    }
  });
  myList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  new DoubleClickListener() {
    @Override
    protected boolean onDoubleClick(MouseEvent e) {
      MethodListDlg.this.close(OK_EXIT_CODE);
      return true;
    }
  }.installOn(myList);

  ScrollingUtil.ensureSelectionExists(myList);
  setTitle(ExecutionBundle.message("choose.test.method.dialog.title"));
  init();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:30,代碼來源:MethodListDlg.java

示例3: MethodListDlg

import com.intellij.ide.structureView.impl.StructureNodeRenderer; //導入依賴的package包/類
public MethodListDlg(final PsiClass psiClass, final Condition<PsiMethod> filter, final JComponent parent) {
  super(parent, false);
  myClass = psiClass;
  createList(psiClass.getAllMethods(), filter);
  myWholePanel.add(ScrollPaneFactory.createScrollPane(myList));
  myList.setCellRenderer(new ColoredListCellRenderer() {
    protected void customizeCellRenderer(final JList list, final Object value, final int index, final boolean selected, final boolean hasFocus) {
      final PsiMethod psiMethod = (PsiMethod)value;
      append(PsiFormatUtil.formatMethod(psiMethod, PsiSubstitutor.EMPTY, PsiFormatUtil.SHOW_NAME, 0),
             StructureNodeRenderer.applyDeprecation(psiMethod, SimpleTextAttributes.REGULAR_ATTRIBUTES));
      final PsiClass containingClass = psiMethod.getContainingClass();
      if (!myClass.equals(containingClass))
        append(" (" + containingClass.getQualifiedName() + ")",
               StructureNodeRenderer.applyDeprecation(containingClass, SimpleTextAttributes.GRAY_ATTRIBUTES));
    }
  });
  myList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  new DoubleClickListener() {
    @Override
    protected boolean onDoubleClick(MouseEvent e) {
      MethodListDlg.this.close(OK_EXIT_CODE);
      return true;
    }
  }.installOn(myList);

  ListScrollingUtil.ensureSelectionExists(myList);
  setTitle(ExecutionBundle.message("choose.test.method.dialog.title"));
  init();
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:30,代碼來源:MethodListDlg.java

示例4: MethodListDlg

import com.intellij.ide.structureView.impl.StructureNodeRenderer; //導入依賴的package包/類
public MethodListDlg(final PsiClass psiClass, final Condition<PsiMethod> filter, final JComponent parent)
{
	super(parent, false);
	myClass = psiClass;
	createList(psiClass.getAllMethods(), filter);
	myWholePanel.add(ScrollPaneFactory.createScrollPane(myList));
	myList.setCellRenderer(new ColoredListCellRenderer()
	{
		protected void customizeCellRenderer(@NotNull final JList list, final Object value, final int index, final boolean selected, final boolean hasFocus)
		{
			final PsiMethod psiMethod = (PsiMethod) value;
			append(PsiFormatUtil.formatMethod(psiMethod, PsiSubstitutor.EMPTY, PsiFormatUtil.SHOW_NAME, 0), StructureNodeRenderer.applyDeprecation(psiMethod, SimpleTextAttributes
					.REGULAR_ATTRIBUTES));
			final PsiClass containingClass = psiMethod.getContainingClass();
			if(!myClass.equals(containingClass))
			{
				append(" (" + containingClass.getQualifiedName() + ")", StructureNodeRenderer.applyDeprecation(containingClass, SimpleTextAttributes.GRAY_ATTRIBUTES));
			}
		}
	});
	myList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	new DoubleClickListener()
	{
		@Override
		protected boolean onDoubleClick(MouseEvent e)
		{
			MethodListDlg.this.close(OK_EXIT_CODE);
			return true;
		}
	}.installOn(myList);

	ScrollingUtil.ensureSelectionExists(myList);
	TreeUIHelper.getInstance().installListSpeedSearch(myList);
	setTitle(ExecutionBundle.message("choose.test.method.dialog.title"));
	init();
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:37,代碼來源:MethodListDlg.java


注:本文中的com.intellij.ide.structureView.impl.StructureNodeRenderer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。