diff --git a/CHANGELOG.md b/CHANGELOG.md index 450017f..eb27673 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.2.1] - 2020-07-10 + +### Changed + +* Fix bug in the *Save* function that prevented certain recipes from being saved +* Fix SoapMultiSignature operation (was not displayed in operations tree) +* Remove notifyChange listeners from *Button* objects +* Remove empty tooltipps from operation categories + + ## [1.2.0] - 2020-06-28 ### Added diff --git a/pom.xml b/pom.xml index 1eba8d1..654af5b 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 de.usd.CSTC CSTC - 1.2.0 + 1.2.1 CSTC CSTC diff --git a/src/de/usd/cstchef/Utils.java b/src/de/usd/cstchef/Utils.java index 065cbd5..506585f 100644 --- a/src/de/usd/cstchef/Utils.java +++ b/src/de/usd/cstchef/Utils.java @@ -95,6 +95,7 @@ import de.usd.cstchef.operations.setter.JsonSetter; import de.usd.cstchef.operations.setter.LineSetter; import de.usd.cstchef.operations.signature.RsaSignature; +import de.usd.cstchef.operations.signature.SoapMultiSignature; import de.usd.cstchef.operations.signature.XmlFullSignature; import de.usd.cstchef.operations.signature.XmlMultiSignature; import de.usd.cstchef.operations.string.Length; @@ -237,7 +238,7 @@ public static Class[] getOperationsDev() { Suffix.class, Sum.class, StringContains.class, StringMatch.class, Tiger.class, ToBase64.class, ToHex.class, UnixTimestamp.class, UrlDecode.class, UrlEncode.class, Whirlpool.class, WriteFile.class, XmlFullSignature.class, XmlMultiSignature.class, - Xor.class + Xor.class, SoapMultiSignature.class }; } diff --git a/src/de/usd/cstchef/operations/Operation.java b/src/de/usd/cstchef/operations/Operation.java index 861bf56..31d43d6 100644 --- a/src/de/usd/cstchef/operations/Operation.java +++ b/src/de/usd/cstchef/operations/Operation.java @@ -1,5 +1,22 @@ package de.usd.cstchef.operations; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.EOFException; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.HashMap; +import java.util.Map; + import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; @@ -7,8 +24,10 @@ import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; +import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JPanel; +import javax.swing.JPasswordField; import javax.swing.JSpinner; import javax.swing.JTextArea; import javax.swing.JTextField; @@ -25,23 +44,6 @@ import de.usd.cstchef.view.ui.VariableTextArea; import de.usd.cstchef.view.ui.VariableTextField; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.EOFException; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import java.util.HashMap; -import java.util.Map; - public abstract class Operation extends JPanel { private static Color defaultBgColor = new Color(223, 240, 216); @@ -176,7 +178,10 @@ public void actionPerformed(ActionEvent e) { public Map getState() { Map properties = new HashMap<>(); for (String key : this.uiElements.keySet()) { - properties.put(key, getUiValues(this.uiElements.get(key))); + if( key.startsWith("noupdate") ) + properties.put(key, null); + else + properties.put(key, getUiValues(this.uiElements.get(key))); } return properties; @@ -184,7 +189,9 @@ public Map getState() { private Object getUiValues(Component comp) { Object result = null; - if (comp instanceof VariableTextArea) { + if (comp instanceof JPasswordField) { + result = ""; + } else if (comp instanceof VariableTextArea) { result = ((VariableTextArea) comp).getRawText(); } else if (comp instanceof VariableTextField) { result = ((VariableTextField) comp).getRawText(); @@ -200,6 +207,8 @@ private Object getUiValues(Component comp) { result = ((JCheckBox) comp).isSelected(); } else if (comp instanceof FormatTextField) { result = ((FormatTextField) comp).getValues(); + } else if (comp instanceof JFileChooser) { + result = ((JFileChooser) comp).getName(); } return result; @@ -213,7 +222,7 @@ public void load(Map parameters) { } private void setUiValue(Component comp, Object value) { - if (comp == null) { + if (comp == null || value == null) { return; } @@ -229,6 +238,8 @@ private void setUiValue(Component comp, Object value) { ((JCheckBox) comp).setSelected((boolean) value); } else if (comp instanceof FormatTextField) { ((FormatTextField) comp).setValues((Map) value); + } else if (comp instanceof JFileChooser) { + ((JFileChooser) comp).setName((String)value); } } @@ -275,10 +286,18 @@ private void changeFontColor(Container container, Color color) { } protected void addUIElement(String caption, Component comp) { - this.addUIElement(caption, comp, true); + this.addUIElement(caption, comp, true, null); } protected void addUIElement(String caption, Component comp, boolean notifyChange) { + this.addUIElement(caption, comp, notifyChange, null); + } + + protected void addUIElement(String caption, Component comp, String identifier) { + this.addUIElement(caption, comp, true, identifier); + } + + protected void addUIElement(String caption, Component comp, boolean notifyChange, String identifier) { comp.setCursor(Cursor.getDefaultCursor()); Box box = Box.createHorizontalBox(); @@ -292,7 +311,9 @@ protected void addUIElement(String caption, Component comp, boolean notifyChange box.add(comp); this.contentBox.add(box); this.contentBox.add(Box.createVerticalStrut(10)); - this.uiElements.put(caption, comp); + if( identifier == null ) + identifier = caption; + this.uiElements.put(identifier, comp); if (notifyChange) { if (notifyChangeListener == null) { diff --git a/src/de/usd/cstchef/operations/dataformat/HtmlEncode.java b/src/de/usd/cstchef/operations/dataformat/HtmlEncode.java index 716030e..051a9a2 100644 --- a/src/de/usd/cstchef/operations/dataformat/HtmlEncode.java +++ b/src/de/usd/cstchef/operations/dataformat/HtmlEncode.java @@ -49,6 +49,6 @@ protected byte[] perform(byte[] input) throws Exception { public void createUI() { this.checkbox = new JCheckBox("Encode all"); this.checkbox.setSelected(false); - this.addUIElement(null, this.checkbox); + this.addUIElement(null, this.checkbox, "checkbox1"); } } diff --git a/src/de/usd/cstchef/operations/dataformat/UrlEncode.java b/src/de/usd/cstchef/operations/dataformat/UrlEncode.java index 799f5dd..813f670 100644 --- a/src/de/usd/cstchef/operations/dataformat/UrlEncode.java +++ b/src/de/usd/cstchef/operations/dataformat/UrlEncode.java @@ -49,6 +49,6 @@ protected byte[] perform(byte[] input) throws Exception { public void createUI() { this.checkbox = new JCheckBox("Encode all"); this.checkbox.setSelected(false); - this.addUIElement(null, this.checkbox); + this.addUIElement(null, this.checkbox, "checkbox1"); } } diff --git a/src/de/usd/cstchef/operations/extractors/HttpUriExtractor.java b/src/de/usd/cstchef/operations/extractors/HttpUriExtractor.java index bea009d..e07a6f0 100644 --- a/src/de/usd/cstchef/operations/extractors/HttpUriExtractor.java +++ b/src/de/usd/cstchef/operations/extractors/HttpUriExtractor.java @@ -20,7 +20,7 @@ public class HttpUriExtractor extends Operation { public void createUI() { this.checkbox = new JCheckBox("With parameters"); this.checkbox.setSelected(true); - this.addUIElement(null, this.checkbox); + this.addUIElement(null, this.checkbox, "checkbox1"); } @Override diff --git a/src/de/usd/cstchef/operations/misc/ReadFile.java b/src/de/usd/cstchef/operations/misc/ReadFile.java index 3e32828..302b9c6 100644 --- a/src/de/usd/cstchef/operations/misc/ReadFile.java +++ b/src/de/usd/cstchef/operations/misc/ReadFile.java @@ -37,7 +37,7 @@ public void createUI() { JButton chooseFileButton = new JButton("Select file"); chooseFileButton.addActionListener(this); - this.addUIElement(null, chooseFileButton); + this.addUIElement(null, chooseFileButton, false, "button1"); } @Override diff --git a/src/de/usd/cstchef/operations/misc/WriteFile.java b/src/de/usd/cstchef/operations/misc/WriteFile.java index 9f5a550..8ca2990 100644 --- a/src/de/usd/cstchef/operations/misc/WriteFile.java +++ b/src/de/usd/cstchef/operations/misc/WriteFile.java @@ -52,7 +52,7 @@ public void createUI() { JButton chooseFileButton = new JButton("Select file"); chooseFileButton.addActionListener(this); - this.addUIElement(null, chooseFileButton); + this.addUIElement(null, chooseFileButton, false, "button1"); } diff --git a/src/de/usd/cstchef/operations/setter/HttpGetSetter.java b/src/de/usd/cstchef/operations/setter/HttpGetSetter.java index a20ebed..14cfb9b 100644 --- a/src/de/usd/cstchef/operations/setter/HttpGetSetter.java +++ b/src/de/usd/cstchef/operations/setter/HttpGetSetter.java @@ -53,14 +53,14 @@ public void createUI() { this.urlEncode = new JCheckBox("URL encode"); this.urlEncode.setSelected(false); - this.addUIElement(null, this.urlEncode); + this.addUIElement(null, this.urlEncode, "checkbox1"); this.urlEncodeAll = new JCheckBox("URL encode all"); this.urlEncodeAll.setSelected(false); - this.addUIElement(null, this.urlEncodeAll); + this.addUIElement(null, this.urlEncodeAll, "checkbox2"); this.addIfNotPresent = new JCheckBox("Add if not present"); this.addIfNotPresent.setSelected(true); - this.addUIElement(null, this.addIfNotPresent); + this.addUIElement(null, this.addIfNotPresent, "checkbox3"); } } diff --git a/src/de/usd/cstchef/operations/setter/HttpHeaderSetter.java b/src/de/usd/cstchef/operations/setter/HttpHeaderSetter.java index 01450f2..3653471 100644 --- a/src/de/usd/cstchef/operations/setter/HttpHeaderSetter.java +++ b/src/de/usd/cstchef/operations/setter/HttpHeaderSetter.java @@ -60,7 +60,7 @@ public void createUI() { super.createUI(); this.addIfNotPresent = new JCheckBox("Add if not present"); this.addIfNotPresent.setSelected(true); - this.addUIElement(null, this.addIfNotPresent); + this.addUIElement(null, this.addIfNotPresent, "checkbox1"); } } diff --git a/src/de/usd/cstchef/operations/setter/HttpPostSetter.java b/src/de/usd/cstchef/operations/setter/HttpPostSetter.java index 0a87d74..c2b38af 100644 --- a/src/de/usd/cstchef/operations/setter/HttpPostSetter.java +++ b/src/de/usd/cstchef/operations/setter/HttpPostSetter.java @@ -57,15 +57,15 @@ public void createUI() { this.urlEncode = new JCheckBox("URL encode"); this.urlEncode.setSelected(false); - this.addUIElement(null, this.urlEncode); + this.addUIElement(null, this.urlEncode, "checkbox1"); this.urlEncodeAll = new JCheckBox("URL encode all"); this.urlEncodeAll.setSelected(false); - this.addUIElement(null, this.urlEncodeAll); + this.addUIElement(null, this.urlEncodeAll, "checkbox2"); this.addIfNotPresent = new JCheckBox("Add if not present"); this.addIfNotPresent.setSelected(true); - this.addUIElement(null, this.addIfNotPresent); + this.addUIElement(null, this.addIfNotPresent, "checkbox3"); } } diff --git a/src/de/usd/cstchef/operations/setter/HttpSetCookie.java b/src/de/usd/cstchef/operations/setter/HttpSetCookie.java index 76dce5b..d11d80d 100644 --- a/src/de/usd/cstchef/operations/setter/HttpSetCookie.java +++ b/src/de/usd/cstchef/operations/setter/HttpSetCookie.java @@ -86,7 +86,7 @@ public void createUI() { super.createUI(); this.addIfNotPresent = new JCheckBox("Add if not present"); this.addIfNotPresent.setSelected(true); - this.addUIElement(null, this.addIfNotPresent); + this.addUIElement(null, this.addIfNotPresent, "checkbox1"); } } diff --git a/src/de/usd/cstchef/operations/setter/HttpSetUri.java b/src/de/usd/cstchef/operations/setter/HttpSetUri.java index 718958a..ad55dc1 100644 --- a/src/de/usd/cstchef/operations/setter/HttpSetUri.java +++ b/src/de/usd/cstchef/operations/setter/HttpSetUri.java @@ -25,7 +25,7 @@ public void createUI() { this.checkbox = new JCheckBox("Keep parameters"); this.checkbox.setSelected(false); - this.addUIElement(null, this.checkbox); + this.addUIElement(null, this.checkbox, "checkbox1"); } diff --git a/src/de/usd/cstchef/operations/setter/JsonSetter.java b/src/de/usd/cstchef/operations/setter/JsonSetter.java index 4afe94f..99447f1 100644 --- a/src/de/usd/cstchef/operations/setter/JsonSetter.java +++ b/src/de/usd/cstchef/operations/setter/JsonSetter.java @@ -54,7 +54,7 @@ public void createUI() { this.addIfNotPresent = new JCheckBox("Add if not present"); this.addIfNotPresent.setSelected(true); this.addIfNotPresent.addActionListener(this); - this.addUIElement(null, this.addIfNotPresent); + this.addUIElement(null, this.addIfNotPresent, "checkbox1"); this.path = new VariableTextField(); this.path.setText("Insert-Path"); @@ -62,7 +62,7 @@ public void createUI() { this.path.addFocusListener(new FocusListener() { @Override public void focusGained(FocusEvent e) { - if (path.getText().equals("Insert-Path")) { + if (path.getText().equals("Insertion Path")) { path.setText(""); path.setForeground(null); } @@ -71,13 +71,13 @@ public void focusGained(FocusEvent e) { public void focusLost(FocusEvent e) { if (path.getText().isEmpty()) { path.setForeground(Color.GRAY); - path.setText("Insert-Path"); + path.setText("Insertion Path"); } } }); - this.addUIElement(null, this.path); + this.addUIElement(null, this.path, "textbox1"); } - + @Override public void actionPerformed(ActionEvent arg0) { if( arg0.getSource() == this.addIfNotPresent ) { diff --git a/src/de/usd/cstchef/operations/setter/LineSetter.java b/src/de/usd/cstchef/operations/setter/LineSetter.java index 1d4a3a1..ebff621 100644 --- a/src/de/usd/cstchef/operations/setter/LineSetter.java +++ b/src/de/usd/cstchef/operations/setter/LineSetter.java @@ -82,7 +82,8 @@ public void createUI() { super.createUI(); this.append = new JCheckBox("Insert below"); this.append.setSelected(false); - this.addUIElement(null, this.append); + this.addUIElement(null, this.append, "checkbox1"); + this.formatBox = new JComboBox<>(new String[] {"\\r\\n", "\\r", "\\n"}); this.formatBox.setSelectedItem("\\r\\n"); this.addUIElement("Lineseperator", this.formatBox); diff --git a/src/de/usd/cstchef/operations/signature/KeystoreOperation.java b/src/de/usd/cstchef/operations/signature/KeystoreOperation.java index 8c6ae01..fc4911e 100644 --- a/src/de/usd/cstchef/operations/signature/KeystoreOperation.java +++ b/src/de/usd/cstchef/operations/signature/KeystoreOperation.java @@ -16,19 +16,20 @@ import javax.swing.JPasswordField; import de.usd.cstchef.operations.Operation; +import de.usd.cstchef.view.ui.VariableTextField; public abstract class KeystoreOperation extends Operation implements ActionListener { protected String[] keyEntries = new String[] {}; protected String[] keyStoreTypes = new String[] {"JKS", "PKCS12"}; + protected VariableTextField fileNameTxt; + protected JPasswordField keyStorePass; + protected Certificate cert = null; protected KeyStore keyStore = null; protected PrivateKeyEntry selectedEntry = null; - protected File keyStoreFile = null; - protected JPasswordField keyStorePass; - protected JCheckBox keyStoreOpen; protected JCheckBox certAvailable; protected JCheckBox keyAvailable; @@ -45,7 +46,8 @@ public KeystoreOperation() { private void openKeyStore() { try { - + String path = fileNameTxt.getText(); + File keyStoreFile = new File(path); String storeType = (String)keyStoreType.getSelectedItem(); char[] password = keyStorePass.getPassword(); KeyStore ks = KeyStore.getInstance(storeType); @@ -115,16 +117,19 @@ public void createMyUI() { this.keyStoreType.addActionListener(this); this.addUIElement("KeyStoreType", this.keyStoreType); + this.fileNameTxt = new VariableTextField(); + this.addUIElement("Filename", this.fileNameTxt); + chooseFileButton = new JButton("Select file"); chooseFileButton.addActionListener(this); - this.addUIElement(null, this.chooseFileButton); + this.addUIElement(null, this.chooseFileButton, false, "button1"); this.keyStorePass = new JPasswordField(); this.addUIElement("PrivKeyPassword", this.keyStorePass); openKeyStoreButton = new JButton("Open keystore"); openKeyStoreButton.addActionListener(this); - this.addUIElement(null, this.openKeyStoreButton); + this.addUIElement(null, this.openKeyStoreButton, false, "button2"); this.keyEntry = new JComboBox<>(keyEntries); this.keyEntry.addActionListener(this); @@ -134,19 +139,19 @@ public void createMyUI() { this.keyStoreOpen.setSelected(false); this.keyStoreOpen.setEnabled(false); this.keyStoreOpen.addActionListener(this); - this.addUIElement(null, this.keyStoreOpen); + this.addUIElement(null, this.keyStoreOpen, "noupdate-checkbox1"); this.certAvailable = new JCheckBox("Certificate available"); this.certAvailable.setSelected(false); this.certAvailable.setEnabled(false); this.certAvailable.addActionListener(this); - this.addUIElement(null, this.certAvailable); + this.addUIElement(null, this.certAvailable, "noupdate-checkbox2"); this.keyAvailable = new JCheckBox("PrivKey available"); this.keyAvailable.setSelected(false); this.keyAvailable.setEnabled(false); this.keyAvailable.addActionListener(this); - this.addUIElement(null, this.keyAvailable); + this.addUIElement(null, this.keyAvailable, "noupdate-checkbox3"); } @@ -167,7 +172,8 @@ public void actionPerformed(ActionEvent arg0) { this.resetKeyStore(); int returnVal = fileChooser.showOpenDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { - keyStoreFile = fileChooser.getSelectedFile(); + File tmp = fileChooser.getSelectedFile(); + this.fileNameTxt.setText(tmp.getAbsolutePath()); } } else if( arg0.getSource() == keyEntry ) { diff --git a/src/de/usd/cstchef/operations/signature/SoapMultiSignature.java b/src/de/usd/cstchef/operations/signature/SoapMultiSignature.java index cafca0e..5fd344d 100644 --- a/src/de/usd/cstchef/operations/signature/SoapMultiSignature.java +++ b/src/de/usd/cstchef/operations/signature/SoapMultiSignature.java @@ -47,7 +47,7 @@ import de.usd.cstchef.operations.OperationCategory; import de.usd.cstchef.view.ui.FormatTextField; -@OperationInfos(name = "Soap Multi Signature", category = OperationCategory.ENCRYPTION, description = "Create a Soap signature.") +@OperationInfos(name = "Soap Multi Signature", category = OperationCategory.SIGNATURE, description = "Create a Soap signature.") public class SoapMultiSignature extends KeystoreOperation { public SoapMultiSignature() { @@ -180,22 +180,22 @@ public void createMyUI() { this.certificate = new JCheckBox("Include Certificate"); this.certificate.setSelected(false); this.certificate.addActionListener(this); - this.addUIElement(null, this.certificate); + this.addUIElement(null, this.certificate, "checkbox1"); this.subject = new JCheckBox("Include Subject"); this.subject.setSelected(false); this.subject.addActionListener(this); - this.addUIElement(null, this.subject); + this.addUIElement(null, this.subject, "checkbox2"); this.issuer = new JCheckBox("Include Issuer"); this.issuer.setSelected(false); this.issuer.addActionListener(this); - this.addUIElement(null, this.issuer); + this.addUIElement(null, this.issuer, "checkbox3"); this.serialIssuer = new JCheckBox("Include Issuer"); this.serialIssuer.setSelected(false); this.serialIssuer.addActionListener(this); - this.addUIElement(null, this.serialIssuer); + this.addUIElement(null, this.serialIssuer, "checkbox4"); this.digestMethod = new JComboBox(this.availDigestMethods); this.digestMethod.addActionListener(this); @@ -210,7 +210,7 @@ public void createMyUI() { addReferenceButton = new JButton("Add Reference"); addReferenceButton.addActionListener(this); - this.addUIElement(null, addReferenceButton); + this.addUIElement(null, addReferenceButton, false, "button1"); } public void actionPerformed(ActionEvent arg0) { diff --git a/src/de/usd/cstchef/operations/signature/XmlSignature.java b/src/de/usd/cstchef/operations/signature/XmlSignature.java index e9ba6cd..f8fcb62 100644 --- a/src/de/usd/cstchef/operations/signature/XmlSignature.java +++ b/src/de/usd/cstchef/operations/signature/XmlSignature.java @@ -158,7 +158,7 @@ protected void addIdSelectors() { addReferenceButton = new JButton("Add Reference"); addReferenceButton.addActionListener(this); - this.addUIElement(null, addReferenceButton); + this.addUIElement(null, addReferenceButton, false, "button1"); } @@ -172,22 +172,22 @@ public void createMyUI() { this.certificate = new JCheckBox("Include Certificate"); this.certificate.setSelected(false); this.certificate.addActionListener(this); - this.addUIElement(null, this.certificate); + this.addUIElement(null, this.certificate, "checkbox1"); this.subject = new JCheckBox("Include Subject"); this.subject.setSelected(false); this.subject.addActionListener(this); - this.addUIElement(null, this.subject); + this.addUIElement(null, this.subject, "checkbox2"); this.issuer = new JCheckBox("Include Issuer"); this.issuer.setSelected(false); this.issuer.addActionListener(this); - this.addUIElement(null, this.issuer); + this.addUIElement(null, this.issuer, "checkbox3"); this.serialIssuer = new JCheckBox("Include Issuer"); this.serialIssuer.setSelected(false); this.serialIssuer.addActionListener(this); - this.addUIElement(null, this.serialIssuer); + this.addUIElement(null, this.serialIssuer, "checkbox4"); this.digestMethod = new JComboBox(this.availDigestMethods); this.digestMethod.addActionListener(this); diff --git a/src/de/usd/cstchef/operations/string/Replace.java b/src/de/usd/cstchef/operations/string/Replace.java index c891707..1dc86b6 100644 --- a/src/de/usd/cstchef/operations/string/Replace.java +++ b/src/de/usd/cstchef/operations/string/Replace.java @@ -55,7 +55,7 @@ public void createUI() { this.checkbox = new JCheckBox("Regex"); this.checkbox.setSelected(false); - this.addUIElement(null, this.checkbox); + this.addUIElement(null, this.checkbox, "checkbox1"); this.replacementTxt = new VariableTextArea(); this.addUIElement("Value", this.replacementTxt); diff --git a/src/de/usd/cstchef/operations/utils/SetIfEmpty.java b/src/de/usd/cstchef/operations/utils/SetIfEmpty.java index 0ba3a8e..d1e0581 100644 --- a/src/de/usd/cstchef/operations/utils/SetIfEmpty.java +++ b/src/de/usd/cstchef/operations/utils/SetIfEmpty.java @@ -41,6 +41,6 @@ public void createUI() { this.checkbox = new JCheckBox("Space is empty"); this.checkbox.setSelected(false); - this.addUIElement(null, this.checkbox); + this.addUIElement(null, this.checkbox, "checkbox1"); } } diff --git a/src/de/usd/cstchef/view/OperationsTree.java b/src/de/usd/cstchef/view/OperationsTree.java index 2bc26fc..05ef9e6 100644 --- a/src/de/usd/cstchef/view/OperationsTree.java +++ b/src/de/usd/cstchef/view/OperationsTree.java @@ -48,9 +48,13 @@ public String getToolTipText(MouseEvent evt) { TreePath curPath = getPathForLocation(evt.getX(), evt.getY()); Object node = curPath.getLastPathComponent(); + if (node.getClass().equals(OperationTreeNode.class)) { return ((OperationTreeNode) node).getToolTipText(); + } else if (node.getClass().equals(DefaultMutableTreeNode.class)) { + return null; } + return ""; }