diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-02-01 17:09:49 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-02-01 17:09:49 +0000 |
commit | abada90e3f84dc703b8ddc9efcbed8a946fadead (patch) | |
tree | 2c6f9dccd510ea97cb927a7bd635422efaae547a /java/src/IceGridGUI/LiveDeployment/WriteMessageDialog.java | |
parent | removing trace message (diff) | |
download | ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.bz2 ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.xz ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.zip |
Expanded tabs into spaces
Diffstat (limited to 'java/src/IceGridGUI/LiveDeployment/WriteMessageDialog.java')
-rw-r--r-- | java/src/IceGridGUI/LiveDeployment/WriteMessageDialog.java | 282 |
1 files changed, 141 insertions, 141 deletions
diff --git a/java/src/IceGridGUI/LiveDeployment/WriteMessageDialog.java b/java/src/IceGridGUI/LiveDeployment/WriteMessageDialog.java index 104c5136945..7c6f1cba72c 100644 --- a/java/src/IceGridGUI/LiveDeployment/WriteMessageDialog.java +++ b/java/src/IceGridGUI/LiveDeployment/WriteMessageDialog.java @@ -45,151 +45,151 @@ class WriteMessageDialog extends JDialog { WriteMessageDialog(final Root root) { - super(root.getCoordinator().getMainFrame(), - "Write Message - IceGrid Admin", true); - setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); - - _mainFrame = root.getCoordinator().getMainFrame(); - - _stdOut = new JRadioButton("Write to stdout"); - _stdOut.setSelected(true); - JRadioButton stdErr = new JRadioButton("Write to stderr"); - ButtonGroup bg = new ButtonGroup(); - bg.add(_stdOut); - bg.add(stdErr); - - JButton okButton = new JButton("OK"); - ActionListener okListener = new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - final Coordinator c = root.getCoordinator(); - final String target = _target; - final String prefix = "Writing message to server '" + target + "'..."; - - - AMI_Admin_writeMessage cb = new AMI_Admin_writeMessage() - { - public void ice_response() - { - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - c.getStatusBar().setText(prefix + "done."); - } - }); - } - - public void ice_exception(final Ice.UserException e) - { - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - handleFailure("IceGrid exception: " + e.toString()); - } - - }); - } - - public void ice_exception(final Ice.LocalException e) - { - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - handleFailure("Communication exception: " + e.toString()); - } - }); - } - - private void handleFailure(String message) - { - c.getStatusBar().setText(prefix + "failed!"); - - JOptionPane.showMessageDialog( - _mainFrame, - message, - "Writing message to server '" + target + "' failed", - JOptionPane.ERROR_MESSAGE); - } - }; - - try - { - c.getStatusBar().setText(prefix); - _mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - - c.getAdmin().writeMessage_async( - cb, _target, _message.getText(), _stdOut.isSelected() ? 1 : 2); - } - catch(Ice.LocalException ex) - { - c.getStatusBar().setText(prefix + "failed."); - JOptionPane.showMessageDialog( - _mainFrame, - "Communication exception: " + ex.toString(), - "Writing message to server '" + target + "' failed", - JOptionPane.ERROR_MESSAGE); - - return; - } - finally - { - _mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - } - - setVisible(false); - } - }; - okButton.addActionListener(okListener); - getRootPane().setDefaultButton(okButton); - - JButton cancelButton = new JButton("Cancel"); - ActionListener cancelListener = new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - setVisible(false); - } - }; - cancelButton.addActionListener(cancelListener); - - FormLayout layout = new FormLayout("left:pref, 3dlu, fill:pref:grow", ""); - DefaultFormBuilder builder = new DefaultFormBuilder(layout); - builder.setDefaultDialogBorder(); - builder.setRowGroupingEnabled(true); - builder.setLineGapSize(LayoutStyle.getCurrent().getLinePad()); - - _message.setLineWrap(true); - JScrollPane scrollPane = new JScrollPane(_message, - JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, - JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); - builder.append(scrollPane, 3); - builder.nextLine(); - builder.append(_stdOut); - builder.append(stdErr); - builder.nextLine(); - JComponent buttonBar = - ButtonBarFactory.buildOKCancelBar(okButton, cancelButton); - buttonBar.setBorder(Borders.DIALOG_BORDER); - - Container contentPane = getContentPane(); - contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS)); - contentPane.add(builder.getPanel()); - contentPane.add(buttonBar); - - pack(); - setResizable(false); + super(root.getCoordinator().getMainFrame(), + "Write Message - IceGrid Admin", true); + setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); + + _mainFrame = root.getCoordinator().getMainFrame(); + + _stdOut = new JRadioButton("Write to stdout"); + _stdOut.setSelected(true); + JRadioButton stdErr = new JRadioButton("Write to stderr"); + ButtonGroup bg = new ButtonGroup(); + bg.add(_stdOut); + bg.add(stdErr); + + JButton okButton = new JButton("OK"); + ActionListener okListener = new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + final Coordinator c = root.getCoordinator(); + final String target = _target; + final String prefix = "Writing message to server '" + target + "'..."; + + + AMI_Admin_writeMessage cb = new AMI_Admin_writeMessage() + { + public void ice_response() + { + SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + c.getStatusBar().setText(prefix + "done."); + } + }); + } + + public void ice_exception(final Ice.UserException e) + { + SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + handleFailure("IceGrid exception: " + e.toString()); + } + + }); + } + + public void ice_exception(final Ice.LocalException e) + { + SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + handleFailure("Communication exception: " + e.toString()); + } + }); + } + + private void handleFailure(String message) + { + c.getStatusBar().setText(prefix + "failed!"); + + JOptionPane.showMessageDialog( + _mainFrame, + message, + "Writing message to server '" + target + "' failed", + JOptionPane.ERROR_MESSAGE); + } + }; + + try + { + c.getStatusBar().setText(prefix); + _mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + + c.getAdmin().writeMessage_async( + cb, _target, _message.getText(), _stdOut.isSelected() ? 1 : 2); + } + catch(Ice.LocalException ex) + { + c.getStatusBar().setText(prefix + "failed."); + JOptionPane.showMessageDialog( + _mainFrame, + "Communication exception: " + ex.toString(), + "Writing message to server '" + target + "' failed", + JOptionPane.ERROR_MESSAGE); + + return; + } + finally + { + _mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } + + setVisible(false); + } + }; + okButton.addActionListener(okListener); + getRootPane().setDefaultButton(okButton); + + JButton cancelButton = new JButton("Cancel"); + ActionListener cancelListener = new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + setVisible(false); + } + }; + cancelButton.addActionListener(cancelListener); + + FormLayout layout = new FormLayout("left:pref, 3dlu, fill:pref:grow", ""); + DefaultFormBuilder builder = new DefaultFormBuilder(layout); + builder.setDefaultDialogBorder(); + builder.setRowGroupingEnabled(true); + builder.setLineGapSize(LayoutStyle.getCurrent().getLinePad()); + + _message.setLineWrap(true); + JScrollPane scrollPane = new JScrollPane(_message, + JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, + JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + builder.append(scrollPane, 3); + builder.nextLine(); + builder.append(_stdOut); + builder.append(stdErr); + builder.nextLine(); + JComponent buttonBar = + ButtonBarFactory.buildOKCancelBar(okButton, cancelButton); + buttonBar.setBorder(Borders.DIALOG_BORDER); + + Container contentPane = getContentPane(); + contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS)); + contentPane.add(builder.getPanel()); + contentPane.add(buttonBar); + + pack(); + setResizable(false); } void showDialog(String serverId) { - _target = serverId; - _message.setText(""); - setLocationRelativeTo(_mainFrame); - setVisible(true); + _target = serverId; + _message.setText(""); + setLocationRelativeTo(_mainFrame); + setVisible(true); } private JRadioButton _stdOut; |