Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-11-07 09:35:08 +0000
committerEike Stepper2012-11-07 09:35:08 +0000
commitc4cd3b63a6c17f34d1a430951f21428220d95302 (patch)
tree38286e206b96590b8c77529b8d17140f1967df26 /plugins/org.eclipse.emf.cdo.examples.client.offline
parent36a8b55ef26c957dc9dd92a49ec929a021be49b1 (diff)
downloadcdo-c4cd3b63a6c17f34d1a430951f21428220d95302.tar.gz
cdo-c4cd3b63a6c17f34d1a430951f21428220d95302.tar.xz
cdo-c4cd3b63a6c17f34d1a430951f21428220d95302.zip
Offline Example
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.examples.client.offline')
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/plugin.xml4
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/AbstractView.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientPerspective.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/CloneRepositoryView.java23
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/NormalRepositoryView.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/wb/swt/ExampleResourceManager.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/wb/swt/ExampleSWTResourceManager.java (renamed from plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/wb/swt/SWTResourceManager.java)2
8 files changed, 47 insertions, 13 deletions
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/plugin.xml b/plugins/org.eclipse.emf.cdo.examples.client.offline/plugin.xml
index 8dea2cbda1..b1ebac6968 100644
--- a/plugins/org.eclipse.emf.cdo.examples.client.offline/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/plugin.xml
@@ -46,6 +46,10 @@
<extension
point="org.eclipse.ui.views">
<view
+ class="org.eclipse.emf.cdo.examples.client.offline.CloneRepositoryView"
+ id="org.eclipse.emf.cdo.examples.client.offline.CloneRepositoryView"
+ name="Clone Repository"/>
+ <view
class="org.eclipse.emf.cdo.examples.client.offline.NormalRepositoryView"
id="org.eclipse.emf.cdo.examples.client.offline.NormalRepositoryView"
name="Normal Repository"/>
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/AbstractView.java b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/AbstractView.java
index ae7112c1ef..cddad8ec48 100644
--- a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/AbstractView.java
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/AbstractView.java
@@ -22,7 +22,7 @@ import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.part.ViewPart;
-import org.eclipse.wb.swt.SWTResourceManager;
+import org.eclipse.wb.swt.ExampleSWTResourceManager;
/**
* @author Eike Stepper
@@ -62,9 +62,9 @@ public abstract class AbstractView<T extends IContainer<?>> extends ViewPart
createPane(sash, object);
events = new Text(sash, SWT.BORDER | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL | SWT.MULTI);
- events.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
+ events.setBackground(ExampleSWTResourceManager.getColor(SWT.COLOR_WHITE));
- sash.setWeights(new int[] { 1, 1 });
+ sash.setWeights(new int[] { 2, 1 });
createActions();
initializeToolBar(getViewSite().getActionBars().getToolBarManager());
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientPerspective.java b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientPerspective.java
index 3c579117c0..11ef9200cf 100644
--- a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientPerspective.java
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientPerspective.java
@@ -22,7 +22,8 @@ public class ClientPerspective implements IPerspectiveFactory
{
layout.setFixed(true);
layout.addView("org.eclipse.emf.cdo.ui.CDOSessionsView", IPageLayout.LEFT, 0.5f, IPageLayout.ID_EDITOR_AREA);
- layout.addView("org.eclipse.ui.views.PropertySheet", IPageLayout.BOTTOM, 0.5f,
+ layout.addView("org.eclipse.emf.cdo.examples.client.offline.CloneRepositoryView", IPageLayout.BOTTOM, 0.5f,
"org.eclipse.emf.cdo.ui.CDOSessionsView");
+ layout.addView("org.eclipse.ui.views.PropertySheet", IPageLayout.BOTTOM, 0.5f, IPageLayout.ID_EDITOR_AREA);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/CloneRepositoryView.java b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/CloneRepositoryView.java
new file mode 100644
index 0000000000..b03590dbe6
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/CloneRepositoryView.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.examples.client.offline;
+
+/**
+ * @author Eike Stepper
+ */
+public class CloneRepositoryView extends NormalRepositoryView
+{
+ public static final String ID = "org.eclipse.emf.cdo.examples.client.offline.CloneRepositoryView"; //$NON-NLS-1$
+
+ public CloneRepositoryView()
+ {
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/NormalRepositoryView.java b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/NormalRepositoryView.java
index 919ce13cb7..1727eeec58 100644
--- a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/NormalRepositoryView.java
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/NormalRepositoryView.java
@@ -12,8 +12,6 @@ package org.eclipse.emf.cdo.examples.client.offline;
import org.eclipse.emf.cdo.server.IRepository;
-import org.eclipse.net4j.util.container.IContainer;
-import org.eclipse.net4j.util.container.IPluginContainer;
import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.net4j.util.ui.views.ContainerItemProvider;
import org.eclipse.net4j.util.ui.views.ItemProvider;
@@ -35,7 +33,7 @@ public class NormalRepositoryView extends AbstractView<IRepository>
{
public static final String ID = "org.eclipse.emf.cdo.examples.client.offline.NormalRepositoryView"; //$NON-NLS-1$
- private ItemProvider<IContainer<Object>> itemProvider;
+ private ItemProvider<IRepository> itemProvider;
private TreeViewer treeViewer;
@@ -49,7 +47,7 @@ public class NormalRepositoryView extends AbstractView<IRepository>
@Override
protected void createPane(Composite parent, IRepository repository)
{
- itemProvider = new ContainerItemProvider<IContainer<Object>>()
+ itemProvider = new ContainerItemProvider<IRepository>()
{
private Image bean = ExampleResourceManager.getPluginImage(Application.PLUGIN_ID, "icons/Bean.gif");
@@ -82,7 +80,7 @@ public class NormalRepositoryView extends AbstractView<IRepository>
treeViewer = new TreeViewer(sash, SWT.BORDER);
treeViewer.setLabelProvider(itemProvider);
treeViewer.setContentProvider(itemProvider);
- treeViewer.setInput(IPluginContainer.INSTANCE);
+ treeViewer.setInput(repository);
details = new ScrolledComposite(sash, SWT.V_SCROLL);
details.setExpandHorizontal(true);
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java
index 8d4fc07ced..96076aca50 100644
--- a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java
@@ -148,7 +148,7 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
public void configureWindow(IWorkbenchWindowConfigurer configurer)
{
- configurer.setInitialSize(new Point(1000, 700));
+ configurer.setInitialSize(new Point(800, 500));
configurer.setTitle(Application.NODE.getName());
configurer.setShowCoolBar(false);
configurer.setShowMenuBar(false);
@@ -297,6 +297,7 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
props.put(IRepository.Props.OVERRIDE_UUID, REPOSITORY_NAME);
props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
+ props.put(IRepository.Props.ID_GENERATION_LOCATION, "CLIENT");
IRepository repository = createRepository(node, store, props);
CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
@@ -595,6 +596,13 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
super(manager);
addProperty(new Property.Entry(this, PORT_PROPERTY));
}
+
+ @Override
+ public void configureWindow(IWorkbenchWindowConfigurer configurer)
+ {
+ super.configureWindow(configurer);
+ configurer.setInitialSize(new Point(600, 500));
+ }
}
/**
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/wb/swt/ExampleResourceManager.java b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/wb/swt/ExampleResourceManager.java
index 4fa47d02e8..62252dd9b9 100644
--- a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/wb/swt/ExampleResourceManager.java
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/wb/swt/ExampleResourceManager.java
@@ -43,7 +43,7 @@ import java.util.Map;
* @author scheglov_ke
* @author Dan Rubel
*/
-public class ExampleResourceManager extends SWTResourceManager
+public class ExampleResourceManager extends ExampleSWTResourceManager
{
// //////////////////////////////////////////////////////////////////////////
//
@@ -206,7 +206,7 @@ public class ExampleResourceManager extends SWTResourceManager
*/
public static void disposeImages()
{
- SWTResourceManager.disposeImages();
+ ExampleSWTResourceManager.disposeImages();
// dispose ImageDescriptor images
{
for (Iterator<Image> I = m_descriptorImageMap.values().iterator(); I.hasNext();)
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/wb/swt/SWTResourceManager.java b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/wb/swt/ExampleSWTResourceManager.java
index 3bcc1029a6..0e99b5a2d3 100644
--- a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/wb/swt/SWTResourceManager.java
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/wb/swt/ExampleSWTResourceManager.java
@@ -40,7 +40,7 @@ import java.util.Map;
* @author scheglov_ke
* @author Dan Rubel
*/
-public class SWTResourceManager
+public class ExampleSWTResourceManager
{
// //////////////////////////////////////////////////////////////////////////
//

Back to the top