Package mindnotes.client.presentation

Examples of mindnotes.client.presentation.KeyboardShortcuts$KeyBinding


  }

  @Test
  public void testKeyboardBindings() {
    KeyboardShortcuts ks = new KeyboardShortcuts();
    final Flag flag = new Flag();
    ks.addBinding(new KeyBinding('Z', true, false, false, new Command() {

      @Override
      public void execute() {
        flag.up();
      }
    }));

    flag.down();
    ks.onShortcutPressed('s', false, false, false);
    Assert.assertTrue(flag.isDown());

    flag.down();
    ks.onShortcutPressed('z', true, false, false);
    Assert.assertTrue(flag.isUp());

    flag.down();
    ks.onShortcutPressed('z', true, true, false);
    Assert.assertTrue(flag.isDown());

    flag.down();
    ks.onShortcutPressed('Z', true, false, false);
    Assert.assertTrue(flag.isUp());

  }
View Full Code Here


  }

  @Test
  public void testDoubleKeyboardBindings() {
    KeyboardShortcuts ks = new KeyboardShortcuts();
    final Flag flag1 = new Flag();
    final Flag flag2 = new Flag();
    ks.addBinding(new KeyBinding('Z', true, false, false, new Command() {

      @Override
      public void execute() {
        flag1.up();
      }
    }));

    ks.addBinding(new KeyBinding('Z', true, true, false, new Command() {

      @Override
      public void execute() {
        flag2.up();
      }
    }));

    flag1.down();
    flag2.down();
    ks.onShortcutPressed('z', true, false, false);
    Assert.assertTrue(flag1.isUp());
    Assert.assertTrue(flag2.isDown());

    flag1.down();
    flag2.down();
    ks.onShortcutPressed('z', true, true, false);
    Assert.assertTrue(flag1.isDown());
    Assert.assertTrue(flag2.isUp());

  }
View Full Code Here

            OMElement result = sendReceive(element, serviceURL);
            result = buildElement(result);

            ValidateResult validateResult = getValidateResult(result);
            List keybinds = validateResult.getKeyBindingList();
            KeyBinding keybinding = (KeyBinding) keybinds.get(0);

            Status status = keybinding.getStatus();

            return StatusValue.VALID.equals(status.getStatusValue());

        } catch (Exception ex) {
            if (LOG.isDebugEnabled()) {
View Full Code Here

        result.setId(getRamdomId());
        return result;
    }
   
    public static KeyBinding createKeyBinding() {
        KeyBinding keyBinding = new KeyBinding();
        keyBinding.setId(getRamdomId());
        return keyBinding;
    }
View Full Code Here

                BigInteger issuerSerial = cert.getSerialNumber();

                String alias = getAliasForX509Cert(subjectDN, issuerSerial);
                X509Certificate[] certs = getCertificates(alias);

                KeyBinding keyBinding = XKMSUtil.createKeyBinding();
                validateResult.addKeyBinding(keyBinding);

                addKeyInfo(respondWith, alias, certs, keyBinding);
                addKeyUsage(certs[0], keyBinding);
                addStatus(true, keyBinding);

                return validateResult;

            } else {

                ValidateResult result = XKMSUtil.createValidateResult();
                buildResultType((RequestAbstractType) validateRequest,
                        (ResultType) result);

                KeyBinding keybinding = XKMSUtil.createKeyBinding();
                X509Certificate[] certs = new X509Certificate[] { cert };

                addKeyInfo(validateRequest.getRespondWith(), null, certs,
                        keybinding);
                addKeyUsage(certs[0], keybinding);
View Full Code Here

    private void buildResultType(RequestAbstractType request,
            KRSSResult result, String aliase, KeyStore ks) throws XKMSException {

        buildResultType((RequestAbstractType) request, (ResultType) result);

        KeyBinding kb = XKMSUtil.createKeyBinding();
        result.addKeyBinding(kb);

        X509Certificate[] certs = getCertificates(aliase);

        List respondWithList = request.getRespondWith();
View Full Code Here

TOP

Related Classes of mindnotes.client.presentation.KeyboardShortcuts$KeyBinding

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.