setting for updateing the test bounds

This commit is contained in:
2014-12-21 13:23:34 +01:00
parent fdfb143f89
commit edc43f0d18
14 changed files with 198 additions and 24 deletions
@@ -33,6 +33,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
@@ -40,6 +41,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
@@ -192,7 +194,6 @@ public class AdvancedSettingsDialog extends AppDialog implements ActionListener
val = "";
}
if (itemType == Calendar.class) {
tf.setText(new SimpleDateFormat().format(((Calendar) item.get()).getTime()));
} else {
tf.setText(val.toString());
@@ -200,12 +201,32 @@ public class AdvancedSettingsDialog extends AppDialog implements ActionListener
tf.setToolTipText(description);
tf.setMaximumSize(new Dimension(Integer.MAX_VALUE, tf.getPreferredSize().height));
c = tf;
}
if (itemType == Boolean.class) {
} else if (itemType == Boolean.class) {
JCheckBox cb = new JCheckBox();
cb.setSelected((Boolean) item.get());
cb.setToolTipText(description);
c = cb;
} else if (itemType.isEnum()) {
JComboBox<String> cb = new JComboBox<>();
@SuppressWarnings("unchecked")
EnumSet enumValues = EnumSet.allOf(itemType);
String stringValue = null;
for (Object enumValue : enumValues) {
String enumValueStr = enumValue.toString();
if (stringValue == null) {
stringValue = enumValueStr;
}
cb.addItem(enumValueStr);
}
if (item.get() != null) {
stringValue = item.get().toString();
}
cb.setToolTipText(description);
cb.setSelectedItem(stringValue);
cb.setMaximumSize(new Dimension(Integer.MAX_VALUE, cb.getPreferredSize().height));
c = cb;
} else {
throw new UnsupportedOperationException("Configuration ttem type '" + itemType.getName() + "' is not supported");
}
componentsMap.put(name, c);
l.setLabelFor(c);
@@ -223,7 +244,7 @@ public class AdvancedSettingsDialog extends AppDialog implements ActionListener
tabs.put(cat, new JScrollPane(configPanel));
}
String catOrder[] = new String[]{"ui", "display", "decompilation", "script", "format", "export", "limit", "update", "debug", "other"};
String catOrder[] = new String[]{"ui", "display", "decompilation", "script", "format", "export", "import", "limit", "update", "debug", "other"};
for (String cat : catOrder) {
if (!tabs.containsKey(cat)) {
@@ -291,6 +312,11 @@ public class AdvancedSettingsDialog extends AppDialog implements ActionListener
}
value = cal;
}
if (itemType.isEnum()) {
String stringValue = (String) ((JComboBox<String>) c).getSelectedItem();
value = Enum.valueOf(itemType, stringValue);
}
try {
if (itemType == Integer.class) {
@@ -60,7 +60,7 @@ public class ErrorLogFrame extends AppFrame {
private static ErrorLogFrame instance;
private final JPanel logView = new JPanel();
private JPanel logViewInner = new JPanel();
private final JPanel logViewInner = new JPanel();
private final Handler handler;
private final ImageIcon expandIcon;
private final ImageIcon collapseIcon;
@@ -299,3 +299,9 @@ config.description.overrideTextExportFileName = You can customite the filename o
config.name.showOldTextDuringTextEditing = Show old text during text editing
config.description.showOldTextDuringTextEditing = Shows the original text of the text tag with gray color in the preview area.
config.group.name.import = Import
config.group.description.import = Configuration of imports
config.name.textImportResizeTextBoundsMode = Text bounds resize mode
config.description.textImportResizeTextBoundsMode = Text bounds resize mode after text editing.
@@ -299,3 +299,9 @@ config.description.overrideTextExportFileName = Szem\u00e9lyre szabhatod a nev\u
config.name.showOldTextDuringTextEditing = R\u00e9gi sz\u00f6veg mutat\u00e1sa sz\u00f6veg szerkeszt\u00e9sekor
config.description.showOldTextDuringTextEditing = Mutatja az eredeti sz\u00f6veget sz\u00fcrke sz\u00ednnel az el\u0151n\u00e9zeti ablakban szerkeszt\u00e9s k\u00f6zben.
config.group.name.import = Import\u00e1l\u00e1s
config.group.description.import = Import\u00e1l\u00e1s be\u00e1ll\u00edt\u00e1sai
config.name.textImportResizeTextBoundsMode = Sz\u00f6veg hat\u00e1r \u00e1tm\u00e9retez\u00e9se
config.description.textImportResizeTextBoundsMode = Sz\u00f6veg hat\u00e1r \u00e1tm\u00e9retez\u00e9se sz\u00f6veg m\u00f3dos\u00edt\u00e1sa ut\u00e1n.