Search in sources :

Example 6 with PropertiesUi

use of games.strategy.engine.data.properties.PropertiesUi in project triplea by triplea-game.

the class PropertiesSelector method showDialog.

private static Object showDialog(final JComponent parent, final String title, final List<IEditableProperty> properties, final Object... buttonOptions) {
    final PropertiesUi panel = new PropertiesUi(properties, true);
    final JScrollPane scroll = new JScrollPane(panel);
    scroll.setBorder(null);
    scroll.getViewport().setBorder(null);
    final JOptionPane pane = new JOptionPane(scroll, JOptionPane.PLAIN_MESSAGE);
    pane.setOptions(buttonOptions);
    final JDialog window = pane.createDialog(JOptionPane.getFrameForComponent(parent), title);
    window.setVisible(true);
    return pane.getValue();
}
Also used : JScrollPane(javax.swing.JScrollPane) PropertiesUi(games.strategy.engine.data.properties.PropertiesUi) JOptionPane(javax.swing.JOptionPane) JDialog(javax.swing.JDialog)

Aggregations

PropertiesUi (games.strategy.engine.data.properties.PropertiesUi)6 IEditableProperty (games.strategy.engine.data.properties.IEditableProperty)3 JDialog (javax.swing.JDialog)3 JOptionPane (javax.swing.JOptionPane)3 JScrollPane (javax.swing.JScrollPane)3 ColorProperty (games.strategy.engine.data.properties.ColorProperty)1 NumberProperty (games.strategy.engine.data.properties.NumberProperty)1 SwingAction (games.strategy.ui.SwingAction)1 BorderLayout (java.awt.BorderLayout)1 Color (java.awt.Color)1 Font (java.awt.Font)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 AbstractAction (javax.swing.AbstractAction)1 Action (javax.swing.Action)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1