From db4ae1c41883f6f78d8107429f7f4871c45f47d5 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 21 May 2008 19:01:48 +0000 Subject: Ok inline editor seems to work. --- sources/prefs/editors/VSProcessEditor.java | 64 ++++-------------------------- 1 file changed, 8 insertions(+), 56 deletions(-) (limited to 'sources/prefs/editors/VSProcessEditor.java') 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)); - } - } } -- cgit v1.2.3