Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrej ten Brummelhuis2014-05-18 18:00:58 -0400
committerMarco Descher2014-06-16 09:30:39 -0400
commit0dc361ad0733d205397172baf30c164644ef46ba (patch)
treec25ce49e9e757b8ce82f11723323fc5deae2cede
parent13432bf9809e5de930c3c864074155433ff2a0a9 (diff)
downloadorg.eclipse.e4.tools-0dc361ad0733d205397172baf30c164644ef46ba.tar.gz
org.eclipse.e4.tools-0dc361ad0733d205397172baf30c164644ef46ba.tar.xz
org.eclipse.e4.tools-0dc361ad0733d205397172baf30c164644ef46ba.zip
Bug 395283 - Store and restore window size and location of subdialogs
while editing Applicatione4xmi Change-Id: Idbff52a385aee352e7862f0ac1d66788b188f2ad Signed-off-by: Andrej ten Brummelhuis <andrejbrummelhuis@gmail.com>
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractCommandSelectionDialog.java4
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractIconDialogWithHardcodedScope.java4
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractIdDialog.java7
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/BindingContextSelectionDialog.java6
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/CommandCategorySelectionDialog.java6
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/ExpressionIdDialog.java6
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FeatureSelectionDialog.java6
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FilteredContributionDialog.java4
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FindImportElementDialog.java6
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/SaveDialogBoundsSettingsDialog.java66
-rw-r--r--bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/SharedElementsDialog.java6
11 files changed, 93 insertions, 28 deletions
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractCommandSelectionDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractCommandSelectionDialog.java
index 5f96c0fd..ece8294e 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractCommandSelectionDialog.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractCommandSelectionDialog.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
+ * Andrej ten Brummelhuis <andrejbrummelhuis@gmail.com> - Bug 395283
******************************************************************************/
package org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs;
@@ -23,7 +24,6 @@ import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.DoubleClickEvent;
@@ -47,7 +47,7 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-public abstract class AbstractCommandSelectionDialog extends TitleAreaDialog {
+public abstract class AbstractCommandSelectionDialog extends SaveDialogBoundsSettingsDialog {
private IModelResource resource;
private TableViewer viewer;
protected Messages Messages;
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractIconDialogWithHardcodedScope.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractIconDialogWithHardcodedScope.java
index 4304f641..44293532 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractIconDialogWithHardcodedScope.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractIconDialogWithHardcodedScope.java
@@ -8,6 +8,7 @@
* Contributors:
* Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
* Steven Spungin <steven@spungin.tv> - Bug 404136, 424730
+ * Andrej ten Brummelhuis <andrejbrummelhuis@gmail.com> - Bug 395283
******************************************************************************/
package org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs;
@@ -36,7 +37,6 @@ import org.eclipse.e4.tools.emf.ui.internal.Messages;
import org.eclipse.e4.tools.emf.ui.internal.StringMatcher;
import org.eclipse.e4.tools.emf.ui.internal.common.component.tabs.empty.E;
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -70,7 +70,7 @@ import org.eclipse.swt.widgets.Text;
* @author Steven Spungin
*
*/
-public abstract class AbstractIconDialogWithHardcodedScope extends TitleAreaDialog {
+public abstract class AbstractIconDialogWithHardcodedScope extends SaveDialogBoundsSettingsDialog {
private TableViewer viewer;
private IProject project;
private Map<IFile, Image> icons = Collections.synchronizedMap(new HashMap<IFile, Image>());
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractIdDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractIdDialog.java
index a5985559..1fcde1e2 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractIdDialog.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractIdDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013
+ * Copyright (c) 2013 - 2014 fhv.at 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
@@ -7,7 +7,7 @@
*
* Contributors:
* Nicolaj Hoess <nicohoess@gmail.com> - initial implementation (Bug 396975)
- * Andrej Brummelhuis <andrejbrummelhuis@gmail.com> - initial implementation (Bug 396975)
+ * Andrej Brummelhuis <andrejbrummelhuis@gmail.com> - Bug 396975, 395283
* Adrian Alcaide - initial implementation (Bug 396975)
*******************************************************************************/
package org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs;
@@ -23,7 +23,6 @@ import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.DoubleClickEvent;
@@ -44,7 +43,7 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-public abstract class AbstractIdDialog<ContributionClass, ElementClass extends MApplicationElement> extends TitleAreaDialog {
+public abstract class AbstractIdDialog<ContributionClass, ElementClass extends MApplicationElement> extends SaveDialogBoundsSettingsDialog {
protected EModelService modelService;
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/BindingContextSelectionDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/BindingContextSelectionDialog.java
index 85e319cf..dad7b1bc 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/BindingContextSelectionDialog.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/BindingContextSelectionDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 BestSolution.at and others.
+ * Copyright (c) 2010-2014 BestSolution.at 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
+ * Andrej ten Brummelhuis <andrejbrummelhuis@gmail.com> - Bug 395283
******************************************************************************/
package org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs;
@@ -21,7 +22,6 @@ import org.eclipse.e4.ui.model.application.commands.impl.CommandsPackageImpl;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.DoubleClickEvent;
@@ -45,7 +45,7 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-public class BindingContextSelectionDialog extends TitleAreaDialog {
+public class BindingContextSelectionDialog extends SaveDialogBoundsSettingsDialog {
private IModelResource resource;
private TableViewer viewer;
private MBindingContext selectedContext;
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/CommandCategorySelectionDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/CommandCategorySelectionDialog.java
index 92d09255..72112954 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/CommandCategorySelectionDialog.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/CommandCategorySelectionDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 BestSolution.at and others.
+ * Copyright (c) 2010-2014 BestSolution.at 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
+ * Andrej ten Brummelhuis <andrejbrummelhuis@gmail.com> - Bug 395283
******************************************************************************/
package org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs;
@@ -24,7 +25,6 @@ import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.edit.command.SetCommand;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.DoubleClickEvent;
@@ -48,7 +48,7 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-public class CommandCategorySelectionDialog extends TitleAreaDialog {
+public class CommandCategorySelectionDialog extends SaveDialogBoundsSettingsDialog {
private IModelResource resource;
private TableViewer viewer;
private MCommand command;
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/ExpressionIdDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/ExpressionIdDialog.java
index 9ed5253a..4e3db84a 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/ExpressionIdDialog.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/ExpressionIdDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 BestSolution.at and others.
+ * Copyright (c) 2010-2014 BestSolution.at 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
+ * Andrej ten Brummelhuis <andrejbrummelhuis@gmail.com> - Bug 395283
******************************************************************************/
package org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs;
@@ -23,7 +24,6 @@ import org.eclipse.e4.ui.model.application.ui.impl.UiPackageImpl;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.DoubleClickEvent;
@@ -45,7 +45,7 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-public class ExpressionIdDialog extends TitleAreaDialog {
+public class ExpressionIdDialog extends SaveDialogBoundsSettingsDialog {
private IExtensionLookup lookup;
private TableViewer viewer;
private EditingDomain domain;
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FeatureSelectionDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FeatureSelectionDialog.java
index e8b80456..9f3918f8 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FeatureSelectionDialog.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FeatureSelectionDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 BestSolution.at and others.
+ * Copyright (c) 2010-2014 BestSolution.at 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
+ * Andrej ten Brummelhuis <andrejbrummelhuis@gmail.com> - Bug 395283
******************************************************************************/
package org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs;
@@ -27,7 +28,6 @@ import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ILabelProvider;
@@ -58,7 +58,7 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-public class FeatureSelectionDialog extends TitleAreaDialog {
+public class FeatureSelectionDialog extends SaveDialogBoundsSettingsDialog {
private TreeViewer viewer;
private MStringModelFragment fragment;
private EditingDomain editingDomain;
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FilteredContributionDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FilteredContributionDialog.java
index 93b52811..394cae81 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FilteredContributionDialog.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FilteredContributionDialog.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Steven Spungin <steven@spungin.tv> - initial API and implementation, Bug 424730, Bug 435625, Bug 436281
+ * Andrej ten Brummelhuis <andrejbrummelhuis@gmail.com> - Bug 395283
*******************************************************************************/
package org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs;
@@ -52,7 +53,6 @@ import org.eclipse.e4.tools.emf.ui.internal.common.resourcelocator.dialogs.NonRe
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.DoubleClickEvent;
@@ -98,7 +98,7 @@ import org.eclipse.swt.widgets.Text;
* @author Steven Spungin
*
*/
-public abstract class FilteredContributionDialog extends TitleAreaDialog {
+public abstract class FilteredContributionDialog extends SaveDialogBoundsSettingsDialog {
private static final int MAX_RESULTS = 500;
private Image contributionTypeImage;
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FindImportElementDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FindImportElementDialog.java
index b15b5f4a..c6746c25 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FindImportElementDialog.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/FindImportElementDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 BestSolution.at and others.
+ * Copyright (c) 2010-2014 BestSolution.at 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
+ * Andrej ten Brummelhuis <andrejbrummelhuis@gmail.com> - Bug 395283
******************************************************************************/
package org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs;
@@ -24,7 +25,6 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -53,7 +53,7 @@ import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.ServiceReference;
-public class FindImportElementDialog extends TitleAreaDialog {
+public class FindImportElementDialog extends SaveDialogBoundsSettingsDialog {
private EObject element;
private AbstractComponentEditor editor;
private TableViewer viewer;
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/SaveDialogBoundsSettingsDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/SaveDialogBoundsSettingsDialog.java
new file mode 100644
index 00000000..a713f642
--- /dev/null
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/SaveDialogBoundsSettingsDialog.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2014 fhv.at 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:
+ * Andrej ten Brummelhuis <andrejbrummelhuis@gmail.com> - initial implementation (Bug 395283)
+ *******************************************************************************/
+package org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs;
+
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.dialogs.DialogSettings;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.osgi.service.prefs.BackingStoreException;
+import org.osgi.service.prefs.Preferences;
+
+public abstract class SaveDialogBoundsSettingsDialog extends TitleAreaDialog {
+
+ private static final String ORG_ECLIPSE_E4_TOOLS_EMF_UI = "org.eclipse.e4.tools.emf.ui"; //$NON-NLS-1$
+
+ private static final String DIALOG_ORIGIN_X = "DIALOG_X_ORIGIN"; //$NON-NLS-1$
+ private static final String DIALOG_ORIGIN_Y = "DIALOG_Y_ORIGIN"; //$NON-NLS-1$
+ private static final String DIALOG_WIDTH = "DIALOG_WIDTH"; //$NON-NLS-1$
+ private static final String DIALOG_HEIGHT = "DIALOG_HEIGHT"; //$NON-NLS-1$
+
+ private IDialogSettings dialogSettings;
+
+ private Preferences preferences = InstanceScope.INSTANCE.getNode(ORG_ECLIPSE_E4_TOOLS_EMF_UI);
+
+ public SaveDialogBoundsSettingsDialog(Shell parentShell) {
+ super(parentShell);
+ }
+
+ @Override
+ protected IDialogSettings getDialogBoundsSettings() {
+ dialogSettings = new DialogSettings(ORG_ECLIPSE_E4_TOOLS_EMF_UI);
+ dialogSettings.put(DIALOG_HEIGHT, preferences.getInt(DIALOG_HEIGHT, -1));
+ dialogSettings.put(DIALOG_WIDTH, preferences.getInt(DIALOG_WIDTH, -1));
+ dialogSettings.put(DIALOG_ORIGIN_X, preferences.getInt(DIALOG_ORIGIN_X, -1));
+ dialogSettings.put(DIALOG_ORIGIN_Y, preferences.getInt(DIALOG_ORIGIN_Y, -1));
+ return dialogSettings;
+ }
+
+ private void saveDialogSettings() {
+ preferences.put(DIALOG_HEIGHT, dialogSettings.get(DIALOG_HEIGHT));
+ preferences.put(DIALOG_WIDTH, dialogSettings.get(DIALOG_WIDTH));
+ preferences.put(DIALOG_ORIGIN_X, dialogSettings.get(DIALOG_ORIGIN_X));
+ preferences.put(DIALOG_ORIGIN_Y, dialogSettings.get(DIALOG_ORIGIN_Y));
+ try {
+ preferences.flush();
+ } catch (BackingStoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public boolean close() {
+ boolean returnValue = super.close();
+ saveDialogSettings();
+ return returnValue;
+ }
+}
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/SharedElementsDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/SharedElementsDialog.java
index 16d64147..9743e709 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/SharedElementsDialog.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/SharedElementsDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 BestSolution.at and others.
+ * Copyright (c) 2010-2014 BestSolution.at 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
+ * Andrej ten Brummelhuis <andrejbrummelhuis@gmail.com> - Bug 395283
******************************************************************************/
package org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs;
@@ -36,7 +37,6 @@ import org.eclipse.e4.ui.model.fragment.MStringModelFragment;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.SetCommand;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.DoubleClickEvent;
@@ -58,7 +58,7 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-public class SharedElementsDialog extends TitleAreaDialog {
+public class SharedElementsDialog extends SaveDialogBoundsSettingsDialog {
private TableViewer viewer;
private MPlaceholder placeholder;
private IModelResource resource;

Back to the top