Tabnine Logo
com.neueda.jetbrains.plugin.graphdb.platform
Code IndexAdd Tabnine to your IDE (free)

How to use com.neueda.jetbrains.plugin.graphdb.platform

Best Java code snippets using com.neueda.jetbrains.plugin.graphdb.platform (Showing top 12 results out of 315)

origin: neueda/jetbrains-plugin-graph-database-support

  private CypherLanguage() {
    super(CYPHER.getLanguageId());
  }
}
origin: neueda/jetbrains-plugin-graph-database-support

  @Override
  public void projectOpened(Project project) {
    if (!isUpdateNotificationShown) {
      Notifier.info(
          GraphBundle.message("updater.title", currentVersion),
          GraphBundle.message("updater.notification"));
      isUpdateNotificationShown = true;
    }
  }
});
origin: neueda/jetbrains-plugin-graph-database-support

public static boolean isSupported(String languageId) {
  checkNotNull(languageId, "'languageId' is undefined");
  return Stream.of(values())
      .anyMatch(language -> language.getLanguageId().equals(languageId));
}
origin: neueda/jetbrains-plugin-graph-database-support

@Test
public void languageSupported() {
  assertTrue(SupportedLanguage.isSupported(SupportedLanguage.CYPHER.getLanguageId()));
}
origin: neueda/jetbrains-plugin-graph-database-support

@Override
public List<AnAction> promote(List<AnAction> actions, DataContext context) {
  PsiFile psiFile = PlatformDataKeys.PSI_FILE.getData(context);
  if (psiFile != null) {
    String languageId = psiFile.getLanguage().getID();
    if (isSupported(languageId)) {
      return checkForExecuteQueryAction(actions);
    }
  }
  return Collections.emptyList();
}
origin: neueda/jetbrains-plugin-graph-database-support

  @Override
  @SuppressWarnings("unchecked")
  public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected,
                         boolean expanded, boolean leaf, int row,
                         boolean hasFocus) {
    Object transformedValue = Stream.of(model.getColumns())
        .filter(col -> TreeTableModel.class == col.getColumnClass())
        .findAny()
        .map(col -> col.valueOf(value))
        .orElseThrow(() ->
            new ShouldNeverHappenException("Sergey Ishchenko",
                "columns are statically defined, and each column set should contain "
                    + "operator column"));
    JComponent result = (JComponent) myBaseRenderer.getTreeCellRendererComponent(tree,
        transformedValue, selected, expanded, leaf, row, hasFocus);
    result.setOpaque(!selected);
    return result;
  }
});
origin: neueda/jetbrains-plugin-graph-database-support

@Test
public void languageUnsupported() {
  assertFalse(SupportedLanguage.isSupported("Java"));
}
origin: neueda/jetbrains-plugin-graph-database-support

private void initTreeCellRenderer(ListTreeTableModelOnColumns model) {
  ((TreeTableCellRenderer) treeTable.getDefaultRenderer(TreeTableModel.class))
      .setCellRenderer(new TreeCellRenderer() {
        private final TreeCellRenderer myBaseRenderer = new HighlightableCellRenderer();
        @Override
        @SuppressWarnings("unchecked")
        public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected,
                               boolean expanded, boolean leaf, int row,
                               boolean hasFocus) {
          Object transformedValue = Stream.of(model.getColumns())
              .filter(col -> TreeTableModel.class == col.getColumnClass())
              .findAny()
              .map(col -> col.valueOf(value))
              .orElseThrow(() ->
                  new ShouldNeverHappenException("Sergey Ishchenko",
                      "columns are statically defined, and each column set should contain "
                          + "operator column"));
          JComponent result = (JComponent) myBaseRenderer.getTreeCellRendererComponent(tree,
              transformedValue, selected, expanded, leaf, row, hasFocus);
          result.setOpaque(!selected);
          return result;
        }
      });
}
origin: neueda/jetbrains-plugin-graph-database-support

public void highlightStatement(Editor editor, PsiFile psiFile) {
  if (nonNull(psiFile)) {
    String languageId = psiFile.getLanguage().getID();
    if (isSupported(languageId)) {
      Caret caret = editor.getCaretModel().getPrimaryCaret();
      PsiElement element = getCypherStatementAtOffset(psiFile, caret.getOffset());
      highlightStatementInCypherFile(editor, element);
    }
  }
}
origin: neueda/jetbrains-plugin-graph-database-support

throw new ShouldNeverHappenException("Andrew Naydyonock", "edge always intersect a node");
origin: neueda/jetbrains-plugin-graph-database-support

} else if (nonNull(psiFile)) {
  String languageId = psiFile.getLanguage().getID();
  if (isSupported(languageId)) {
    PsiElement cypherStatement = getCypherStatementAtOffset(psiFile, caret.getOffset());
    if (nonNull(cypherStatement)) {
origin: neueda/jetbrains-plugin-graph-database-support

public void initialize(Container container) {
  JTextArea queryLabel = new JTextArea(originalQuery);
  queryLabel.setRows(3);
  queryLabel.setEditable(false);
  GraphQueryPlan graphQueryPlan = result.getPlan()
      .orElseThrow(() ->
          new ShouldNeverHappenException("Sergey Ishchenko",
              "GraphQueryPanel is initialized when explain or profile queries are executed"));
  ListTreeTableModelOnColumns model = createModel(graphQueryPlan, result.isProfilePlan());
  treeTable = new TreeTableView(model);
  treeTable.setAutoCreateColumnsFromModel(true);
  treeTable.setRootVisible(true);
  treeTable.setCellSelectionEnabled(false);
  treeTable.setRowSelectionAllowed(true);
  treeTable.setAutoResizeMode(TreeTableView.AUTO_RESIZE_OFF);
  treeTable.getTree().setShowsRootHandles(true);
  DefaultTreeExpander expander = new DefaultTreeExpander(treeTable.getTree());
  expander.expandAll();
  initTreeCellRenderer(model);
  JBLabel infoLabel = new JBLabel(getStatusText(result));
  infoLabel.setHorizontalAlignment(SwingConstants.LEFT);
  container.add(new JBScrollPane(queryLabel), BorderLayout.NORTH);
  // scroll pane is needed to correctly fit all the tree content and to show table header
  container.add(new JBScrollPane(treeTable, JBScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
      JBScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED), BorderLayout.CENTER);
  container.add(infoLabel, BorderLayout.SOUTH);
  new ColumnResizer(treeTable).resize();
}
com.neueda.jetbrains.plugin.graphdb.platform

Most used classes

  • SupportedLanguage
  • ShouldNeverHappenException
  • GraphBundle
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now