Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-03-18 07:47:48 +0000
committerEike Stepper2015-03-18 11:46:36 +0000
commit4db261fcbf7ea2e0911472eea0930fb326ef255c (patch)
tree9406dbf6094133602a4b1fcdc4f0abb98e4ff7f3 /plugins/org.eclipse.emf.cdo.ui
parent468612c95d76d4f355fdd05eebea6e346a3b665d (diff)
downloadcdo-4db261fcbf7ea2e0911472eea0930fb326ef255c.tar.gz
cdo-4db261fcbf7ea2e0911472eea0930fb326ef255c.tar.xz
cdo-4db261fcbf7ea2e0911472eea0930fb326ef255c.zip
[458349] Consolidate UI
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=458349
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.ui')
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/widgets/ComposeBranchPointComposite.java47
1 files changed, 37 insertions, 10 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/widgets/ComposeBranchPointComposite.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/widgets/ComposeBranchPointComposite.java
index 1d6342561a..4f17052d77 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/widgets/ComposeBranchPointComposite.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/widgets/ComposeBranchPointComposite.java
@@ -41,12 +41,14 @@ import org.eclipse.swt.widgets.Group;
*/
public class ComposeBranchPointComposite extends Composite
{
- private final boolean allowTimeStamp;
+ private boolean allowTimeStamp;
private CDOBranchPoint branchPoint;
private TreeViewer branchViewer;
+ private Group timeStampGroup;
+
private SelectTimeStampComposite timeStampComposite;
/**
@@ -85,6 +87,30 @@ public class ComposeBranchPointComposite extends Composite
return allowTimeStamp;
}
+ /**
+ * @since 4.4
+ */
+ public final void setAllowTimeStamp(boolean allowTimeStamp)
+ {
+ if (this.allowTimeStamp != allowTimeStamp)
+ {
+ this.allowTimeStamp = allowTimeStamp;
+
+ if (timeStampGroup != null && !allowTimeStamp)
+ {
+ timeStampGroup.dispose();
+ timeStampGroup = null;
+ timeStampComposite = null;
+ }
+ else if (timeStampGroup == null && allowTimeStamp)
+ {
+ timeStampComposite = createSelectTimeStampComposite();
+ }
+
+ layout();
+ }
+ }
+
public CDOBranchPoint getBranchPoint()
{
return branchPoint;
@@ -170,13 +196,6 @@ public class ComposeBranchPointComposite extends Composite
if (allowTimeStamp)
{
timeStampComposite = createSelectTimeStampComposite();
- timeStampComposite.setValidationContext(new ValidationContext()
- {
- public void setValidationError(Object source, String message)
- {
- timeStampError(message);
- }
- });
}
}
@@ -208,7 +227,7 @@ public class ComposeBranchPointComposite extends Composite
*/
protected SelectTimeStampComposite createSelectTimeStampComposite()
{
- Group timeStampGroup = new Group(this, SWT.NONE);
+ timeStampGroup = new Group(this, SWT.NONE);
timeStampGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
timeStampGroup.setLayout(new GridLayout(1, false));
timeStampGroup.setText("Time Stamp:");
@@ -224,6 +243,14 @@ public class ComposeBranchPointComposite extends Composite
timeStampComposite.getTimeBrowseButton().setVisible(false);
timeStampComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ timeStampComposite.setValidationContext(new ValidationContext()
+ {
+ public void setValidationError(Object source, String message)
+ {
+ timeStampError(message);
+ }
+ });
+
return timeStampComposite;
}
@@ -271,7 +298,7 @@ public class ComposeBranchPointComposite extends Composite
if (branch != null)
{
long timeStamp = CDOBranchPoint.UNSPECIFIED_DATE;
- if (timeStampComposite != null)
+ if (allowTimeStamp && timeStampComposite != null)
{
timeStamp = timeStampComposite.getTimeStamp();
}

Back to the top