mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
default focus on text when editing JLabel
This commit is contained in:
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user