Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 224280 Details for
Bug 395283
Store and restore window size and location of subdialogs while editing Applicatione4xmi
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch including persistence as described
test.patch (text/plain), 14.37 KB, created by
Marco Descher
on 2012-12-04 15:57:27 EST
(
hide
)
Description:
Patch including persistence as described
Filename:
MIME Type:
Creator:
Marco Descher
Created:
2012-12-04 15:57:27 EST
Size:
14.37 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.e4.tools.emf.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.tools.emf.ui/META-INF/MANIFEST.MF >index 2f80d06..b7979af 100644 >--- a/bundles/org.eclipse.e4.tools.emf.ui/META-INF/MANIFEST.MF >+++ b/bundles/org.eclipse.e4.tools.emf.ui/META-INF/MANIFEST.MF >@@ -2,7 +2,7 @@ Manifest-Version: 1.0 > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.e4.tools.emf.ui;singleton:=true >-Bundle-Version: 0.12.0.qualifier >+Bundle-Version: 0.12.1.qualifier > Bundle-ClassPath: . > Bundle-Vendor: %providerName > Bundle-Localization: plugin >@@ -45,3 +45,4 @@ Export-Package: org.eclipse.e4.tools.emf.ui.common, > org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs;x-internal:=true, > org.eclipse.e4.tools.emf.ui.internal.wbm;x-friends:="org.eclipse.e4.tools.emf.editor" > Service-Component: OSGI-INF/contributioncollector.xml, OSGI-INF/resourceprovider.xml >+Bundle-Activator: org.eclipse.e4.tools.emf.ui.internal.ToolsEmfUiPlugin >diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/ToolsEmfUiPlugin.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/ToolsEmfUiPlugin.java >new file mode 100644 >index 0000000..a71b71c >--- /dev/null >+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/ToolsEmfUiPlugin.java >@@ -0,0 +1,144 @@ >+/******************************************************************************* >+ * Copyright (c) 2012 MEDEVIT and FHV 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: >+ * Marco Descher <marco@descher.at> - initial API and implementation >+ ******************************************************************************/ >+package org.eclipse.e4.tools.emf.ui.internal; >+ >+import java.io.File; >+import java.io.IOException; >+import java.net.URISyntaxException; >+import org.eclipse.core.runtime.URIUtil; >+import org.eclipse.jface.dialogs.DialogSettings; >+import org.eclipse.jface.dialogs.IDialogSettings; >+import org.eclipse.osgi.service.datalocation.Location; >+import org.osgi.framework.BundleActivator; >+import org.osgi.framework.BundleContext; >+import org.osgi.framework.Filter; >+import org.osgi.framework.InvalidSyntaxException; >+import org.osgi.util.tracker.ServiceTracker; >+ >+public class ToolsEmfUiPlugin implements BundleActivator { >+ // The plug-in ID >+ public static final String PLUGIN_ID = "org.eclipse.e4.tools.emf.ui"; //$NON-NLS-1$ >+ >+ private static ToolsEmfUiPlugin plugin; >+ private BundleContext context; >+ >+ private ServiceTracker locationTracker; >+ >+ public void start(BundleContext context) throws Exception { >+ plugin = this; >+ this.context = context; >+ } >+ >+ public void stop(BundleContext context) throws Exception { >+ saveDialogSettings(); >+ plugin = null; >+ } >+ >+ /** >+ * Returns the shared instance >+ * >+ * @return the shared instance >+ */ >+ public static ToolsEmfUiPlugin getDefault() { >+ return plugin; >+ } >+ >+ /** >+ * @return the instance Location service >+ */ >+ private Location getInstanceLocation() { >+ if (locationTracker == null) { >+ Filter filter = null; >+ try { >+ filter = context.createFilter(Location.INSTANCE_FILTER); >+ } catch (InvalidSyntaxException e) { >+ // ignore this. It should never happen as we have tested the >+ // above format. >+ } >+ locationTracker = new ServiceTracker(context, filter, null); >+ locationTracker.open(); >+ } >+ return (Location) locationTracker.getService(); >+ } >+ >+ private void loadDialogSettings() { >+ dialogSettings = new DialogSettings(PLUGIN_ID); >+ >+ File dialogSettingsFile = getDialogSettingsFile(); >+ >+ if (dialogSettingsFile.exists()) { >+ try { >+ dialogSettings.load(dialogSettingsFile.getAbsolutePath()); >+ } catch (IOException e) { >+ // load failed spec'ed to ignore problems >+ } >+ return; >+ } >+ >+ } >+ >+ private void saveDialogSettings() { >+ if (dialogSettings == null) { >+ return; >+ } >+ >+ File dialogSettingsFile = getDialogSettingsFile(); >+ >+ try { >+ dialogSettings.save(dialogSettingsFile.getAbsolutePath()); >+ } catch (IOException e) { >+ e.printStackTrace(); >+ // spec'ed to ignore problems >+ } >+ } >+ >+ private File getDialogSettingsFile() { >+ File baseLocation; >+ try { >+ baseLocation = new File(URIUtil.toURI(getInstanceLocation().getURL())); >+ } catch (URISyntaxException e) { >+ throw new RuntimeException(e); >+ } >+ baseLocation = new File(baseLocation, ".metadata"); //$NON-NLS-1$ >+ baseLocation = new File(baseLocation, ".plugins"); //$NON-NLS-1$ >+ baseLocation = new File(baseLocation, PLUGIN_ID); >+ File dialogSettingsFile = new File(baseLocation, FN_DIALOG_SETTINGS); >+ if (!dialogSettingsFile.exists()) >+ dialogSettingsFile.getParentFile().mkdirs(); >+ return dialogSettingsFile; >+ } >+ >+ // ////////////////////////////////////////////////////////////////////// >+ // The following code was copied from AbstractUIPlugin class. >+ /** >+ * The name of the dialog settings file (value >+ * <code>"dialog_settings.xml"</code>). >+ */ >+ private static final String FN_DIALOG_SETTINGS = "dialog_settings.xml"; //$NON-NLS-1$ >+ /** >+ * Storage for dialog and wizard data; <code>null</code> if not yet >+ * initialized. >+ */ >+ private IDialogSettings dialogSettings = null; >+ >+ /** >+ * @see AbstractUiPlugin#getDialogSettings() >+ * @return the dialog settings >+ */ >+ public IDialogSettings getDialogSettings() { >+ if (dialogSettings == null) { >+ loadDialogSettings(); >+ } >+ >+ return dialogSettings; >+ } >+ >+} >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 0543991..c6eb636 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 >+ * Marco Descher <marco@descher.at> - Bug395283 > ******************************************************************************/ > package org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs; > >@@ -15,6 +16,7 @@ import java.util.List; > import org.eclipse.e4.tools.emf.ui.common.IModelResource; > import org.eclipse.e4.tools.emf.ui.internal.Messages; > import org.eclipse.e4.tools.emf.ui.internal.PatternFilter; >+import org.eclipse.e4.tools.emf.ui.internal.ToolsEmfUiPlugin; > import org.eclipse.e4.tools.emf.ui.internal.common.component.ControlFactory; > import org.eclipse.e4.ui.model.application.commands.MCommand; > import org.eclipse.e4.ui.model.application.commands.impl.CommandsPackageImpl; >@@ -23,6 +25,7 @@ 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.IDialogSettings; > import org.eclipse.jface.dialogs.TitleAreaDialog; > import org.eclipse.jface.viewers.AbstractTreeViewer; > import org.eclipse.jface.viewers.ArrayContentProvider; >@@ -185,4 +188,9 @@ public abstract class AbstractCommandSelectionDialog extends TitleAreaDialog { > return s; > } > } >+ >+ @Override >+ protected IDialogSettings getDialogBoundsSettings() { >+ return ToolsEmfUiPlugin.getDefault().getDialogSettings(); >+ } > } >diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractIconDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractIconDialog.java >index 814e7f4..20ef632 100644 >--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractIconDialog.java >+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractIconDialog.java >@@ -7,6 +7,7 @@ > * > * Contributors: > * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation >+ * Marco Descher <marco@descher.at> - Bug395283 > ******************************************************************************/ > package org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs; > >@@ -28,12 +29,14 @@ import org.eclipse.core.resources.IResourceVisitor; > import org.eclipse.core.runtime.CoreException; > 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.ToolsEmfUiPlugin; > import org.eclipse.e4.ui.model.application.MApplicationElement; > import org.eclipse.emf.common.command.Command; > import org.eclipse.emf.ecore.EStructuralFeature; > import org.eclipse.emf.edit.command.SetCommand; > import org.eclipse.emf.edit.domain.EditingDomain; > import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; >+import org.eclipse.jface.dialogs.IDialogSettings; > import org.eclipse.jface.dialogs.TitleAreaDialog; > import org.eclipse.jface.viewers.DoubleClickEvent; > import org.eclipse.jface.viewers.IDoubleClickListener; >@@ -315,4 +318,9 @@ public abstract class AbstractIconDialog extends TitleAreaDialog { > } > } > } >+ >+ @Override >+ protected IDialogSettings getDialogBoundsSettings() { >+ return ToolsEmfUiPlugin.getDefault().getDialogSettings(); >+ } > } >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 cdb3a16..4a39981 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 >@@ -7,16 +7,17 @@ > * > * Contributors: > * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation >+ * Marco Descher <marco@descher.at> - Bug395283 > ******************************************************************************/ > package org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs; > >-import org.eclipse.e4.tools.emf.ui.internal.common.component.ControlFactory; >- > import java.util.ArrayList; > import java.util.List; > import org.eclipse.e4.tools.emf.ui.common.IModelResource; > import org.eclipse.e4.tools.emf.ui.internal.Messages; > import org.eclipse.e4.tools.emf.ui.internal.PatternFilter; >+import org.eclipse.e4.tools.emf.ui.internal.ToolsEmfUiPlugin; >+import org.eclipse.e4.tools.emf.ui.internal.common.component.ControlFactory; > import org.eclipse.e4.ui.model.application.commands.MCategory; > import org.eclipse.e4.ui.model.application.commands.MCommand; > import org.eclipse.e4.ui.model.application.commands.impl.CommandsPackageImpl; >@@ -25,6 +26,7 @@ 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.IDialogSettings; > import org.eclipse.jface.dialogs.TitleAreaDialog; > import org.eclipse.jface.viewers.AbstractTreeViewer; > import org.eclipse.jface.viewers.ArrayContentProvider; >@@ -40,8 +42,6 @@ import org.eclipse.jface.viewers.ViewerCell; > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.DisposeEvent; > import org.eclipse.swt.events.DisposeListener; >-import org.eclipse.swt.events.ModifyEvent; >-import org.eclipse.swt.events.ModifyListener; > import org.eclipse.swt.graphics.Image; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; >@@ -180,4 +180,9 @@ public class CommandCategorySelectionDialog extends TitleAreaDialog { > return s; > } > } >+ >+ @Override >+ protected IDialogSettings getDialogBoundsSettings() { >+ return ToolsEmfUiPlugin.getDefault().getDialogSettings(); >+ } > } >diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/ContributionClassDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/ContributionClassDialog.java >index 9cf6c11..8922653 100644 >--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/ContributionClassDialog.java >+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/ContributionClassDialog.java >@@ -8,6 +8,7 @@ > * Contributors: > * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation > * Lars Vogel <lars.vogel@gmail.com> - Enhancements >+ * Marco Descher <marco@descher.at> - Bug395283 > ******************************************************************************/ > package org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs; > >@@ -18,6 +19,7 @@ import org.eclipse.e4.tools.emf.ui.common.IClassContributionProvider.Contributio > import org.eclipse.e4.tools.emf.ui.common.IClassContributionProvider.ContributionResultHandler; > import org.eclipse.e4.tools.emf.ui.common.IClassContributionProvider.Filter; > import org.eclipse.e4.tools.emf.ui.internal.Messages; >+import org.eclipse.e4.tools.emf.ui.internal.ToolsEmfUiPlugin; > import org.eclipse.e4.tools.emf.ui.internal.common.ClassContributionCollector; > import org.eclipse.e4.ui.model.application.MApplicationElement; > import org.eclipse.emf.common.command.Command; >@@ -25,6 +27,7 @@ import org.eclipse.emf.ecore.EStructuralFeature; > import org.eclipse.emf.edit.command.SetCommand; > import org.eclipse.emf.edit.domain.EditingDomain; > import org.eclipse.jface.databinding.viewers.ObservableListContentProvider; >+import org.eclipse.jface.dialogs.IDialogSettings; > import org.eclipse.jface.dialogs.TitleAreaDialog; > import org.eclipse.jface.viewers.DoubleClickEvent; > import org.eclipse.jface.viewers.IDoubleClickListener; >@@ -224,4 +227,9 @@ public class ContributionClassDialog extends TitleAreaDialog { > } > > } >+ >+ @Override >+ protected IDialogSettings getDialogBoundsSettings() { >+ return ToolsEmfUiPlugin.getDefault().getDialogSettings(); >+ } > } >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 395283
:
224190
| 224280