コード例 #1
0
  private void scrollToSelectedElement() {
    if (myAutoscrollFeedback) {
      myAutoscrollFeedback = false;
      return;
    }

    StructureViewFactoryImpl structureViewFactory =
        (StructureViewFactoryImpl) StructureViewFactoryEx.getInstance(myProject);

    if (!structureViewFactory.getState().AUTOSCROLL_FROM_SOURCE) {
      return;
    }

    myAutoscrollAlarm.cancelAllRequests();
    myAutoscrollAlarm.addRequest(
        new Runnable() {
          public void run() {
            if (myAbstractTreeBuilder == null) {
              return;
            }
            try {
              selectViewableElement();
            } catch (IndexNotReadyException ignore) {
            }
          }
        },
        1000);
  }
コード例 #2
0
 public boolean isActionActive(String name) {
   return !myProject.isDisposed()
       && StructureViewFactoryEx.getInstanceEx(myProject).isActionActive(name);
 }
コード例 #3
0
 public void setActionActive(String name, boolean state) {
   StructureViewFactoryEx.getInstanceEx(myProject).setActiveAction(name, state);
   rebuild();
   TreeUtil.expand(getTree(), 2);
 }