提交 46a8015b 编写于 作者: S Serge Rider

#4529 Mock data wizard fix

上级 e6137cf4
......@@ -18,8 +18,6 @@ package org.jkiss.dbeaver.tools.transfer.internal;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.jkiss.dbeaver.runtime.DBeaverNotifications;
import org.jkiss.dbeaver.ui.notifications.NotificationUtils;
import org.osgi.framework.BundleContext;
public class DTActivator extends AbstractUIPlugin {
......@@ -36,8 +34,6 @@ public class DTActivator extends AbstractUIPlugin {
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
// Set notifications handler
DBeaverNotifications.setHandler(NotificationUtils::sendNotification);
plugin = this;
}
......
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-SymbolicName: org.jkiss.dbeaver.ext.mockdata;singleton:=true
Bundle-Version: 1.0.25.qualifier
Bundle-Release-Date: 20181224
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Activator: org.jkiss.dbeaver.ext.mockdata.internal.MDActivator
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.ui.views,
......@@ -12,10 +17,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.ui.workbench.texteditor,
org.jkiss.dbeaver.core,
org.jkiss.utils
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Vendor: %Bundle-Vendor
Bundle-ClassPath: .
Export-Package: org.jkiss.dbeaver.ext.mockdata,
org.jkiss.dbeaver.ext.mockdata.generator,
org.jkiss.dbeaver.ext.mockdata.model
......@@ -17,7 +17,6 @@
*/
package org.jkiss.dbeaver.ext.mockdata;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.osgi.util.NLS;
......@@ -26,6 +25,7 @@ import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.IWorkbench;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.ext.mockdata.internal.MDActivator;
import org.jkiss.dbeaver.ext.mockdata.model.MockGeneratorDescriptor;
import org.jkiss.dbeaver.ext.mockdata.model.MockValueGenerator;
import org.jkiss.dbeaver.model.DBUtils;
......@@ -50,7 +50,7 @@ public class MockDataExecuteWizard extends AbstractToolWizard<DBSDataManipulato
public static final boolean JUST_GENERATE_SCRIPT = false;
private static final String RS_EXPORT_WIZARD_DIALOG_SETTINGS = "MockData"; //$NON-NLS-1$
private static final String WIZARD_DIALOG_SETTINGS = "MockData"; //$NON-NLS-1$
private MockDataWizardPageSettings settingsPage;
private MockDataSettings mockDataSettings;
......@@ -59,6 +59,11 @@ public class MockDataExecuteWizard extends AbstractToolWizard<DBSDataManipulato
super(dbObjects, task);
this.nativeClientHomeRequired = false;
this.mockDataSettings = mockDataSettings;
setDialogSettings(
UIUtils.getSettingsSection(
MDActivator.getDefault().getDialogSettings(),
WIZARD_DIALOG_SETTINGS));
}
@Override
......@@ -71,10 +76,7 @@ public class MockDataExecuteWizard extends AbstractToolWizard<DBSDataManipulato
}
void loadSettings() {
IDialogSettings section = UIUtils.getDialogSettings(RS_EXPORT_WIZARD_DIALOG_SETTINGS);
setDialogSettings(section);
mockDataSettings.loadFrom(section);
mockDataSettings.loadFrom(getDialogSettings());
}
@Override
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.ext.mockdata.internal;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
public class MDActivator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.jkiss.dbeaver.ext.mockdata";
// The shared instance
private static MDActivator plugin;
public MDActivator() {
}
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
public static MDActivator getDefault() {
return plugin;
}
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
public void saveDialogSettings() {
super.saveDialogSettings();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册