提交 4cbccf49 编写于 作者: S Serge Rider 提交者: GitHub

Merge pull request #8589 from dbeaver/refactordb2#8562

#8562 DB2ServerApplicationEditor moved from ext.db2 to ext.db2.ui

Former-commit-id: cdcf267f
......@@ -12,7 +12,8 @@ Require-Bundle: org.eclipse.ui,
org.jkiss.dbeaver.ui.editors.acl,
org.jkiss.dbeaver.ui.editors.sql,
org.jkiss.dbeaver.tasks.ui,
org.jkiss.dbeaver.ext.db2
org.jkiss.dbeaver.ext.db2,
org.jkiss.dbeaver.ui.editors.session
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Vendor: %Bundle-Vendor
......
......@@ -9,6 +9,8 @@ dialog.connection.header=DB2 Connection Settings
editor.org.jkiss.dbeaver.ext.db2.model.app.DB2ServerApplicationEditor.name = Application Manager
editor.session_manager.name=Session Manager
editor.source.declaration.name=Source
editor.source.declaration.description=Source
editor.source.ddl.name=DDL
......
......@@ -5,6 +5,8 @@ category.db2.name = DB2
dialog.connection.header = DB2 Verbindungseinstellungen
editor.session_manager.name = Sitzungsmanager
editor.org.jkiss.dbeaver.ext.db2.model.app.DB2ServerApplicationEditor.name = Applikationsmanager
editor.source.ddl.description = DDL
editor.source.ddl.name = DDL
......
......@@ -15,6 +15,8 @@ tool.org.jkiss.dbeaver.ext.db2.showerror.name=R\u00E9cup\u00E9rer le message d'e
dialog.connection.header=Param\u00E8tres de connexion DB2
editor.session_manager.name=Gestionnaire de session
editor.source.declaration.name=Source
editor.source.declaration.description=Source
editor.source.ddl.name=DDL
......
......@@ -8,6 +8,8 @@ Bundle-Vendor = JKISS
dialog.connection.header = DB2 Configura\u00E7\u00F5es de conex\u00E3o
editor.session_manager.name = Ger\u00EAnciador de sess\u00E3o
editor.org.jkiss.dbeaver.ext.db2.model.app.DB2ServerApplicationEditor.name = Application Manager
editor.source.ddl.description = DDL
editor.source.ddl.name = DDL
......
......@@ -9,6 +9,8 @@ dialog.connection.header=DB2 Connection Settings
editor.org.jkiss.dbeaver.ext.db2.model.app.DB2ServerApplicationEditor.name = Application Manager
editor.session_manager.name=\u041c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0020\u0441\u0435\u0441\u0441\u0438\u0439
editor.source.ddl.name=DDL
editor.source.ddl.description=DDL
......
......@@ -153,15 +153,21 @@
</tools>
</extension>
<extension point="org.jkiss.dbeaver.dataSourceProvider">
<editorContribution editorId="org.jkiss.dbeaver.ext.db2.ui.editors.DB2ServerApplicationEditor" category="connectionEditor" label="%editor.session_manager.name" icon="platform:/plugin/org.jkiss.dbeaver.model/icons/tree/sessions.png">
<supports dataSource="db2"/>
</editorContribution>
</extension>
<extension point="org.eclipse.ui.editors">
<editor
name="%editor.org.jkiss.dbeaver.ext.db2.model.app.DB2ServerApplicationEditor.name"
name="%editor.org.jkiss.dbeaver.ext.db2.ui.editors.DB2ServerApplicationEditor.name"
icon="platform:/plugin/org.jkiss.dbeaver.ext.db2/icons/compile.png"
class="org.jkiss.dbeaver.ext.db2.model.app.DB2ServerApplicationEditor"
id="org.jkiss.dbeaver.ext.db2.model.app.DB2ServerApplicationEditor"
class="org.jkiss.dbeaver.ext.db2.ui.editors.DB2ServerApplicationEditor"
id="org.jkiss.dbeaver.ext.db2.ui.editors.DB2ServerApplicationEditor"
contributorClass="org.jkiss.dbeaver.ui.editors.EditorSearchActionsContributor">
</editor>
</extension>
</plugin>
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2013-2015 Denis Forveille (titou10.titou10@gmail.com)
* Copyright (C) 2010-2020 DBeaver Corp and others
*
* 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.db2.model.app;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IContributionManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
import org.jkiss.dbeaver.ext.db2.DB2Messages;
import org.jkiss.dbeaver.ext.db2.model.DB2DataSource;
import org.jkiss.dbeaver.model.admin.sessions.DBAServerSession;
import org.jkiss.dbeaver.model.admin.sessions.DBAServerSessionManager;
import org.jkiss.dbeaver.model.exec.DBCExecutionContext;
import org.jkiss.dbeaver.ui.DBeaverIcons;
import org.jkiss.dbeaver.ui.UIIcon;
import org.jkiss.dbeaver.ui.UIUtils;
import org.jkiss.dbeaver.ui.views.session.AbstractSessionEditor;
import org.jkiss.dbeaver.ui.views.session.SessionManagerViewer;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* DB2 Application Editor
*
* @author Denis Forveille
*/
public class DB2ServerApplicationEditor extends AbstractSessionEditor {
private ForceApplicationAction forceApplicationAction;
@Override
public void createEditorControl(Composite parent)
{
forceApplicationAction = new ForceApplicationAction();
super.createEditorControl(parent);
}
@Override
protected SessionManagerViewer createSessionViewer(DBCExecutionContext executionContext, Composite parent) {
return new SessionManagerViewer<DB2ServerApplication>(this, parent, new DB2ServerApplicationManager((DB2DataSource) executionContext.getDataSource())) {
@Override
@SuppressWarnings("rawtypes")
protected void contributeToToolbar(DBAServerSessionManager sessionManager, IContributionManager contributionManager)
{
contributionManager.add(forceApplicationAction);
contributionManager.add(new Separator());
}
@Override
protected void onSessionSelect(DBAServerSession session)
{
super.onSessionSelect(session);
forceApplicationAction.setEnabled(session != null);
}
};
}
private class ForceApplicationAction extends Action {
public ForceApplicationAction()
{
super(DB2Messages.editors_db2_application_editor_title_force_application, DBeaverIcons.getImageDescriptor(UIIcon.REJECT));
}
@Override
public void run()
{
final List<DBAServerSession> sessions = getSessionsViewer().getSelectedSessions();
final String action = DB2Messages.editors_db2_application_editor_action_force;
if (UIUtils.confirmAction(getSite().getShell(), "Confirm force application",
NLS.bind(DB2Messages.editors_db2_application_editor_confirm_action, action.toLowerCase(), sessions))) {
Map<String, Object> options = new HashMap<>();
getSessionsViewer().alterSessions(sessions, options);
}
}
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2013-2015 Denis Forveille (titou10.titou10@gmail.com)
* Copyright (C) 2010-2020 DBeaver Corp and others
*
* 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.db2.ui.editors;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IContributionManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
import org.jkiss.dbeaver.ext.db2.ui.internal.DB2Messages;
import org.jkiss.dbeaver.ext.db2.model.DB2DataSource;
import org.jkiss.dbeaver.ext.db2.model.app.DB2ServerApplication;
import org.jkiss.dbeaver.ext.db2.model.app.DB2ServerApplicationManager;
import org.jkiss.dbeaver.model.admin.sessions.DBAServerSession;
import org.jkiss.dbeaver.model.admin.sessions.DBAServerSessionManager;
import org.jkiss.dbeaver.model.exec.DBCExecutionContext;
import org.jkiss.dbeaver.ui.DBeaverIcons;
import org.jkiss.dbeaver.ui.UIIcon;
import org.jkiss.dbeaver.ui.UIUtils;
import org.jkiss.dbeaver.ui.views.session.AbstractSessionEditor;
import org.jkiss.dbeaver.ui.views.session.SessionManagerViewer;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* DB2 Application Editor
*
* @author Denis Forveille
*/
public class DB2ServerApplicationEditor extends AbstractSessionEditor {
private ForceApplicationAction forceApplicationAction;
@Override
public void createEditorControl(Composite parent)
{
forceApplicationAction = new ForceApplicationAction();
super.createEditorControl(parent);
}
@Override
protected SessionManagerViewer createSessionViewer(DBCExecutionContext executionContext, Composite parent) {
return new SessionManagerViewer<DB2ServerApplication>(this, parent, new DB2ServerApplicationManager((DB2DataSource) executionContext.getDataSource())) {
@Override
@SuppressWarnings("rawtypes")
protected void contributeToToolbar(DBAServerSessionManager sessionManager, IContributionManager contributionManager)
{
contributionManager.add(forceApplicationAction);
contributionManager.add(new Separator());
}
@Override
protected void onSessionSelect(DBAServerSession session)
{
super.onSessionSelect(session);
forceApplicationAction.setEnabled(session != null);
}
};
}
private class ForceApplicationAction extends Action {
public ForceApplicationAction()
{
super(DB2Messages.editors_db2_application_editor_title_force_application, DBeaverIcons.getImageDescriptor(UIIcon.REJECT));
}
@Override
public void run()
{
final List<DBAServerSession> sessions = getSessionsViewer().getSelectedSessions();
final String action = DB2Messages.editors_db2_application_editor_action_force;
if (UIUtils.confirmAction(getSite().getShell(), "Confirm force application",
NLS.bind(DB2Messages.editors_db2_application_editor_confirm_action, action.toLowerCase(), sessions))) {
Map<String, Object> options = new HashMap<>();
getSessionsViewer().alterSessions(sessions, options);
}
}
}
}
\ No newline at end of file
......@@ -119,5 +119,9 @@ public class DB2Messages extends NLS {
public static String edit_db2_constraint_manager_dialog_title;
public static String edit_db2_foreign_key_manager_dialog_title;
public static String edit_db2_index_manager_dialog_title;
public static String editors_db2_application_editor_title_force_application;
public static String editors_db2_application_editor_action_force;
public static String editors_db2_application_editor_confirm_action;
}
......@@ -86,3 +86,7 @@ dialog_tools_mes_message=SQL Message
edit_db2_constraint_manager_dialog_title=Create constraint
edit_db2_foreign_key_manager_dialog_title=Create foreign key
edit_db2_index_manager_dialog_title=Create index
editors_db2_application_editor_title_force_application=Force Application
editors_db2_application_editor_action_force=Force
editors_db2_application_editor_confirm_action=Are you sure you want to "force" application "{1}"?
......@@ -64,4 +64,8 @@ dialog_tools_msg_title = Abrufen der SQL-Nachricht aus dem SQL-Code
edit_db2_constraint_manager_dialog_title = Einschr\u00E4nkung erstellen
edit_db2_foreign_key_manager_dialog_title = Fremdschl\u00FCssel erstellen
edit_db2_index_manager_dialog_title = Index erstellen
\ No newline at end of file
edit_db2_index_manager_dialog_title = Index erstellen
editors_db2_application_editor_action_force = Erzwingen
editors_db2_application_editor_confirm_action = Sind Sie sicher, dass Sie die Anwendung "{1}" "erzwingen" wollen?
editors_db2_application_editor_title_force_application = Erzwingen der Anwendung
\ No newline at end of file
......@@ -79,3 +79,7 @@ dialog_table_tools_truncate_triggers_restrict=Restrict When Delete Triggers
edit_db2_foreign_key_manager_dialog_title=\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0432\u043D\u0435\u0448\u043D\u0438\u0439 \u043A\u043B\u044E\u0447
edit_db2_index_manager_dialog_title=\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0438\u043D\u0434\u0435\u043A\u0441
editors_db2_application_editor_title_force_application=\u041F\u0440\u0435\u0440\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E
editors_db2_application_editor_action_force=\u041F\u0440\u0435\u0440\u0432\u0430\u0442\u044C
editors_db2_application_editor_confirm_action=\u0412\u044B \u0443\u0432\u0435\u0440\u0435\u043D\u044B, \u0447\u0442\u043E \u0445\u043E\u0442\u0438\u0442\u0435 \u043F\u0440\u0435\u0440\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E "{1}"?
......@@ -258,17 +258,9 @@
<items label="%tree.storagegroup.node.name" path="storageGroup" property="storageGroups" icon="icons/storage_group.gif"/>
</folder>
</folder>
<folder type=""
label="%tree.administer.node.name"
icon="#folder_admin"
description="Maintenance/Settings"
visibleIf="object.dataSource.authorisedForAdminister">
<object type="org.jkiss.dbeaver.ext.db2.model.app.DB2ServerApplication"
label="%tree.applications.node.name"
icon="#admin"
description="Server application manager"
editor="org.jkiss.dbeaver.ext.db2.model.app.DB2ServerApplicationEditor"
visibleIf="object.dataSource.authorisedForApplications"/>
<folder type="" label="%tree.administer.node.name" icon="#folder_admin" description="Maintenance/Settings">
<treeContribution category="connectionEditor"/>
</folder>
<folder type="org.jkiss.dbeaver.ext.db2.info.DB2Parameter"
label="%tree.dbparameters.node.name"
icon="icons/parameter_db.gif"
......@@ -282,8 +274,7 @@
description="Database Manager Configuration"
visibleIf="object.dataSource.authorisedForDBCFG">
<items label="%tree.parameter.node.name" path="parameter" property="dbmParameters" icon="icons/parameter_db.gif" navigable="false" virtual="true"/>
</folder>
</folder>
</folder>
<!--
DF: Exclusion of the whole Security folder because:
......
editors_db2_application_editor_title_force_application=Force Application
editors_db2_application_editor_action_force=Force
editors_db2_application_editor_confirm_action=Are you sure you want to "force" application "{1}"?
dialog_explain_choose_tablespace=Choose a Tablespace
dialog_explain_choose_tablespace_tablespace=Tablespace
dialog_explain_no_tables=Explain tables missing
......
......@@ -7,10 +7,6 @@ dialog_explain_no_tables_found_ex = EXPLAIN-Tabellen nicht gefunden. Die Abfrage
dialog_explain_no_tablespace_found = Es wurde kein verwendbarer Tablespace gefunden, um Explain-Tabellen zu erstellen.
dialog_explain_no_tablespace_found_title = Kein Tablespace
editors_db2_application_editor_action_force = Erzwingen
editors_db2_application_editor_confirm_action = Sind Sie sicher, dass Sie die Anwendung "{1}" "erzwingen" wollen?
editors_db2_application_editor_title_force_application = Erzwingen der Anwendung
no_ddl_for_nicknames = -- DDL ist f\u00FCr Nicknames nicht verf\u00FCgbar.
no_ddl_for_nonsql_routines = -- DDL ist nicht verf\u00FCgbar f\u00FCr nicht-SQL-basierte Routinen.
no_ddl_for_spaces_in_name = -- DDL ist nicht verf\u00FCgbar f\u00FCr Objekte, die einen Whitespace in ihrem Namen oder Schema haben.
......
editors_db2_application_editor_title_force_application=Force Application
editors_db2_application_editor_action_force=Force
editors_db2_application_editor_confirm_action=Are you sure you want to "force" application "{1}"?
dialog_explain_choose_tablespace=Choose a Tablespace
dialog_explain_choose_tablespace_tablespace=Tablespace
dialog_explain_no_tables=Explain tables missing
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册