Search in sources :

Example 1 with IButton

use of org.jowidgets.api.widgets.IButton in project jo-client-platform by jo-source.

the class GraphSettingsDialog method createDefaultSetterButton.

private void createDefaultSetterButton(final IScrollComposite content) {
    final IButton btn = content.add(BPF.button("Reset", "Set settings to default"), "growx, w 0::75,  alignx left");
    btn.addActionListener(new IActionListener() {

        @Override
        public void actionPerformed() {
            final Set<ISlider> sliders = DEFAULT_SLIDER_SETTINGS.keySet();
            for (final ISlider slider : sliders) {
                slider.setValue(DEFAULT_SLIDER_SETTINGS.get(slider));
            }
        }
    });
    final IButton btnCancel = content.add(BPF.buttonCancel(), " w 0:75:, span 2, alignx right");
    btnCancel.addActionListener(new IActionListener() {

        @Override
        public void actionPerformed() {
            closeDialog();
        }
    });
}
Also used : IActionListener(org.jowidgets.common.widgets.controller.IActionListener) Set(java.util.Set) IButton(org.jowidgets.api.widgets.IButton) ISlider(org.jowidgets.api.widgets.ISlider)

Example 2 with IButton

use of org.jowidgets.api.widgets.IButton in project jo-client-platform by jo-source.

the class BeanTableSettingsDialogImpl method createButtonBar.

private void createButtonBar(final IComposite buttonBar) {
    buttonBar.setLayout(new MigLayoutDescriptor("0[][]0", "0[]0"));
    final IButton ok = buttonBar.add(bpF.button(Messages.getString("BeanTableSettingsDialogImpl.ok")), "w 80::, aligny b, sg bg");
    ok.addActionListener(new IActionListener() {

        @Override
        public void actionPerformed() {
            okPressed = true;
            setVisible(false);
        }
    });
    frame.setDefaultButton(ok);
    final IButton cancel = buttonBar.add(bpF.button(Messages.getString("BeanTableSettingsDialogImpl.cancel")), "w 80::, aligny b, sg bg");
    cancel.addActionListener(new IActionListener() {

        @Override
        public void actionPerformed() {
            setVisible(false);
        }
    });
}
Also used : IActionListener(org.jowidgets.common.widgets.controller.IActionListener) IButton(org.jowidgets.api.widgets.IButton) MigLayoutDescriptor(org.jowidgets.common.widgets.layout.MigLayoutDescriptor)

Aggregations

IButton (org.jowidgets.api.widgets.IButton)2 IActionListener (org.jowidgets.common.widgets.controller.IActionListener)2 Set (java.util.Set)1 ISlider (org.jowidgets.api.widgets.ISlider)1 MigLayoutDescriptor (org.jowidgets.common.widgets.layout.MigLayoutDescriptor)1