Java Code Examples for com.intellij.ide.projectView.impl.AbstractProjectViewPane#getSubId()

The following examples show how to use com.intellij.ide.projectView.impl.AbstractProjectViewPane#getSubId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EditScopesAction.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
public void update(AnActionEvent e) {
  super.update(e);
  e.getPresentation().setEnabled(false);
  final DataContext dataContext = e.getDataContext();
  final Project project = dataContext.getData(CommonDataKeys.PROJECT);
  if (project != null) {
    final AbstractProjectViewPane projectViewPane = ProjectView.getInstance(project).getCurrentProjectViewPane();
    if (projectViewPane != null) {
      final String scopeName = projectViewPane.getSubId();
      if (scopeName != null) {
        e.getPresentation().setEnabled(true);
      }
    }
  }
}
 
Example 2
Source File: ScopeTreeViewPanel.java    From consulo with Apache License 2.0 6 votes vote down vote up
private void fireListeners(ChangeList list, @Nullable String oldName) {
  AbstractProjectViewPane pane = ProjectView.getInstance(myProject).getCurrentProjectViewPane();
  if (pane == null || !ScopeViewPane.ID.equals(pane.getId())) {
    return;
  }
  final String subId = pane.getSubId();
  if (!list.getName().equals(subId) && (oldName == null || !oldName.equals(subId))) {
    return;
  }
  ApplicationManager.getApplication().invokeLater(new Runnable() {
    @Override
    public void run() {
      myDependencyValidationManager.fireScopeListeners();
    }
  }, myProject.getDisposed());
}