Package org.eclipse.jface.bindings.keys

Examples of org.eclipse.jface.bindings.keys.KeyStroke


               
            public void keyPressed(KeyEvent e) {
                int keyCode = e.keyCode;
                char character = e.character;
                int accelerator = SWTKeySupport.convertEventToUnmodifiedAccelerator(e);
                KeyStroke keyStroke = SWTKeySupport.convertAcceleratorToKeyStroke(accelerator);
   
        //System.out.println("\nPRESSED");
        //printKeyEvent(e);
        //System.out.println("accelerat:\t" + accelerator + "\t (" +
        // KeySupport.formatStroke(Stroke.create(accelerator), true) +
View Full Code Here


               
            public void keyPressed(KeyEvent e) {
                int keyCode = e.keyCode;
                char character = e.character;
                int accelerator = SWTKeySupport.convertEventToUnmodifiedAccelerator(e);
                KeyStroke keyStroke = SWTKeySupport.convertAcceleratorToKeyStroke(accelerator);
   
        //System.out.println("\nPRESSED");
        //printKeyEvent(e);
        //System.out.println("accelerat:\t" + accelerator + "\t (" +
        // KeySupport.formatStroke(Stroke.create(accelerator), true) +
View Full Code Here

                  editor.setFocus();
                }
                continue;
              }

              KeyStroke keyStroke = KeyStroke.getInstance(sequence);

              Event event = new Event();
              event.widget = display.getActiveShell();

              ArrayList<KeyStroke> keyStrokes = new ArrayList<KeyStroke>();
View Full Code Here

    setErrorMessage(null);
    setPageComplete(true);
  }

  private void addRefContentProposalToText(final Text textField) {
    KeyStroke stroke = UIUtils
        .getKeystrokeOfBestActiveBindingFor(IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST);
    if (stroke != null)
      UIUtils.addBulbDecorator(textField, NLS.bind(
          UIText.GerritConfigurationPage_BranchTooltipHover,
          stroke.format()));

    IContentProposalProvider cp = new IContentProposalProvider() {
      public IContentProposal[] getProposals(String contents, int position) {
        List<IContentProposal> resultList = new ArrayList<IContentProposal>();
View Full Code Here

      }
    });
  }

  private void addRefContentProposalToText(final Text textField) {
    KeyStroke stroke = UIUtils
        .getKeystrokeOfBestActiveBindingFor(IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST);
    if (stroke != null)
      UIUtils.addBulbDecorator(textField, NLS.bind(
          UIText.FetchGerritChangePage_ContentAssistTooltip,
          stroke.format()));

    IContentProposalProvider cp = new IContentProposalProvider() {
      public IContentProposal[] getProposals(String contents, int position) {
        List<IContentProposal> resultList = new ArrayList<IContentProposal>();
View Full Code Here

      // cancellation
    }
  }

  private void addRefContentProposalToText(final Text textField) {
    KeyStroke stroke = UIUtils
        .getKeystrokeOfBestActiveBindingFor(IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST);
    if (stroke != null)
      UIUtils.addBulbDecorator(textField, NLS.bind(
          UIText.PushToGerritPage_ContentProposalHoverText,
          stroke.format()));

    IContentProposalProvider cp = new IContentProposalProvider() {
      public IContentProposal[] getProposals(String contents, int position) {
        List<IContentProposal> resultList = new ArrayList<IContentProposal>();
View Full Code Here

   *            the dialog settings
   * @return the handler the proposal handler
   */
  public static IPreviousValueProposalHandler addPreviousValuesContentProposalToText(
      final Text textField, final String preferenceKey) {
    KeyStroke stroke = UIUtils
        .getKeystrokeOfBestActiveBindingFor(IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST);
    if (stroke == null)
      addBulbDecorator(textField,
          UIText.UIUtils_StartTypingForPreviousValuesMessage);
    else
      addBulbDecorator(
          textField,
          NLS.bind(UIText.UIUtils_PressShortcutMessage,
              stroke.format()));

    IContentProposalProvider cp = new IContentProposalProvider() {

      public IContentProposal[] getProposals(String contents, int position) {

View Full Code Here

   * @param refListProvider
   *            provides the {@link Ref}s to show in the proposal
   */
  public static final void addRefContentProposalToText(final Text textField,
      final Repository repository, final IRefListProvider refListProvider) {
    KeyStroke stroke = UIUtils
        .getKeystrokeOfBestActiveBindingFor(IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST);
    if (stroke == null)
      addBulbDecorator(textField,
          UIText.UIUtils_StartTypingForPreviousValuesMessage);
    else
      addBulbDecorator(
          textField,
          NLS.bind(UIText.UIUtils_PressShortcutMessage,
              stroke.format()));

    IContentProposalProvider cp = new IContentProposalProvider() {
      public IContentProposal[] getProposals(String contents, int position) {
        List<IContentProposal> resultList = new ArrayList<IContentProposal>();

View Full Code Here

      controlDeco.setDescriptionText(Messages.OwlUI_CONTENT_ASSIST);
      controlDeco.setShowOnlyOnFocus(true);
    }

    /* Auto-Activate on Key-Down */
    KeyStroke activationKey = KeyStroke.getInstance(SWT.ARROW_DOWN);

    /* Create Content Proposal Adapter */
    SimpleContentProposalProvider proposalProvider = new SimpleContentProposalProvider(new String[0]) {
      @Override
      public IContentProposal[] getProposals(String contents, int position) {
View Full Code Here

   *
   * @param ch a character.
   * @return the keystroke applicable corresponding to the character.
   */
  public KeyStroke keyStrokeFor(char ch) {
    KeyStroke keyStroke = keyStrokes.getValue(ch);
    if (keyStroke != null) {
      return keyStroke;
    }
    throw new IllegalArgumentException("no stroke available for character '" + ch + "'");
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.bindings.keys.KeyStroke

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.