Package com.google.gwtexpui.globalkey.client

Examples of com.google.gwtexpui.globalkey.client.KeyCommandSet


import com.google.gwtexpui.globalkey.client.KeyCommand;
import com.google.gwtexpui.globalkey.client.KeyCommandSet;

class JumpKeys {
  static void register(final Widget body) {
    final KeyCommandSet jumps = new KeyCommandSet();

    jumps.add(new KeyCommand(0, 'o', Gerrit.C.jumpAllOpen()) {
      @Override
      public void onKeyPress(final KeyPressEvent event) {
        Gerrit.display(PageLinks.toChangeQuery("status:open"));
      }
    });
    jumps.add(new KeyCommand(0, 'm', Gerrit.C.jumpAllMerged()) {
      @Override
      public void onKeyPress(final KeyPressEvent event) {
        Gerrit.display(PageLinks.toChangeQuery("status:merged"));
      }
    });
    jumps.add(new KeyCommand(0, 'a', Gerrit.C.jumpAllAbandoned()) {
      @Override
      public void onKeyPress(final KeyPressEvent event) {
        Gerrit.display(PageLinks.toChangeQuery("status:abandoned"));
      }
    });

    if (Gerrit.isSignedIn()) {
      jumps.add(new KeyCommand(0, 'i', Gerrit.C.jumpMine()) {
        @Override
        public void onKeyPress(final KeyPressEvent event) {
          Gerrit.display(PageLinks.MINE);
        }
      });
      jumps.add(new KeyCommand(0, 'd', Gerrit.C.jumpMineDrafts()) {
        @Override
        public void onKeyPress(final KeyPressEvent event) {
          Gerrit.display(PageLinks.toChangeQuery("is:draft"));
        }
      });
      jumps.add(new KeyCommand(0, 'c', Gerrit.C.jumpMineDraftComments()) {
        @Override
        public void onKeyPress(final KeyPressEvent event) {
          Gerrit.display(PageLinks.toChangeQuery("has:draft"));
        }
      });
      jumps.add(new KeyCommand(0, 'w', Gerrit.C.jumpMineWatched()) {
        @Override
        public void onKeyPress(final KeyPressEvent event) {
          Gerrit.display(PageLinks.toChangeQuery("is:watched status:open"));
        }
      });
      jumps.add(new KeyCommand(0, 's', Gerrit.C.jumpMineStarred()) {
        @Override
        public void onKeyPress(final KeyPressEvent event) {
          Gerrit.display(PageLinks.toChangeQuery("is:starred"));
        }
      });
    }

    final KeyCommandSet jumping = new KeyCommandSet(Gerrit.C.sectionJumping());
    jumping.add(new CompoundKeyCommand(0, 'g', "", jumps));
    GlobalKey.add(body, jumping);
  }
View Full Code Here


    if (Gerrit.isSignedIn()) {
      setTitleFarEast(reviewed);
    }

    keysNavigation = new KeyCommandSet(Gerrit.C.sectionNavigation());
    keysNavigation.add(new UpToChangeCommand(patchKey.getParentKey(), 0, 'u'));
    keysNavigation.add(new FileListCmd(0, 'f', PatchUtil.C.fileList()));

    historyTable = new HistoryTable(this);
View Full Code Here

  private boolean computedScrollType;
  private ScrollPanel parentScrollPanel;

  protected NavigationTable() {
    pointer = new Image(Gerrit.RESOURCES.arrowRight());
    keysNavigation = new KeyCommandSet(Gerrit.C.sectionNavigation());
    keysAction = new KeyCommandSet(Gerrit.C.sectionActions());
  }
View Full Code Here

    keysNavigation.add(new NextChunkKeyCmd(0, 'n', PatchUtil.C.chunkNext()));
    keysNavigation.add(new PrevCommentCmd(0, 'P', PatchUtil.C.commentPrev()));
    keysNavigation.add(new NextCommentCmd(0, 'N', PatchUtil.C.commentNext()));

    keysAction.add(new OpenKeyCommand(0, 'o', PatchUtil.C.expandComment()));
    keysOpenByEnter = new KeyCommandSet(Gerrit.C.sectionNavigation());
    keysOpenByEnter.add(new OpenKeyCommand(0, KeyCodes.KEY_ENTER, PatchUtil.C.expandComment()));

    if (Gerrit.isSignedIn()) {
      keysAction.add(new InsertCommentCommand(0, 'c', PatchUtil.C
          .commentInsert()));
      keysAction.add(new PublishCommentsKeyCommand(0, 'r', Util.C
          .keyPublishComments()));

      // See CommentEditorPanel
      //
      keysComment = new KeyCommandSet(PatchUtil.C.commentEditorSet());
      keysComment.add(new NoOpKeyCommand(KeyCommand.M_CTRL, 's', PatchUtil.C
          .commentSaveDraft()));
      keysComment.add(new NoOpKeyCommand(0, KeyCodes.KEY_ESCAPE, PatchUtil.C
          .commentCancelEdit()));
    } else {
View Full Code Here

    detailCache.addValueChangeHandler(this);

    addStyleName(Gerrit.RESOURCES.css().changeScreen());
    addStyleName(Gerrit.RESOURCES.css().screenNoHeader());

    keysNavigation = new KeyCommandSet(Gerrit.C.sectionNavigation());
    keysAction = new KeyCommandSet(Gerrit.C.sectionActions());
    keysNavigation.add(new UpToListKeyCommand(0, 'u', Util.C.upToChangeList()));
    keysNavigation.add(new ExpandCollapseDependencySectionKeyCommand(0, 'd', Util.C.expandCollapseDependencies()));

    if (Gerrit.isSignedIn()) {
      keysAction.add(new PublishCommentsKeyCommand(0, 'r', Util.C
View Full Code Here

    patchSetPanels.put(id, patchSetPanel);
  }

  public void setRegisterKeys(final boolean on) {
    if (on) {
      KeyCommandSet keysNavigation =
          new KeyCommandSet(Gerrit.C.sectionNavigation());
      keysNavigation.add(new PreviousPatchSetKeyCommand(0, 'p', Util.C
          .previousPatchSet()));
      keysNavigation.add(new NextPatchSetKeyCommand(0, 'n', Util.C
          .nextPatchSet()));
      regNavigation = GlobalKey.add(this, keysNavigation);
      if (activePatchSetId != null) {
        activate(activePatchSetId);
      } else {
View Full Code Here

TOP

Related Classes of com.google.gwtexpui.globalkey.client.KeyCommandSet

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.