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


Java Trinity类代码示例

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


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

示例1: getExceptionTypes

import com.intellij.openapi.util.Trinity; //导入依赖的package包/类
private List<Trinity> getExceptionTypes() {
    List<Trinity> types = new ArrayList<Trinity>();

    types.add(new Trinity("Exception", PhpIcons.EXCEPTION, "PHP Exception"));
    types.add(new Trinity("Error", PhpIcons.EXCEPTION, "PHP Exception"));
    types.add(new Trinity("BadFunctionCallException", PhpIcons.EXCEPTION, "PHP Exception"));
    types.add(new Trinity("BadMethodCallException", PhpIcons.EXCEPTION, "PHP Exception"));
    types.add(new Trinity("DomainException", PhpIcons.EXCEPTION, "PHP Exception"));
    types.add(new Trinity("InvalidArgumentException", PhpIcons.EXCEPTION, "PHP Exception"));
    types.add(new Trinity("LengthException", PhpIcons.EXCEPTION, "PHP Exception"));
    types.add(new Trinity("LogicException", PhpIcons.EXCEPTION, "PHP Exception"));
    types.add(new Trinity("OutOfBoundsException", PhpIcons.EXCEPTION, "PHP Exception"));
    types.add(new Trinity("OutOfRangeException", PhpIcons.EXCEPTION, "PHP Exception"));
    types.add(new Trinity("OverflowException", PhpIcons.EXCEPTION, "PHP Exception"));
    types.add(new Trinity("RangeException", PhpIcons.EXCEPTION, "PHP Exception"));
    types.add(new Trinity("RuntimeException", PhpIcons.EXCEPTION, "PHP Exception"));
    types.add(new Trinity("UnderflowException", PhpIcons.EXCEPTION, "PHP Exception"));
    types.add(new Trinity("UnexpectedValueException", PhpIcons.EXCEPTION, "PHP Exception"));

    return types;
}
 
开发者ID:aurimasniekis,项目名称:idea-php-class-templates,代码行数:22,代码来源:PhpNewExceptionClassDialog.java

示例2: getAvailableTemplates

import com.intellij.openapi.util.Trinity; //导入依赖的package包/类
private List<Trinity> getAvailableTemplates() {
    List<Trinity> templates = new ArrayList<Trinity>();

    FileTemplate classTemplate = FileTemplateManager.getInstance(this.myProject).getInternalTemplate("PHP Class");

    for (FileTemplate template : FileTemplateManager.getInstance(this.myProject).getAllTemplates()) {
        if (template.getExtension().equals("class.php")) {
            templates.add(new Trinity(template.getName(), PhpIcons.CLASS, template));
        }
    }

    if (templates.size() < 1) {
        templates.add(new Trinity(classTemplate.getName(), PhpIcons.CLASS, classTemplate));
    }

    return templates;
}
 
开发者ID:aurimasniekis,项目名称:idea-php-class-templates,代码行数:18,代码来源:PhpNewTemplateClassDialog.java

示例3: TextWithImportsImpl

import com.intellij.openapi.util.Trinity; //导入依赖的package包/类
public TextWithImportsImpl(@NotNull PsiElement expression) {
  myKind = CodeFragmentKind.EXPRESSION;
  final String text = expression.getText();
  PsiFile containingFile = expression.getContainingFile();
  if(containingFile instanceof PsiExpressionCodeFragment) {
    myText = text;
    myImports = ((JavaCodeFragment)containingFile).importsToString();
    myFileType = StdFileTypes.JAVA;
  }
  else {
    Trinity<String, String, FileType> trinity = parseExternalForm(text);
    myText = trinity.first;
    myImports = trinity.second;
    myFileType = trinity.third;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:TextWithImportsImpl.java

示例4: createVariableValue

import com.intellij.openapi.util.Trinity; //导入依赖的package包/类
@NotNull
public DfaVariableValue createVariableValue(@NotNull PsiModifierListOwner myVariable,
                                            @Nullable PsiType varType,
                                            boolean isNegated,
                                            @Nullable DfaVariableValue qualifier) {
  Trinity<Boolean,String,DfaVariableValue> key = Trinity.create(isNegated, ((PsiNamedElement)myVariable).getName(), qualifier);
  for (DfaVariableValue aVar : myExistingVars.get(key)) {
    if (aVar.hardEquals(myVariable, varType, isNegated, qualifier)) return aVar;
  }

  DfaVariableValue result = new DfaVariableValue(myVariable, varType, isNegated, myFactory, qualifier);
  myExistingVars.putValue(key, result);
  while (qualifier != null) {
    qualifier.myDependents.add(result);
    qualifier = qualifier.getQualifier();
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:DfaVariableValue.java

示例5: findMethodRange

import com.intellij.openapi.util.Trinity; //导入依赖的package包/类
private static List<TextRange> findMethodRange(final ExceptionWorker worker,
                                               final Document document,
                                               final Trinity<PsiClass, PsiFile, String> previousLineResult) {
  return ApplicationManager.getApplication().runReadAction(new Computable<List<TextRange>>() {
    @Override
    public List<TextRange> compute() {
      List<TextRange> ranges = getTextRangeForMethod(worker, previousLineResult);
      if (ranges == null) return null;
      final List<TextRange> result = new ArrayList<TextRange>();
      for (TextRange range : ranges) {
        result.add(new TextRange(document.getLineNumber(range.getStartOffset()),
                                     document.getLineNumber(range.getEndOffset())));
      }
      return result;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:VcsContentAnnotationExceptionFilter.java

示例6: selectMethod

import com.intellij.openapi.util.Trinity; //导入依赖的package包/类
@Nullable
private static List<PsiMethod> selectMethod(final PsiMethod[] methods, final Trinity<PsiClass, PsiFile, String> previousLineResult) {
  if (previousLineResult == null || previousLineResult.getThird() == null) return null;

  final List<PsiMethod> result = new SmartList<PsiMethod>();
  for (final PsiMethod method : methods) {
    method.accept(new JavaRecursiveElementVisitor() {
      @Override
      public void visitCallExpression(PsiCallExpression callExpression) {
        final PsiMethod resolved = callExpression.resolveMethod();
        if (resolved != null) {
          if (resolved.getName().equals(previousLineResult.getThird())) {
            result.add(method);
          }
        }
      }
    });
  }

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

示例7: startListening

import com.intellij.openapi.util.Trinity; //导入依赖的package包/类
private void startListening(@NotNull final List<Trinity<PsiModifierListOwner, String, Boolean>> expectedSequence) {
  myBusConnection = myProject.getMessageBus().connect();
  myBusConnection.subscribe(ExternalAnnotationsManager.TOPIC, new DefaultAnnotationsListener() {
    private int index = 0;

    @Override
    public void afterExternalAnnotationChanging(@NotNull PsiModifierListOwner owner, @NotNull String annotationFQName,
                                                boolean successful) {
      if (index < expectedSequence.size() && expectedSequence.get(index).first == owner
          && expectedSequence.get(index).second.equals(annotationFQName) && expectedSequence.get(index).third == successful) {
        index++;
        myExpectedEventWasProduced = true;
      }
      else {
        super.afterExternalAnnotationChanging(owner, annotationFQName, successful);
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:AddAnnotationFixTest.java

示例8: testMoveUpDown

import com.intellij.openapi.util.Trinity; //导入依赖的package包/类
public void testMoveUpDown() {
  doExpand();
  checkPositionToMove(0, 1, null);
  checkPositionToMove(2, 1, Trinity.create(2, 3, BELOW));
  checkPositionToMove(2, -1, null);
  checkPositionToMove(14, 1, null);
  checkPositionToMove(14, -1, null);
  checkPositionToMove(15, -1, null);
  checkPositionToMove(16, -1, null);
  checkPositionToMove(3, -1, Trinity.create(3, 2, ABOVE));
  checkPositionToMove(6, 1, Trinity.create(6, 9, BELOW));
  checkPositionToMove(7, 1, Trinity.create(7, 8, BELOW));
  checkPositionToMove(10, -1, Trinity.create(10, 8, BELOW));
  checkPositionToMove(8, 1, Trinity.create(8, 9, BELOW));
  checkPositionToMove(21, -1, Trinity.create(21, 20, BELOW));
  checkPositionToMove(21, 1, null);
  checkPositionToMove(20, 1, Trinity.create(20, 21, ABOVE));
  checkPositionToMove(20, -1, Trinity.create(20, 19, ABOVE));
  checkPositionToMove(19, 1, Trinity.create(19, 20, BELOW));
  checkPositionToMove(19, -1, Trinity.create(19, 17, BELOW));
  checkPositionToMove(17, -1, Trinity.create(17, 16, ABOVE));
  checkPositionToMove(17, 1, Trinity.create(17, 18, BELOW));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:RunConfigurableTest.java

示例9: removeNotification

import com.intellij.openapi.util.Trinity; //导入依赖的package包/类
public void removeNotification(Notification notification) {
  synchronized (myNotifications) {
    myNotifications.remove(notification);
  }

  Runnable handler = removeHandlers.remove(notification);
  if (handler != null) {
    UIUtil.invokeLaterIfNeeded(handler);
  }

  Trinity<Notification, String, Long> oldStatus = getStatusMessage();
  if (oldStatus != null && notification == oldStatus.first) {
    setStatusToImportant();
  }
  fireModelChanged();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:LogModel.java

示例10: updateModel

import com.intellij.openapi.util.Trinity; //导入依赖的package包/类
public void updateModel(List<? extends ChangeList> changeLists, Trinity<List<VirtualFile>, Integer, Integer> unversionedFiles, final List<LocallyDeletedChange> locallyDeletedFiles,
                        List<VirtualFile> modifiedWithoutEditing,
                        MultiMap<String, VirtualFile> switchedFiles,
                        @Nullable Map<VirtualFile, String> switchedRoots,
                        @Nullable List<VirtualFile> ignoredFiles,
                        final List<VirtualFile> lockedFolders,
                        @Nullable final Map<VirtualFile, LogicalLock> logicallyLockedFiles) {
  TreeModelBuilder builder = new TreeModelBuilder(myProject, isShowFlatten());
  final DefaultTreeModel model = builder.buildModel(changeLists, unversionedFiles, locallyDeletedFiles, modifiedWithoutEditing,
                                                    switchedFiles, switchedRoots, ignoredFiles, lockedFolders, logicallyLockedFiles);

  TreeState state = TreeState.createOn(this, (ChangesBrowserNode)getModel().getRoot());
  state.setScrollToSelection(false);
  DefaultTreeModel oldModel = getModel();
  setModel(model);
  setCellRenderer(isShowFlatten() ? myShowFlattenNodeRenderer : myNodeRenderer);
  ChangesBrowserNode root = (ChangesBrowserNode)model.getRoot();
  expandPath(new TreePath(root.getPath()));
  state.applyTo(this, (ChangesBrowserNode)getModel().getRoot());
  expandDefaultChangeList(oldModel, root);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ChangesListView.java

示例11: showCustomOption

import com.intellij.openapi.util.Trinity; //导入依赖的package包/类
@Override
public void showCustomOption(Class<? extends CustomCodeStyleSettings> settingsClass,
                             String fieldName,
                             String title,
                             String groupName,
                             @Nullable OptionAnchor anchor,
                             @Nullable String anchorFieldName,
                             Object... options) {
  if (myIsFirstUpdate) {
    myCustomOptions.putValue(groupName, (Trinity)Trinity.create(settingsClass, fieldName, title));
  }

  for (IntOption option : myOptions) {
    if (option.myTarget.getName().equals(fieldName)) {
      option.myTextField.setEnabled(true);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:CodeStyleBlankLinesPanel.java

示例12: TemplateKindCombo

import com.intellij.openapi.util.Trinity; //导入依赖的package包/类
public TemplateKindCombo() {
  //noinspection unchecked
  getComboBox().setRenderer(new ListCellRendererWrapper() {
    @Override
    public void customize(final JList list, final Object value, final int index, final boolean selected, final boolean cellHasFocus) {
      if (value instanceof Trinity) {
        setText((String)((Trinity)value).first);
        setIcon ((Icon)((Trinity)value).second);
      }
    }
  });

  new ComboboxSpeedSearch(getComboBox()) {
    @Override
    protected String getElementText(Object element) {
      if (element instanceof Trinity) {
        return (String)((Trinity)element).first;
      }
      return null;
    }
  }.setComparator(new SpeedSearchComparator(true));
  setButtonListener(null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:TemplateKindCombo.java

示例13: prepareRenaming

import com.intellij.openapi.util.Trinity; //导入依赖的package包/类
public void prepareRenaming(PsiElement element, String newName, Map<PsiElement, String> allRenames) {
  final AntDomElement antElement = convertToAntDomElement(element);
  String propName = null;
  if (antElement instanceof AntDomProperty) {
    propName = ((AntDomProperty)antElement).getName().getStringValue();
  }
  else if (antElement instanceof AntDomAntCallParam) {
    propName = ((AntDomAntCallParam)antElement).getName().getStringValue();
  }
  if (propName != null) {
    final AntDomProject contextProject = antElement.getContextAntProject();
    final List<PsiElement> additional = AntCallParamsFinder.resolve(contextProject, propName);
    for (PsiElement psiElement : additional) {
      allRenames.put(psiElement, newName);
    }
    if (antElement instanceof AntDomAntCallParam) {
      final Trinity<PsiElement, Collection<String>, PropertiesProvider> result = PropertyResolver.resolve(contextProject, propName, null);
      if (result.getFirst() != null) {
        allRenames.put(result.getFirst(), newName);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:AntRenameProcessor.java

示例14: resolve

import com.intellij.openapi.util.Trinity; //导入依赖的package包/类
@NotNull
public ResolveResult[] resolve(@NotNull AntDomPropertyReference antDomPropertyReference, boolean incompleteCode) {
  final List<ResolveResult> result = new ArrayList<ResolveResult>();
  final AntDomProject project = antDomPropertyReference.myInvocationContextElement.getParentOfType(AntDomProject.class, true);
  if (project != null) {
    final AntDomProject contextAntProject = project.getContextAntProject();
    final String propertyName = antDomPropertyReference.getCanonicalText();
    final Trinity<PsiElement,Collection<String>,PropertiesProvider> resolved = 
      PropertyResolver.resolve(contextAntProject, propertyName, antDomPropertyReference.myInvocationContextElement);
    final PsiElement mainDeclaration = resolved.getFirst();

    if (mainDeclaration != null) {
      result.add(new MyResolveResult(mainDeclaration, resolved.getThird()));
    }

    final List<PsiElement> antCallParams = AntCallParamsFinder.resolve(project, propertyName);
    for (PsiElement param : antCallParams) {
      result.add(new MyResolveResult(param, null));
    }
  }
  return ContainerUtil.toArray(result, new ResolveResult[result.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:AntDomPropertyReference.java

示例15: computeRawActions

import com.intellij.openapi.util.Trinity; //导入依赖的package包/类
private Set<Trinity<Module, SyncAction, MvcFramework>> computeRawActions(Set<Pair<Object, SyncAction>> actions) {
  //get module by object and kill duplicates
  final Set<Trinity<Module, SyncAction, MvcFramework>> rawActions = new LinkedHashSet<Trinity<Module, SyncAction, MvcFramework>>();
  for (final Pair<Object, SyncAction> pair : actions) {
    for (Module module : determineModuleBySyncActionObject(pair.first)) {
      if (!module.isDisposed()) {
        final MvcFramework framework = (pair.second == SyncAction.CreateAppStructureIfNeeded)
                                       ? MvcFramework.getInstanceBySdk(module)
                                       : MvcFramework.getInstance(module);

        if (framework != null && !framework.isAuxModule(module)) {
          rawActions.add(Trinity.create(module, pair.second, framework));
        }
      }
    }
  }
  return rawActions;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:MvcModuleStructureSynchronizer.java


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