Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2018-05-27 04:07:37 -0400
committerThomas Wolf2018-06-23 07:51:35 -0400
commitb2d8738cbb276e37138d288cb3fcd6cbc773319f (patch)
tree719625acad821e69be450fbb71f2442cfb577843 /org.eclipse.egit.ui
parentcede9c0b0cf311954ce1bc3e5ff035a957e1ffa2 (diff)
downloadegit-b2d8738cbb276e37138d288cb3fcd6cbc773319f.tar.gz
egit-b2d8738cbb276e37138d288cb3fcd6cbc773319f.tar.xz
egit-b2d8738cbb276e37138d288cb3fcd6cbc773319f.zip
Reveal newly created entry in configuration editor
I've chosen to not set the selection to the new entry, but only to reveal it. If some of the egit core developers thinks different, I'm open to change this. Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de> Bug:535160 Change-Id: I383a35a3b4a80bfcd32a730298942a54c947c80e
Diffstat (limited to 'org.eclipse.egit.ui')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java
index 2dd454762..b55ed8843 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/ConfigurationEditorComponent.java
@@ -340,6 +340,7 @@ public class ConfigurationEditorComponent {
else
entry.addValue(dlg.getValue());
markDirty();
+ reveal(sectionName, null, entryName);
} else if (st.countTokens() > 2) {
int n = st.countTokens();
String sectionName = st.nextToken();
@@ -358,6 +359,7 @@ public class ConfigurationEditorComponent {
else
entry.addValue(dlg.getValue());
markDirty();
+ reveal(sectionName, subSectionName, entryName);
} else
Activator
.handleError(
@@ -511,6 +513,15 @@ public class ConfigurationEditorComponent {
tv.refresh();
}
+ private void reveal(String sectionName, String subSectionName,
+ String entryName) {
+ Entry entry = ((GitConfig) tv.getInput()).getEntry(sectionName,
+ subSectionName, entryName);
+ if (entry != null) {
+ tv.reveal(entry);
+ }
+ }
+
private final static class GitConfig extends WorkbenchAdapter {
private final Config config;
@@ -898,6 +909,14 @@ public class ConfigurationEditorComponent {
return false;
return true;
}
+
+ @Override
+ public Object getParent(Object object) {
+ if (sectionparent != null)
+ return sectionparent;
+ else
+ return subsectionparent;
+ }
}
private static final class ConfigEditorLabelProvider extends

Back to the top