public static void showConfirmDialog(SComponent parent, Object message, String title, ActionListener al) { showConfirmDialog(parent, message, title, 0, al); }
public static void showInputDialog(SComponent parent, Object question, String title, SComponent inputElement, ActionListener al) { showInputDialog(parent, question, title, SOptionPane.QUESTION_MESSAGE, inputElement, al); }
/** * {@inheritDoc} */ public void popupInfo(SComponent sourceComponent, String title, @SuppressWarnings("unused") String iconImageUrl, String message) { SOptionPane.showMessageDialog(sourceComponent, message, title, SOptionPane.INFORMATION_MESSAGE); }
public static void showQuestionDialog(SComponent parent, Object question, String title, ActionListener al) { SOptionPane p = new SOptionPane(); p.showQuestion(parent, question, title); p.setMessageType(SOptionPane.QUESTION_MESSAGE); p.addActionListener(al); }
public static void showMessageDialog(SComponent parent, Object message, String title, int messageType, ActionListener al) { SOptionPane p = new SOptionPane(); p.showOption(parent, title, message); p.setMessageType(messageType); p.addActionListener(al); }
public static void showInputDialog(SComponent parent, Object question, String title, int messageType, SComponent inputElement, ActionListener al) { SOptionPane p = new SOptionPane(); p.showInput(parent, question, inputElement, title); p.setMessageType(messageType); p.addActionListener(al); }
public static void showYesNoDialog(SComponent parent, Object question, String title, ActionListener al) { SOptionPane p = new SOptionPane(); p.addActionListener(al); p.showYesNo(parent, question, title); }
public static void showConfirmDialog(SComponent parent, Object message, String title, int type, ActionListener al, SLayoutManager layout) { SOptionPane p = new SOptionPane(); if (layout != null) { p.optionButtons.setLayout(layout); } // end of if () p.showQuestion(parent, message, title, type); p.addActionListener(al); }
/** * {@inheritDoc} */ public void popupYesNo(SComponent sourceComponent, String title, @SuppressWarnings("unused") String iconImageUrl, String message, final IAction yesAction, final IAction noAction, final Map<String, Object> context) { SOptionPane.showYesNoDialog(sourceComponent, message, title, new ActionListener() { public void actionPerformed(ActionEvent e) { IAction nextAction = null; if (SOptionPane.YES_ACTION.equals(e.getActionCommand())) { nextAction = yesAction; } else if (SOptionPane.NO_ACTION.equals(e.getActionCommand())) { nextAction = noAction; } if (nextAction != null) { execute(nextAction, context); } } }); }
@Override public void actionPerformed(ActionEvent e) { log.debug("action " + e); hide(); selected = e.getSource(); if (e.getSource() == optionOK) { fireActionPerformed(OK_ACTION); } else if (e.getSource() == optionYes) { fireActionPerformed(YES_ACTION); } else if (e.getSource() == optionNo) { fireActionPerformed(NO_ACTION); } else if (e.getSource() == optionCancel) { fireActionPerformed(CANCEL_ACTION); } else { fireActionPerformed(UNKNOWN_ACTION); } }
public void setOptions(Object... options) { resetOptions(); Object[] oldVal = this.options; if (customButtons == null) customButtons = new SPanel(); for (Object option : options) { if (option instanceof SComponent) { if (option instanceof SAbstractButton) ((SAbstractButton) option).addActionListener(this); customButtons.add((SComponent) option); } else { SButton b = new SButton(option.toString()); b.addActionListener(this); customButtons.add(b); } } add(customButtons); propertyChangeSupport.firePropertyChange("options", oldVal, this.options); }
optionButtons.setStyle("SOptionPaneButtons"); setLayout(new SGridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.insets = new Insets(10, 10, 10, 10); gbc.fill = GridBagConstraints.BOTH; gbc.anchor = GridBagConstraints.NORTHWEST; add(contents, gbc); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.anchor = GridBagConstraints.SOUTHEAST; add(optionButtons, gbc);
/** * Generic Button creation */ protected final SButton createButton(String key) { String label = CGManager.getString("org.wings.SOptionPane." + key + "ButtonText"); SButton b = new SButton(label); b.setName(getName() + key); b.addActionListener(this); return b; }
public static void showPlainQuestionDialog(SComponent parent, Object question, String title, ActionListener al) { SOptionPane p = new SOptionPane(); p.showQuestion(parent, question, title); p.setMessageType(SOptionPane.PLAIN_MESSAGE); p.addActionListener(al); }
public static void showPlainMessageDialog(SComponent parent, Object message, String title, ActionListener al) { SOptionPane p = new SOptionPane(); p.showOption(parent, title, message); p.setMessageType(SOptionPane.PLAIN_MESSAGE); p.addActionListener(al); }
/** * Displays the message using a <code>SOptionPane.YES_NO_OPTION</code>. * <p> * {@inheritDoc} */ @Override public boolean execute(final IActionHandler actionHandler, final Map<String, Object> context) { SOptionPane.showYesNoDialog(getSourceComponent(context), getMessage(context), getI18nName(getTranslationProvider(context), getLocale(context)), new ActionListener() { public void actionPerformed(ActionEvent e) { if (SOptionPane.YES_ACTION.equals(e.getActionCommand())) { context.put(ActionContextConstants.NEXT_ACTION, yesAction); } else if (SOptionPane.NO_ACTION.equals(e.getActionCommand())) { context.put(ActionContextConstants.NEXT_ACTION, noAction); } executeNextAction(actionHandler, context); } }); return true; }
public static void showMessageDialog(SComponent parent, Object message, String title, int messageType) { showMessageDialog(parent, message, title, messageType, null); }
public static void showConfirmDialog(SComponent parent, Object message, String title) { showConfirmDialog(parent, message, title, 0, null); }
/** * {@inheritDoc} */ @Override public boolean execute(final IActionHandler actionHandler, final Map<String, Object> context) { SFileChooser fileChooser = new SFileChooser(); SOptionPane .showInputDialog(getSourceComponent(context), getTranslationProvider( context) .getTranslation("open.file.description", getLocale(context)), getTranslationProvider(context).getTranslation("open.file.name", getLocale(context)), fileChooser, new OpenFileActionListener( fileChooser, getController(context), context)); return super.execute(actionHandler, context); }
public static void showMessageDialog(SComponent parent, Object message) { showMessageDialog(parent, message, null, SOptionPane.INFORMATION_MESSAGE, null); }