Example usage for javax.swing JDialog getTitle

List of usage examples for javax.swing JDialog getTitle

Introduction

In this page you can find the example usage for javax.swing JDialog getTitle.

Prototype

public String getTitle() 

Source Link

Document

Gets the title of the dialog.

Usage

From source file:com.aw.swing.mvp.JDialogView.java

private void initializeDlg() {
    if (pst.isEmbeddedView()) {
        return;/*from  w  w w  .ja  va 2 s  .  c  om*/
    }
    JDialog dlg = (JDialog) parentContainer;

    dlg.add(viewLayout.mainPanel, BorderLayout.CENTER);

    //        SwingUtils.locateOnScreenCenter(dlg);
    SwingUtils.locateRelativeToMenu(dlg);
    dlg.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    dlg.addWindowListener(new java.awt.event.WindowAdapter() {
        // todo ver cmo se va a hacer esto en la versin Filthy
        public void windowOpened(WindowEvent e) {
            if (pst != null) {
                pst.onWindowsOpened(e);
                pst.onWindowsOpenedInternalOnlyForAWFW(e);
                if (!pst.isReadOnly()) {
                    //                        pst.setFocusToCmpOnWindowOpen();
                    //                        ActionManager.instance().getVisualMgrForActions().repaintMainDisabledActions(pst.getActionRsr());
                } else {
                    pst.configureAsReanOnly();
                    JButton btnCancel = (JButton) pst.getIpView().getComponent("btnCancel");
                    if (btnCancel != null) {
                        btnCancel.requestFocusInWindow();
                    }
                }
            }
        }

        public void windowClosing(WindowEvent e) {
            MsgDisplayer.showMessage("sw.common.closeWindowDisabled");
        }

        public void windowActivated(WindowEvent e) {
            Object oppositeWindow = e.getOppositeWindow();

            if (oppositeWindow instanceof DlgMensaje) {
                logger.debug("Ignoring Windows activated for DlgMensaje");
                return;
            }
            if (oppositeWindow instanceof JDialog) {
                JDialog dlg = (JDialog) oppositeWindow;
                if (MessageDisplayer.GENERIC_MESSAGE_TITLE.equals(dlg.getTitle())) {
                    logger.debug("Ignoring Windows activated for System Msg");
                    return;
                }
            }
            logger.debug("Windows Activated:" + pst);
            AWWindowsManager.instance().setPresenterActivated(pst);
        }
    });
}

From source file:jeplus.JEPlusFrameMain.java

private void jMenuItemConfigActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemConfigActionPerformed
    JDialog ConfigDialog = new JDialog(this, "Configuration file: ", true);
    if (jplProgConfPanel == null) {
        jplProgConfPanel = new JPanelProgConfiguration(ConfigDialog, JEPlusConfig.getDefaultInstance());
    }/*from w w w .j a v  a 2  s .  c om*/
    jplProgConfPanel.setHostWindow(ConfigDialog);
    ConfigDialog.getContentPane().add(jplProgConfPanel);
    ConfigDialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    ConfigDialog.setTitle(ConfigDialog.getTitle() + jplProgConfPanel.getConfigFile());
    ConfigDialog.pack();
    ConfigDialog.setSize(900, 650);
    ConfigDialog.setLocationRelativeTo(this);
    ConfigDialog.setVisible(true);
}

From source file:org.eclipse.jubula.rc.swing.listener.RecordActions.java

/**
 * select item//w w w  .  j  av  a 2 s  .c  om
 * @param window Component
 * @param id IComponentIdentifier
 * @param a Action
 */
protected void waitForWindow(Component window, IComponentIdentifier id, Action a) {
    String title = null;
    if (window instanceof JFrame) {
        JFrame jf = (JFrame) window;
        title = StringParsing.singleQuoteText(jf.getTitle());
    }
    if (window instanceof JDialog) {
        JDialog jd = (JDialog) window;
        title = StringParsing.singleQuoteText(jd.getTitle());
    }
    if (title != null && !(title.equals(StringConstants.EMPTY))) {
        String operator = Constants.REC_OPERATOR;
        String delay = new Integer(Constants.REC_WAIT_DELAY).toString();

        String timeout = null;
        long timestamp = AUTServer.getInstance().getObservTimestamp();

        if (timestamp == 0) {
            timeout = new Integer(Constants.REC_WAIT_TIMEOUT).toString();
        } else {
            long timeoutLong = (System.currentTimeMillis() - timestamp) + 10000;
            double timeoutDouble = (Math.ceil(timeoutLong / 5000.0)) * 5000.0;
            int timeoutInt = (int) timeoutDouble;
            timeout = new Integer(timeoutInt).toString();
        }

        java.util.List winValues = new LinkedList();
        winValues.add(title);
        winValues.add(operator);
        winValues.add(timeout);
        winValues.add(delay);
        createCAP(a, id, winValues);
    }
}