Package java.awt.event

Examples of java.awt.event.FocusListener


                NavigationComponentHelper.this.mouseMoved(e);
            }
        };
        c.addMouseMotionListener(inputAdapter);
        c.addMouseListener(inputAdapter);
        c.addFocusListener(new FocusListener() {
            @Override
            public void focusGained(FocusEvent e) {
                repaintSelections(c);
                NavigationComponentHelper.this.focusGained(e);
            }
View Full Code Here


                public void actionPerformed (ActionEvent event) {
                    emitOnMainThread(_element.finishedEditing(), true);
                }
            });
        }
        _textComp.addFocusListener(new FocusListener() {
            @Override public void focusGained (FocusEvent e) {
                updateOnMainThread(instance()._focus, _element.field());
            }
            @Override public void focusLost (FocusEvent e) {
                JavaTPPlatform.emitOnMainThread(_element.finishedEditing(), false);
View Full Code Here

        terminal.print(g);
      }
    };
    tPanel.add("Center", terminal);

    terminal.addFocusListener(new FocusListener() {
      public void focusGained(FocusEvent evt) {
        if (debug > 0)
          System.err.println("Terminal: focus gained");
        terminal.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
        bus.broadcast(new FocusStatus(Terminal.this, evt));
View Full Code Here

            innerPanel.setBackground(COMBO_BOX_BACKGROUND);
            innerPanel.add(new JLabel(Icons.COMMON_ARROW_DOWN), BorderLayout.EAST);

            innerPanel.setFocusable(true);
            innerPanel.addFocusListener(new FocusListener() {
                @Override
                public void focusGained(FocusEvent e) {
                    isActive = true;
                    updateUI();
                }
View Full Code Here

            editorTextField.setOpaque(false);
        }
        leadPanel.add(editorTextField);
        editorTextField.putClientProperty("AuxEditorComponent", Boolean.TRUE);

        editorTextField.addFocusListener(new FocusListener() {
            @Override
            public void focusGained(final FocusEvent e) {
                editorTextField.repaint();
            }
View Full Code Here

    private void init()
    {
        // Register the handler for focus listening. This handler will
        // only notify the registered when the text changes from when
        // the focus is gained to when it is lost.
        mTextField.addFocusListener(new FocusListener(){

            String oldValue = ""; // A temporary cache.

            /**
             * Callback method when the focus to the Text Field component
View Full Code Here

        yScaleModel.addChangeListener(scaleListener);
        zScaleModel.addChangeListener(scaleListener);

        // Listen for focus gained on the text field's of the spinners. Select
        // all of the text
        FocusListener focusListener = new FocusAdapter() {

            @Override
            public void focusGained(final FocusEvent e) {
                SwingUtilities.invokeLater(new Runnable() {
View Full Code Here

                    skipPreExtensionJS.setSelected(false);
                }
            }
        });

        this.preExtensionJS.addFocusListener(new FocusListener() {
            @Override
            public void focusGained(FocusEvent fe) {
            }

            @Override
            public void focusLost(FocusEvent fe) {
                String text = preExtensionJS.getText();
                if (text == null || text.trim().isEmpty()) {
                    text = "min";
                    preExtensionJS.setText(text);
                } else {
                    text = text.trim();
                }
                minifyProperty.setPreExtensionJS(text);
            }
        });

        this.separatorJS.addFocusListener(new FocusListener() {
            @Override
            public void focusGained(FocusEvent fe) {
            }

            @Override
            public void focusLost(FocusEvent fe) {
                String text = separatorJS.getText();
                if (text == null || text.trim().isEmpty()) {
                    text = ".";
                } else {
                    text = String.valueOf(text.trim().charAt(0));
                }
                if (text.equals("<") || text.equals(">")
                        || text.equals(":") || text.equals("/")
                        || text.equals("\\") || text.equals("|")
                        || text.equals("?") || text.equals("*")) {
                    text = ".";
                }
                separatorJS.setText(text);
                minifyProperty.setSeparatorJS(text.charAt(0));
            }
        });

        this.jsObfuscate.addItemListener(new ItemListener() {
            @Override
            public void itemStateChanged(ItemEvent e) {
                if (e.getStateChange() == ItemEvent.SELECTED) {
                    minifyProperty.setJsObfuscate(Boolean.TRUE);
                } else {
                    minifyProperty.setJsObfuscate(Boolean.FALSE);
                }
            }
        });

        newCSSFile.setSelected(minifyProperty.isNewCSSFile());
        preExtensionCSS.setEnabled(minifyProperty.isNewCSSFile());
        preExtensionCSS_Label.setEnabled(minifyProperty.isNewCSSFile());
        separatorCSS.setEnabled(minifyProperty.isNewCSSFile());
        separatorCSS_Label.setEnabled(minifyProperty.isNewCSSFile());
        skipPreExtensionCSS.setEnabled(minifyProperty.isNewCSSFile());
        this.preExtensionCSS.setText(minifyProperty.getPreExtensionCSS());
        this.separatorCSS.setText(minifyProperty.getSeparatorCSS().toString());

        this.newCSSFile.addItemListener(new ItemListener() {
            @Override
            public void itemStateChanged(ItemEvent e) {
                if (e.getStateChange() == ItemEvent.SELECTED) {
                    minifyProperty.setNewCSSFile(Boolean.TRUE);
                    minifyProperty.setPreExtensionCSS("min");
                    preExtensionCSS.setText("min");
                    minifyProperty.setSeparatorCSS('.');
                    separatorCSS.setText(".");
                    preExtensionCSS.setEnabled(Boolean.TRUE);
                    preExtensionCSS_Label.setEnabled(Boolean.TRUE);
                    separatorCSS.setEnabled(Boolean.TRUE);
                    separatorCSS_Label.setEnabled(Boolean.TRUE);
                    if (minifyProperty.isBuildCSSMinify() && minifyProperty.isNewCSSFile()) {
                        skipPreExtensionCSS.setEnabled(Boolean.TRUE);
                        minifyProperty.setSkipPreExtensionCSS(Boolean.TRUE);
                        skipPreExtensionCSS.setSelected(Boolean.TRUE);
                    }

                } else {
                    minifyProperty.setNewCSSFile(Boolean.FALSE);
                    preExtensionCSS.setEnabled(Boolean.FALSE);
                    preExtensionCSS_Label.setEnabled(Boolean.FALSE);
                    separatorCSS.setEnabled(Boolean.FALSE);
                    separatorCSS_Label.setEnabled(Boolean.FALSE);
                    skipPreExtensionCSS.setEnabled(Boolean.FALSE);
                    minifyProperty.setSkipPreExtensionCSS(Boolean.FALSE);
                    skipPreExtensionCSS.setSelected(Boolean.FALSE);
                }
            }
        });

        this.preExtensionCSS.addFocusListener(new FocusListener() {
            @Override
            public void focusGained(FocusEvent fe) {
            }

            @Override
            public void focusLost(FocusEvent fe) {
                String text = preExtensionCSS.getText();
                if (text == null || text.trim().isEmpty()) {
                    text = "min";
                    preExtensionCSS.setText(text);
                } else {
                    text = text.trim();
                }
                minifyProperty.setPreExtensionCSS(text);
            }
        });

        this.separatorCSS.addFocusListener(new FocusListener() {
            @Override
            public void focusGained(FocusEvent fe) {
            }

            @Override
            public void focusLost(FocusEvent fe) {
                String text = separatorCSS.getText();
                if (text == null || text.trim().isEmpty()) {
                    text = ".";
                } else {
                    text = String.valueOf(text.trim().charAt(0));
                }
                if (text.equals("<") || text.equals(">")
                        || text.equals(":") || text.equals("/")
                        || text.equals("\\") || text.equals("|")
                        || text.equals("?") || text.equals("*")) {
                    text = ".";
                }
                separatorCSS.setText(text);
                minifyProperty.setSeparatorCSS(text.charAt(0));
            }
        });

//---------------------------------------------------------------------------------------------//

        /* HTML Minify Setting */
        newHTMLFile.setSelected(minifyProperty.isNewHTMLFile());
        preExtensionHTML.setEnabled(minifyProperty.isNewHTMLFile());
        preExtensionHTML_Label.setEnabled(minifyProperty.isNewHTMLFile());
        separatorHTML.setEnabled(minifyProperty.isNewHTMLFile());
        separatorHTML_Label.setEnabled(minifyProperty.isNewHTMLFile());
        skipPreExtensionHTML.setEnabled(minifyProperty.isNewHTMLFile());
        this.preExtensionHTML.setText(minifyProperty.getPreExtensionHTML());
        this.separatorHTML.setText(minifyProperty.getSeparatorHTML().toString());

        this.newHTMLFile.addItemListener(new ItemListener() {
            @Override
            public void itemStateChanged(ItemEvent e) {
                if (e.getStateChange() == ItemEvent.SELECTED) {
                    minifyProperty.setNewHTMLFile(Boolean.TRUE);
                    minifyProperty.setPreExtensionHTML("min");
                    preExtensionHTML.setText("min");
                    minifyProperty.setSeparatorHTML('.');
                    separatorHTML.setText(".");
                    preExtensionHTML.setEnabled(Boolean.TRUE);
                    preExtensionHTML_Label.setEnabled(Boolean.TRUE);
                    separatorHTML.setEnabled(Boolean.TRUE);
                    separatorHTML_Label.setEnabled(Boolean.TRUE);
                    if (minifyProperty.isBuildHTMLMinify() && minifyProperty.isNewHTMLFile()) {
                        skipPreExtensionHTML.setEnabled(Boolean.TRUE);
                        minifyProperty.setSkipPreExtensionHTML(Boolean.TRUE);
                        skipPreExtensionHTML.setSelected(Boolean.TRUE);
                    }

                } else {
                    minifyProperty.setNewHTMLFile(Boolean.FALSE);
//                    minifyProperty.setPreExtensionHTML(null);
//                    preExtensionHTML.setText("");
//                    minifyProperty.setSeparatorHTML(null);
//                    separatorHTML.setText("");
                    preExtensionHTML.setEnabled(Boolean.FALSE);
                    preExtensionHTML_Label.setEnabled(Boolean.FALSE);
                    separatorHTML.setEnabled(Boolean.FALSE);
                    separatorHTML_Label.setEnabled(Boolean.FALSE);
                    skipPreExtensionHTML.setEnabled(Boolean.FALSE);
                    minifyProperty.setSkipPreExtensionHTML(Boolean.FALSE);
                    skipPreExtensionHTML.setSelected(Boolean.FALSE);

                }
                //minifyPropertyController.writeMinifyProperty(minifyProperty);
            }
        });

        this.preExtensionHTML.addFocusListener(new FocusListener() {
            @Override
            public void focusGained(FocusEvent fe) {
            }

            @Override
            public void focusLost(FocusEvent fe) {
                String text = preExtensionHTML.getText();
                if (text == null || text.trim().isEmpty()) {
                    text = "min";
                    preExtensionHTML.setText(text);
                } else {
                    text = text.trim();
                }
                minifyProperty.setPreExtensionHTML(text);
                //minifyPropertyController.writeMinifyProperty(minifyProperty);
            }
        });

        this.separatorHTML.addFocusListener(new FocusListener() {
            @Override
            public void focusGained(FocusEvent fe) {
            }

            @Override
            public void focusLost(FocusEvent fe) {
                String text = separatorHTML.getText();
                if (text == null || text.trim().isEmpty()) {
                    text = ".";
                } else {
                    text = String.valueOf(text.trim().charAt(0));
                }
                if (text.equals("<") || text.equals(">")
                        || text.equals(":") || text.equals("/")
                        || text.equals("\\") || text.equals("|")
                        || text.equals("?") || text.equals("*")) {
                    text = ".";
                }
                separatorHTML.setText(text);
                minifyProperty.setSeparatorHTML(text.charAt(0));
                //minifyPropertyController.writeMinifyProperty(minifyProperty);
            }
        });

        if (minifyProperty.isBuildInternalCSSMinify()) {
            this.buildInternalCSSMinify.setSelected(Boolean.TRUE);
        }

        if (minifyProperty.isBuildInternalJSMinify()) {
            this.buildInternalJSMinify.setSelected(Boolean.TRUE);
        }
        this.buildInternalCSSMinify.addItemListener(new ItemListener() {
            @Override
            public void itemStateChanged(ItemEvent e) {
                if (e.getStateChange() == ItemEvent.SELECTED) {
                    minifyProperty.setBuildInternalCSSMinify(Boolean.TRUE);
                } else {
                    minifyProperty.setBuildInternalCSSMinify(Boolean.FALSE);
                }
                //minifyPropertyController.writeMinifyProperty(minifyProperty);
            }
        });
        this.buildInternalJSMinify.addItemListener(new ItemListener() {
            @Override
            public void itemStateChanged(ItemEvent e) {
                if (e.getStateChange() == ItemEvent.SELECTED) {
                    minifyProperty.setBuildInternalJSMinify(Boolean.TRUE);
                } else {
                    minifyProperty.setBuildInternalJSMinify(Boolean.FALSE);
                }
                //minifyPropertyController.writeMinifyProperty(minifyProperty);
            }
        });

        //-----------------------------------------------------------------------------------------------//
        /**
         * XML Setting *
         */
        newXMLFile.setSelected(minifyProperty.isNewXMLFile());
        preExtensionXML.setEnabled(minifyProperty.isNewXMLFile());
        preExtensionXML_Label.setEnabled(minifyProperty.isNewXMLFile());
        separatorXML.setEnabled(minifyProperty.isNewXMLFile());
        separatorXML_Label.setEnabled(minifyProperty.isNewXMLFile());
        skipPreExtensionXML.setEnabled(minifyProperty.isNewXMLFile());
        this.preExtensionXML.setText(minifyProperty.getPreExtensionXML());
        this.separatorXML.setText(minifyProperty.getSeparatorXML().toString());

        this.newXMLFile.addItemListener(new ItemListener() {
            @Override
            public void itemStateChanged(ItemEvent e) {
                if (e.getStateChange() == ItemEvent.SELECTED) {
                    minifyProperty.setNewXMLFile(Boolean.TRUE);
                    minifyProperty.setPreExtensionXML("min");
                    preExtensionXML.setText("min");
                    minifyProperty.setSeparatorXML('.');
                    separatorXML.setText(".");
                    preExtensionXML.setEnabled(Boolean.TRUE);
                    preExtensionXML_Label.setEnabled(Boolean.TRUE);
                    separatorXML.setEnabled(Boolean.TRUE);
                    separatorXML_Label.setEnabled(Boolean.TRUE);
                    if (minifyProperty.isBuildXMLMinify() && minifyProperty.isNewXMLFile()) {
                        skipPreExtensionXML.setEnabled(Boolean.TRUE);
                        minifyProperty.setSkipPreExtensionXML(Boolean.TRUE);
                        skipPreExtensionXML.setSelected(Boolean.TRUE);
                    }

                } else {
                    minifyProperty.setNewXMLFile(Boolean.FALSE);
                    preExtensionXML.setEnabled(Boolean.FALSE);
                    preExtensionXML_Label.setEnabled(Boolean.FALSE);
                    separatorXML.setEnabled(Boolean.FALSE);
                    separatorXML_Label.setEnabled(Boolean.FALSE);
                    skipPreExtensionXML.setEnabled(Boolean.FALSE);
                    minifyProperty.setSkipPreExtensionXML(Boolean.FALSE);
                    skipPreExtensionXML.setSelected(Boolean.FALSE);
                }
            }
        });

        this.preExtensionXML.addFocusListener(new FocusListener() {
            @Override
            public void focusGained(FocusEvent fe) {
            }

            @Override
            public void focusLost(FocusEvent fe) {
                String text = preExtensionXML.getText();
                if (text == null || text.trim().isEmpty()) {
                    text = "min";
                    preExtensionXML.setText(text);
                } else {
                    text = text.trim();
                }
                minifyProperty.setPreExtensionXML(text);
            }
        });

        this.separatorXML.addFocusListener(new FocusListener() {
            @Override
            public void focusGained(FocusEvent fe) {
            }

            @Override
            public void focusLost(FocusEvent fe) {
                String text = separatorXML.getText();
                if (text == null || text.trim().isEmpty()) {
                    text = ".";
                } else {
                    text = String.valueOf(text.trim().charAt(0));
                }
                if (text.equals("<") || text.equals(">")
                        || text.equals(":") || text.equals("/")
                        || text.equals("\\") || text.equals("|")
                        || text.equals("?") || text.equals("*")) {
                    text = ".";
                }
                separatorXML.setText(text);
                minifyProperty.setSeparatorXML(text.charAt(0));
            }
        });

//---------------------------------------------------------------------------------------------//
        /**
         * JSON Setting *
         */
        newJSONFile.setSelected(minifyProperty.isNewJSONFile());
        preExtensionJSON.setEnabled(minifyProperty.isNewJSONFile());
        preExtensionJSON_Label.setEnabled(minifyProperty.isNewJSONFile());
        separatorJSON.setEnabled(minifyProperty.isNewJSONFile());
        separatorJSON_Label.setEnabled(minifyProperty.isNewJSONFile());
        skipPreExtensionJSON.setEnabled(minifyProperty.isNewJSONFile());
        this.preExtensionJSON.setText(minifyProperty.getPreExtensionJSON());
        this.separatorJSON.setText(minifyProperty.getSeparatorJSON().toString());

        this.newJSONFile.addItemListener(new ItemListener() {
            @Override
            public void itemStateChanged(ItemEvent e) {
                if (e.getStateChange() == ItemEvent.SELECTED) {
                    minifyProperty.setNewJSONFile(Boolean.TRUE);
                    minifyProperty.setPreExtensionJSON("min");
                    preExtensionJSON.setText("min");
                    minifyProperty.setSeparatorJSON('.');
                    separatorJSON.setText(".");
                    preExtensionJSON.setEnabled(Boolean.TRUE);
                    preExtensionJSON_Label.setEnabled(Boolean.TRUE);
                    separatorJSON.setEnabled(Boolean.TRUE);
                    separatorJSON_Label.setEnabled(Boolean.TRUE);
                    if (minifyProperty.isBuildJSONMinify() && minifyProperty.isNewJSONFile()) {
                        skipPreExtensionJSON.setEnabled(Boolean.TRUE);
                        minifyProperty.setSkipPreExtensionJSON(Boolean.TRUE);
                        skipPreExtensionJSON.setSelected(Boolean.TRUE);
                    }

                } else {
                    minifyProperty.setNewJSONFile(Boolean.FALSE);
                    preExtensionJSON.setEnabled(Boolean.FALSE);
                    preExtensionJSON_Label.setEnabled(Boolean.FALSE);
                    separatorJSON.setEnabled(Boolean.FALSE);
                    separatorJSON_Label.setEnabled(Boolean.FALSE);
                    skipPreExtensionJSON.setEnabled(Boolean.FALSE);
                    minifyProperty.setSkipPreExtensionJSON(Boolean.FALSE);
                    skipPreExtensionJSON.setSelected(Boolean.FALSE);
                }
            }
        });

        this.preExtensionJSON.addFocusListener(new FocusListener() {
            @Override
            public void focusGained(FocusEvent fe) {
            }

            @Override
            public void focusLost(FocusEvent fe) {
                String text = preExtensionJSON.getText();
                if (text == null || text.trim().isEmpty()) {
                    text = "min";
                    preExtensionJSON.setText(text);
                } else {
                    text = text.trim();
                }
                minifyProperty.setPreExtensionJSON(text);
            }
        });

        this.separatorJSON.addFocusListener(new FocusListener() {
            @Override
            public void focusGained(FocusEvent fe) {
            }

            @Override
View Full Code Here

    detail = new JEditorPane(ChainsawConstants.DETAIL_CONTENT_TYPE, "");
    detail.setEditable(false);

    detailPaneUpdater = new DetailPaneUpdater();

    addFocusListener(new FocusListener() {

        public void focusGained(FocusEvent e) {
            detailPaneUpdater.updateDetailPane();
        }
View Full Code Here

  private void initializeGui() {
    // Create the panel
    frame = new JPanel(new BorderLayout());

    // When gained focus, select the chat box
    frame.addFocusListener(new FocusListener() {
      @Override
      public void focusGained(FocusEvent e) {
        chatTextArea.requestFocus();
      }
      @Override
View Full Code Here

TOP

Related Classes of java.awt.event.FocusListener

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.