Package echopointng

Examples of echopointng.KeyStrokeListener


    /**
     * Override this to create your own keytroke-listener
     **/
    protected KeyStrokeListener createKeyStrokeListener() {
        KeyStrokeListener ks = new KeyStrokeListener();

        ks.addKeyCombination(KeyStrokeListener.ALT_MASK + KeyStrokeListener.VK_O, "OK");
        ks.addKeyCombination(KeyStrokeListener.VK_F10,"OK");
        ks.addActionListener(new ActionListener() {

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent arg0) {
                if (arg0.getActionCommand().equals("OK")) {
View Full Code Here


     * This window needs it's own keystroke-listener because ENTER can be
     * used within the textareas
     */
    @Override
    protected KeyStrokeListener createKeyStrokeListener() {
        KeyStrokeListener ks = new KeyStrokeListener();
        ks.addKeyCombination(KeyStrokeListener.VK_ESCAPE, "CANCEL");
        ks.addActionListener(new ActionListener() {

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent arg0) {
                if (arg0.getActionCommand().equals("CANCEL")) {
View Full Code Here

        Row topRow = new Row();
        topRow.setCellSpacing(new JbsExtent(DIALOG_INSETS));
        topRow.add(iconLabel);
        topRow.add(messageColumn);

        KeyStrokeListener ks = new KeyStrokeListener();

        ArrayList<JbsButton> buttons = new ArrayList<JbsButton>();

        if (optionType == DEFAULT_OPTION) {
            buttons.add(defaultButton = createButton(JbsL10N.getString("Generic.ok"), OK_OPTION));
            ks.addKeyCombination(KeyStrokeListener.VK_RETURN, OK_OPTION);
        } else if (optionType == YES_NO_OPTION) {
            buttons.add(defaultButton = createButton(JbsL10N.getString("Generic.yes"), YES_OPTION));
            ks.addKeyCombination(KeyStrokeListener.VK_RETURN, YES_OPTION);
            buttons.add(createButton(JbsL10N.getString("Generic.no"), NO_OPTION));
            ks.addKeyCombination(KeyStrokeListener.VK_ESCAPE, NO_OPTION);
        } else if (optionType == YES_NO_CANCEL_OPTION) {
            buttons.add(defaultButton = createButton(JbsL10N.getString("Generic.yes"), YES_OPTION));
            ks.addKeyCombination(KeyStrokeListener.VK_RETURN, YES_OPTION);
            buttons.add(createButton(JbsL10N.getString("Generic.no"), NO_OPTION));
            buttons.add(createButton(JbsL10N.getString("Generic.cancel"), CANCEL_OPTION));
            ks.addKeyCombination(KeyStrokeListener.VK_ESCAPE, CANCEL_OPTION);
        } else if (optionType == OK_CANCEL_OPTION) {
            buttons.add(defaultButton = createButton(JbsL10N.getString("Generic.ok"), OK_OPTION));
            ks.addKeyCombination(KeyStrokeListener.VK_RETURN, OK_OPTION);
            buttons.add(createButton(JbsL10N.getString("Generic.cancel"), CANCEL_OPTION));
            ks.addKeyCombination(KeyStrokeListener.VK_ESCAPE, CANCEL_OPTION);
        }
       
        if (btnDetails!=null)
            buttons.add(btnDetails);
       
        ks.addActionListener(this);
        topRow.add(ks);

        ButtonPanel buttonPanel = new ButtonPanel();
        ColumnLayoutData buttonPanelLayout = new ColumnLayoutData();
        buttonPanelLayout.setAlignment(new Alignment(Alignment.CENTER, Alignment.TOP));
View Full Code Here

       
        if (this.getKeyStrokeListener()!=null)
            colMain.remove(this.getKeyStrokeListener());
           

        this.setKeyStrokeListener(new KeyStrokeListener());
        this.getKeyStrokeListener().addKeyCombination(KeyStrokeListener.VK_DOWN, "DOWN");
        this.getKeyStrokeListener().addKeyCombination(KeyStrokeListener.VK_UP, "UP");
        this.getKeyStrokeListener().addKeyCombination(KeyStrokeListener.VK_RETURN, "EDIT");
        this.getKeyStrokeListener().addKeyCombination(KeyStrokeListener.ALT_MASK + KeyStrokeListener.VK_E);
        this.getKeyStrokeListener().addKeyCombination(KeyStrokeListener.VK_PAGE_DOWN, "NEXTPAGE");
View Full Code Here

    rowButtons.setAlignment(new Alignment(Alignment.RIGHT,Alignment.TOP));
    rowButtons.add(this.getBtnAdd());
    rowButtons.add(this.getBtnDelete());
    colMain.add(rowButtons);
   
    KeyStrokeListener ks = new KeyStrokeListener();
    ks.addKeyCombination(KeyStrokeListener.VK_INSERT,"INSERT");
    ks.addKeyCombination(KeyStrokeListener.VK_DELETE,"DELETE");
    ks.addActionListener(new ActionListener() {

      private static final long serialVersionUID = 1L;

      public void actionPerformed(ActionEvent arg0) {
        if (arg0.getActionCommand().equals("INSERT"))
View Full Code Here

        rowButtons.setAlignment(new Alignment(Alignment.RIGHT, Alignment.TOP));
        rowButtons.add(this.getBtnAdd());
        rowButtons.add(this.getBtnDelete());
        colMain.add(rowButtons);

        KeyStrokeListener ks = new KeyStrokeListener();
        ks.addKeyCombination(KeyStrokeListener.VK_INSERT, "INSERT");
        ks.addKeyCombination(KeyStrokeListener.VK_DELETE, "DELETE");
        ks.addActionListener(new ActionListener() {

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent arg0) {
                if (arg0.getActionCommand().equals("INSERT")) {
View Full Code Here

    /**
     * Override this to create your own keytroke-listener
     * @return
     */
    protected KeyStrokeListener createKeyStrokeListener() {
        KeyStrokeListener ks = new KeyStrokeListener();

        ks.addKeyCombination(KeyStrokeListener.VK_ALT + KeyStrokeListener.VK_O, "OK");
        ks.addKeyCombination(KeyStrokeListener.VK_CONTROL + KeyStrokeListener.VK_ENTER, "OK");
        ks.addActionListener(new ActionListener() {

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent arg0) {
                if (arg0.getActionCommand().equals("OK")) {
View Full Code Here

    protected void initKeystrokeListener() {
        //If a keystrokelistener already exists then remove it.
        if (ksListener != null)
            rowMain.remove(ksListener);

        ksListener = new KeyStrokeListener();
        ksListener.addKeyCombination(KeyStrokeListener.VK_RETURN, "OK");
        ksListener.addActionListener(new ActionListener() {

            private static final long serialVersionUID = 1L;
View Full Code Here

        this.getRowMain().add(this.getBtnSearch());
        this.createKeyStrokeListener();
    }
   
    protected void createKeyStrokeListener() {
        this.keyStrokeListener = new KeyStrokeListener();
        this.keyStrokeListener.addKeyCombination(KeyStrokeListener.VK_RETURN, "SEARCH");
        this.keyStrokeListener.addKeyCombination(KeyStrokeListener.ALT_MASK + KeyStrokeListener.VK_F);
        this.keyStrokeListener.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent arg0) {
View Full Code Here

TOP

Related Classes of echopointng.KeyStrokeListener

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.