summaryrefslogtreecommitdiff
path: root/sources/prefs/editors/VSProcessEditor.java
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-05-21 19:01:48 +0000
committerPaul Buetow <paul@buetow.org>2008-05-21 19:01:48 +0000
commitdb4ae1c41883f6f78d8107429f7f4871c45f47d5 (patch)
treed84d754176060afddc89b00d6cf7d4b97d3d049f /sources/prefs/editors/VSProcessEditor.java
parent004458bb854fe4376fe35ec55d7f08853e08895b (diff)
Ok inline editor seems to work.
Diffstat (limited to 'sources/prefs/editors/VSProcessEditor.java')
-rw-r--r--sources/prefs/editors/VSProcessEditor.java64
1 files changed, 8 insertions, 56 deletions
diff --git a/sources/prefs/editors/VSProcessEditor.java b/sources/prefs/editors/VSProcessEditor.java
index 1632ff1..c8c1339 100644
--- a/sources/prefs/editors/VSProcessEditor.java
+++ b/sources/prefs/editors/VSProcessEditor.java
@@ -18,60 +18,20 @@ import prefs.VSPrefs;
public class VSProcessEditor extends VSBetterEditor {
private VSProcess process;
- private String title;
-
+ public static boolean TAKEOVER_BUTTON;
public VSProcessEditor(VSPrefs prefs, VSProcess process) {
super(prefs, process, prefs.getString("name") + " - " + prefs.getString("lang.prefs.process"));;
this.process = process;
- init();
- }
-
- public VSProcessEditor(VSPrefs prefs, VSProcess process, int prefsCategory) {
- super(prefs, process, prefs.getString("name") + " - " + prefs.getString("lang.prefs.process"
- + (prefsCategory == ALL_PREFERENCES ? ".ext" : "")), prefsCategory);
-
- this.process = process;
- init();
- }
-
- private void init() {
- infoArea.setText(prefs.getString("lang.prefs.process.info!"));
- VSFrame frame = getFrame();
- if (frame != null)
- frame.disposeWithParent();
- createButtonPanel();
- }
-
- public String getTitle() {
- return title;
- }
-
- protected void addToEditPanelFront(JPanel editPanel) {
- super.addToEditPanelFront(editPanel);
-
- if (prefsCategory != SIMULATION_PREFERENCES)
- return;
-
- }
-
- protected void resetEditPanel() {
- super.resetEditPanel();
- }
-
- protected void savePrefs() {
- super.savePrefs();
+ disposeFrameWithParentIfExists();
+ getInfoArea().setText(prefs.getString("lang.prefs.process.info!"));
}
- private JPanel createButtonPanel() {
- JPanel buttonPanel = super.buttonPanel;
-
- JButton cancelButton = new JButton(
+ protected void addToButtonPanelFront(JPanel buttonPanel) {
+ JButton takeoverButton = new JButton(
prefs.getString("lang.takeover"));
- cancelButton.setMnemonic(prefs.getInteger("keyevent.takeover"));
- cancelButton.addActionListener(this);
- buttonPanel.add(cancelButton);
-
- return buttonPanel;
+ takeoverButton.setMnemonic(prefs.getInteger("keyevent.takeover"));
+ takeoverButton.addActionListener(this);
+ buttonPanel.add(takeoverButton);
}
public void actionPerformed(ActionEvent e) {
@@ -80,7 +40,6 @@ public class VSProcessEditor extends VSBetterEditor {
if (actionCommand.equals(prefs.getString("lang.ok"))) {
savePrefs();
process.updateFromVSPrefs();
- disposeFrameIfExists();
} else if (actionCommand.equals(prefs.getString("lang.takeover"))) {
savePrefs();
@@ -90,11 +49,4 @@ public class VSProcessEditor extends VSBetterEditor {
super.actionPerformed(e);
}
}
-
- public void newVSEditorInstance(VSPrefs prefs, VSPrefs prefsToEdit, int prefsCategory) {
- if (prefsToEdit instanceof VSProcess) {
- VSProcess process = (VSProcess) prefsToEdit;
- new VSEditorFrame(prefs, getFrame(), new VSProcessEditor(prefs, process, prefsCategory));
- }
- }
}