default focus on text when editing JLabel

This commit is contained in:
bancika
2017-01-05 10:35:20 +01:00
parent 23d702eeb5
commit 53f09e6143
6 changed files with 31 additions and 19 deletions
Binary file not shown.
@@ -116,12 +116,20 @@ public class PropertyEditorDialog extends ButtonDialog {
editorPanel.add(createDefaultCheckBox(property), gbc);
}
}
// Make value field focused
if (property.getName().equalsIgnoreCase("value")) {
componentToFocus = editor;
}
// Make value field focused
try {
if (componentToFocus == null && property.getGetter().getName().equalsIgnoreCase("getValue")) {
componentToFocus = editor;
}
} catch (Exception e1) {
LOG.warn("Could not determine editor component to focus", e1);
}
gbc.gridy++;
}
@@ -48,4 +48,10 @@ public class StringEditor extends JTextField {
setBackground(oldBg);
property.setValue(getText());
}
@Override
public boolean requestFocusInWindow() {
selectAll();
return super.requestFocusInWindow();
}
}
+4
View File
@@ -1522,6 +1522,10 @@
<changeType>NEW_FEATURE</changeType>
<description>Mirror selection horizontally and vertically</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Default focus on "Text" field for label</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Consolidated popup menu items with "Edit" menu</description>