Revision: 1095
Author: peterdb
Date: 2006-04-26 13:21:46 -0700 (Wed, 26 Apr 2006)
ViewCVS: http://svn.sourceforge.net/spring-rich-c/?rev=1095&view=rev
Log Message:
-----------
fix for RCP-134: missing i18n in PreferencePage
Modified Paths:
--------------
trunk/spring-richclient/sandbox/src/main/java/org/springframework/richclient/preference/PreferencePage.java
Modified:
trunk/spring-richclient/sandbox/src/main/java/org/springframework/richclient/preference/PreferencePage.java
===================================================================
---
trunk/spring-richclient/sandbox/src/main/java/org/springframework/richclient/preference/PreferencePage.java
2006-04-26 07:44:34 UTC (rev 1094)
+++
trunk/spring-richclient/sandbox/src/main/java/org/springframework/richclient/preference/PreferencePage.java
2006-04-26 20:21:46 UTC (rev 1095)
@@ -15,58 +15,46 @@
*/
package org.springframework.richclient.preference;
-import java.awt.FlowLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.JButton;
import javax.swing.JComponent;
-import javax.swing.JPanel;
+import org.springframework.richclient.command.ActionCommand;
+import org.springframework.richclient.command.CommandGroup;
import org.springframework.richclient.dialog.AbstractDialogPage;
import org.springframework.richclient.layout.GridBagLayoutBuilder;
import org.springframework.richclient.settings.Settings;
+import org.springframework.richclient.util.GuiStandardUtils;
import org.springframework.util.Assert;
public abstract class PreferencePage extends AbstractDialogPage {
- private JButton applyButton;
-
private boolean createApplyAndDefaultButtons = true;
-
- private JButton defaultsButton;
-
private PreferencePage parent;
-
private PreferenceDialog preferenceDialog;
+ private ActionCommand restoreDefaultsCommand;
+ private ActionCommand applyCommand;
public PreferencePage(String id) {
super(id);
}
private JComponent createButtons() {
- JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
-
- defaultsButton = new JButton("Restore defaults");
- defaultsButton.addActionListener(new ActionListener() {
-
- public void actionPerformed(ActionEvent e) {
+ restoreDefaultsCommand = new
ActionCommand("restoreDefaultsCommand") {
+ public void doExecuteCommand() {
onDefaults();
}
- });
+ };
- applyButton = new JButton("Apply");
- applyButton.addActionListener(new ActionListener() {
-
- public void actionPerformed(ActionEvent e) {
+ applyCommand = new ActionCommand("applyCommand") {
+ public void doExecuteCommand() {
onApply();
}
- });
+ };
- panel.add(defaultsButton);
- panel.add(applyButton);
-
- return panel;
+ CommandGroup commandGroup =
CommandGroup.createCommandGroup(null,
+ new Object[] { restoreDefaultsCommand,
applyCommand });
+ JComponent buttonBar = commandGroup.createButtonBar();
+ GuiStandardUtils.attachDialogBorder(buttonBar);
+ return buttonBar;
}
protected abstract JComponent createContents();
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
spring-rich-c-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spring-rich-c-cvs