Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-03-19 18:54:35 +0000
committerEike Stepper2015-03-19 19:05:48 +0000
commit2a577a50442c226fb04eeb30a049b9422275c1ad (patch)
tree8be5ea2b0b54b08359694fc47679c692f200ca7c /plugins/org.eclipse.emf.cdo.ui
parentf474446a05b4bef3bb7eb3afc6bfce0c8dd6fa5e (diff)
downloadcdo-2a577a50442c226fb04eeb30a049b9422275c1ad.tar.gz
cdo-2a577a50442c226fb04eeb30a049b9422275c1ad.tar.xz
cdo-2a577a50442c226fb04eeb30a049b9422275c1ad.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/plugin.xml17
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/widgets/ComposeBranchPointComposite.java75
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/widgets/SelectTimeStampComposite.java8
3 files changed, 67 insertions, 33 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/plugin.xml b/plugins/org.eclipse.emf.cdo.ui/plugin.xml
index dab1dd0a3e..ce96905f34 100644
--- a/plugins/org.eclipse.emf.cdo.ui/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.ui/plugin.xml
@@ -363,9 +363,12 @@
tooltip="Add a new branch">
<visibleWhen checkEnabled="false">
<with variable="activeMenuSelection">
- <iterate>
- <adapt type="org.eclipse.emf.cdo.common.branch.CDOBranchCreationContext"/>
- </iterate>
+ <and>
+ <count value="1"/>
+ <iterate>
+ <adapt type="org.eclipse.emf.cdo.common.branch.CDOBranchCreationContext"/>
+ </iterate>
+ </and>
</with>
</visibleWhen>
</command>
@@ -381,7 +384,7 @@
tooltip="Acquire write locks for the selected objects">
<visibleWhen checkEnabled="false">
<with variable="activeMenuSelection">
- <iterate>
+ <iterate ifEmpty="false">
<and>
<adapt type="org.eclipse.emf.ecore.EObject"/>
<test property="org.eclipse.emf.cdo.object.transactional" value="true"/>
@@ -400,7 +403,7 @@
tooltip="Acquire write locks for the selected objects and their children">
<visibleWhen checkEnabled="false">
<with variable="activeMenuSelection">
- <iterate>
+ <iterate ifEmpty="false">
<and>
<instanceof value="org.eclipse.emf.ecore.EObject"/>
<test property="org.eclipse.emf.cdo.object.transactional" value="true"/>
@@ -421,7 +424,7 @@
tooltip="Release write locks for the selected objects">
<visibleWhen checkEnabled="false">
<with variable="activeMenuSelection">
- <iterate>
+ <iterate ifEmpty="false">
<and>
<adapt type="org.eclipse.emf.ecore.EObject"/>
<test property="org.eclipse.emf.cdo.object.writeLocked" value="true"/>
@@ -438,7 +441,7 @@
tooltip="Release write locks for the selected objects and their children">
<visibleWhen checkEnabled="false">
<with variable="activeMenuSelection">
- <iterate>
+ <iterate ifEmpty="false">
<and>
<instanceof value="org.eclipse.emf.ecore.EObject"/>
<test property="org.eclipse.emf.cdo.object.writeLocked" value="true"/>
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 4f17052d77..966a761dbc 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
@@ -11,6 +11,7 @@
package org.eclipse.emf.cdo.ui.widgets;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.common.branch.CDOBranchManager;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.ui.CDOItemProvider;
@@ -124,12 +125,20 @@ public class ComposeBranchPointComposite extends Composite
this.branchPoint = branchPoint;
if (branchPoint != null)
{
- CDOBranch branch = branchPoint.getBranch();
- long timeStamp = branchPoint.getTimeStamp();
+ final CDOBranch branch = branchPoint.getBranch();
+ final long timeStamp = branchPoint.getTimeStamp();
if (branchViewer != null)
{
- branchViewer.setSelection(new StructuredSelection(branch));
+ setBranchViewerInput();
+
+ getDisplay().asyncExec(new Runnable()
+ {
+ public void run()
+ {
+ branchViewer.setSelection(new StructuredSelection(branch));
+ }
+ });
}
if (timeStampComposite != null)
@@ -197,6 +206,11 @@ public class ComposeBranchPointComposite extends Composite
{
timeStampComposite = createSelectTimeStampComposite();
}
+
+ if (branchPoint != null)
+ {
+ setBranchViewerInput();
+ }
}
/**
@@ -204,7 +218,7 @@ public class ComposeBranchPointComposite extends Composite
*/
protected TreeViewer createBranchViewer()
{
- CDOItemProvider itemProvider = new CDOItemProvider(null);
+ CDOItemProvider itemProvider = createBranchItemProvider();
TreeViewer branchViewer = new TreeViewer(this, SWT.BORDER | SWT.SINGLE);
branchViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
@@ -225,6 +239,14 @@ public class ComposeBranchPointComposite extends Composite
/**
* @since 4.4
*/
+ protected CDOItemProvider createBranchItemProvider()
+ {
+ return new CDOItemProvider(null);
+ }
+
+ /**
+ * @since 4.4
+ */
protected SelectTimeStampComposite createSelectTimeStampComposite()
{
timeStampGroup = new Group(this, SWT.NONE);
@@ -284,6 +306,33 @@ public class ComposeBranchPointComposite extends Composite
};
}
+ /**
+ * @since 4.4
+ */
+ protected void timeStampError(String message)
+ {
+ }
+
+ protected void branchPointChanged(CDOBranchPoint branchPoint)
+ {
+ }
+
+ /**
+ * @since 4.4
+ */
+ protected void doubleClicked()
+ {
+ }
+
+ private void setBranchViewerInput()
+ {
+ CDOBranchManager input = branchPoint.getBranch().getBranchManager();
+ if (input != branchViewer.getInput())
+ {
+ branchViewer.setInput(input);
+ }
+ }
+
private void composeBranchPoint()
{
if (branchViewer == null)
@@ -310,22 +359,4 @@ public class ComposeBranchPointComposite extends Composite
}
}
}
-
- /**
- * @since 4.4
- */
- protected void timeStampError(String message)
- {
- }
-
- protected void branchPointChanged(CDOBranchPoint branchPoint)
- {
- }
-
- /**
- * @since 4.4
- */
- protected void doubleClicked()
- {
- }
}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/widgets/SelectTimeStampComposite.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/widgets/SelectTimeStampComposite.java
index 9657f1e827..bf4f7dee62 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/widgets/SelectTimeStampComposite.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/widgets/SelectTimeStampComposite.java
@@ -211,19 +211,19 @@ public class SelectTimeStampComposite extends Composite implements ValidationPar
{
long oldTimeStamp = this.timeStamp;
this.timeStamp = timeStamp;
- if (headRadio.isEnabled()
- && (timeStamp == CDOBranchPoint.INVALID_DATE || timeStamp == CDOBranchPoint.UNSPECIFIED_DATE))
+ if (branch != null && (timeStamp == CDOBranchPoint.INVALID_DATE || timeStamp == CDOBranchPoint.UNSPECIFIED_DATE))
{
selectRadio(headRadio);
}
- else if (baseRadio.isEnabled() && timeStamp == branch.getBase().getTimeStamp())
+ else if (branch != null && timeStamp == branch.getBase().getTimeStamp())
{
selectRadio(baseRadio);
}
else
{
selectRadio(timeRadio);
- String text = timeStamp == CDOBranchPoint.INVALID_DATE ? "" : CDOCommonUtil.formatTimeStamp(timeStamp);
+ String text = CDOCommonUtil.formatTimeStamp(timeStamp == CDOBranchPoint.INVALID_DATE
+ || timeStamp == CDOBranchPoint.UNSPECIFIED_DATE ? System.currentTimeMillis() : timeStamp);
if (!timeText.getText().equals(text))
{
timeText.setText(text);

Back to the top