Package com.intellij.util

Examples of com.intellij.util.Alarm$Request


    private boolean myIsClosed = false;
    private boolean myIsProcessTerminated = false;

    public ReadProcessThread(final Reader reader) {
      myReader = reader;
      myAlarm = new Alarm(Alarm.ThreadToUse.SHARED_THREAD);
    }
View Full Code Here


    private boolean myIsClosed = false;
    private boolean myIsProcessTerminated = false;

    public ReadProcessThread(final Reader reader) {
      myReader = reader;
      myAlarm = new Alarm(Alarm.ThreadToUse.SHARED_THREAD);
    }
View Full Code Here

    }
    return elementToIndexMap;
  }

  private void expand(final DefaultMutableTreeNode node, final NodeDescriptor descriptor, final boolean wasLeaf) {
    final Alarm alarm = new Alarm(Alarm.ThreadToUse.SHARED_THREAD);
    alarm.addRequest(new Runnable() {
      public void run() {
        myTree.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
      }
    }, WAIT_CURSOR_DELAY);

    if (wasLeaf && isAutoExpandNode(descriptor)) {
      expand(node);
    }

    ArrayList<TreeNode> nodes = TreeUtil.childrenToArray(node);
    for (TreeNode node1 : nodes) {
      DefaultMutableTreeNode childNode = (DefaultMutableTreeNode)node1;
      if (isLoadingNode(childNode)) continue;
      NodeDescriptor childDescr = (NodeDescriptor)childNode.getUserObject();
      if (isAutoExpandNode(childDescr)) {
        expand(childNode);
      }
    }

    int n = alarm.cancelAllRequests();
    if (n == 0) {
      myTree.setCursor(Cursor.getDefaultCursor());
    }
  }
View Full Code Here

    public void treeExpanded(TreeExpansionEvent event) {
      TreePath path = event.getPath();
      final DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent();
      if (!myUnbuiltNodes.contains(node)) return;
      myUnbuiltNodes.remove(node);
      final Alarm alarm = new Alarm(Alarm.ThreadToUse.SHARED_THREAD);
      alarm.addRequest(new Runnable() {
        public void run() {
          myTree.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        }
      }, WAIT_CURSOR_DELAY);

      expandNodeChildren(node);

      for (int i = 0; i < node.getChildCount(); i++) {
        if (isLoadingNode(node.getChildAt(i))) {
          myTreeModel.removeNodeFromParent((MutableTreeNode)node.getChildAt(i));
          break;
        }
      }

      int n = alarm.cancelAllRequests();
      if (n == 0) {
        myTree.setCursor(Cursor.getDefaultCursor());
      }

      processSmartExpand(node);
View Full Code Here

  protected AutoScrollToSourceHandler() {
  }

  public void install(final JTree tree) {
    myAutoScrollAlarm = new Alarm();
    tree.addMouseListener(new MouseAdapter() {
      public void mouseClicked(MouseEvent e) {
        if (e.getClickCount() == 2) return;

        TreePath location = tree.getPathForLocation(e.getPoint().x, e.getPoint().y);
View Full Code Here

      }
    );
  }

  public void install(final JList jList) {
    myAutoScrollAlarm = new Alarm();
    jList.addMouseListener(new MouseAdapter() {
      public void mouseClicked(MouseEvent e) {
        if (e.getClickCount() == 2) return;
        final Object source = e.getSource();
        final int index = jList.locationToIndex(SwingUtilities.convertPoint(source instanceof Component ? (Component)source : null, e.getPoint(), jList));
View Full Code Here

     */
    private static UnitAction convertMethodToUnitAction(final Method method,
        final Resource resource, final String path) {
        String id = method.getId();
        String methodName = method.getName();
        Request request = method.getRequest();

        List<Parameter> parameters = new ArrayList<Parameter>();
        if (request != null) {
            List<Param> params = request.getParamList();
            if (params != null) {
                for (Param param : params) {
                    Parameter parameter = convertParameter(param);
                    parameter.setStyle(Parameter.ParameterStyle.QUERY);
                    parameters.add(parameter);
View Full Code Here

  // These extension requests expect replies
  XProtocolInfo.extensionRequestExpectsReply(major_opcode, 0, 32); // QueryVersion
  XProtocolInfo.extensionRequestExpectsReply(major_opcode, 7, 32); // GetOverlayWindow

  // check version before any other operations
  Request request = new Request (display, major_opcode, 0, 3);
  request.write4 (CLIENT_MAJOR_VERSION);
  request.write4 (CLIENT_MINOR_VERSION);

  Data reply = display.read_reply (request);
  server_major_version = reply.read4 (8);
  server_minor_version = reply.read4 (12);
    }
View Full Code Here

   
    /**
     * Composite opcode 1 - redirect window
     */
    public void redirectWindow(Window window, int update) {
  Request request = new Request (display, major_opcode, 1, 3);
  request.write4 (window.id);
  request.write1 (update);
  request.write1 (0);
  request.write2 (0);
  display.send_request (request);
    }
View Full Code Here

   
    /**
     * Composite opcode 2 - redirect subwindows
     */
    public void redirectSubwindows(Window window, int update) {
  Request request = new Request (display, major_opcode, 2, 3);
  request.write4 (window.id);
  request.write1 (update);
  request.write1 (0);
  request.write2 (0);
  display.send_request (request);
    }
View Full Code Here

TOP

Related Classes of com.intellij.util.Alarm$Request

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.