提交 a757d621 编写于 作者: S Serge Rider

Navigator prop tester refactoring

上级 fde73191
......@@ -320,11 +320,6 @@
</extension>
<extension point="org.eclipse.core.expressions.definitions">
<definition id="org.jkiss.dbeaver.core.ui.navigator.control">
<with variable="activeFocusControlId">
<equals value="org.jkiss.dbeaver.ui.navigator"/>
</with>
</definition>
<definition id="org.jkiss.dbeaver.core.ui.querylog.control">
<with variable="activeFocusControlId">
<equals value="org.jkiss.dbeaver.ui.qm.log"/>
......@@ -351,17 +346,6 @@
<instanceof value="org.jkiss.dbeaver.ui.views.qm.QueryManagerView"/>
</with>
</definition>
<definition id="org.jkiss.dbeaver.core.ui.navigator.part">
<with variable="activePart">
<!--<instanceof value="org.jkiss.dbeaver.ui.navigator.INavigatorModelView"/>-->
<test property="org.jkiss.dbeaver.core.navigator.active" forcePluginActivation="true"/>
</with>
</definition>
<definition id="org.jkiss.dbeaver.core.ui.navigator.part.active">
<with variable="activePart">
<test property="org.jkiss.dbeaver.core.navigator.focused" forcePluginActivation="true"/>
</with>
</definition>
<definition id="org.jkiss.dbeaver.core.ui.datasource.part">
<with variable="activePart">
<instanceof value="org.jkiss.dbeaver.model.DBPContextProvider"/>
......@@ -372,11 +356,6 @@
<instanceof value="org.jkiss.dbeaver.model.DBPContextProvider"/>
</with>
</definition>
<definition id="org.jkiss.dbeaver.core.ui.folder.editor">
<with variable="activeEditor">
<instanceof value="org.jkiss.dbeaver.ui.editors.entity.FolderEditor"/>
</with>
</definition>
<definition id="org.jkiss.dbeaver.core.ui.sql.editor.base">
<with variable="activeEditor">
<instanceof value="org.jkiss.dbeaver.ui.editors.sql.SQLEditorBase"/>
......@@ -533,15 +512,15 @@
</enabledWhen>
</handler>
<handler commandId="org.jkiss.dbeaver.core.driver.manager" class="org.jkiss.dbeaver.ui.actions.NavigatorHandlerDriverManager"/>
<handler commandId="org.jkiss.dbeaver.core.new.connection" class="org.jkiss.dbeaver.ui.actions.NavigatorHandlerConnectionCreate">
<handler commandId="org.jkiss.dbeaver.core.driver.manager" class="org.jkiss.dbeaver.ui.actions.datasource.DriverManagerDialogHandler"/>
<handler commandId="org.jkiss.dbeaver.core.new.connection" class="org.jkiss.dbeaver.ui.actions.datasource.DataSourceCreateHandler">
<enabledWhen>
<with variable="activePart">
<test property="org.jkiss.dbeaver.core.global.hasActiveProject"/>
</with>
</enabledWhen>
</handler>
<handler commandId="org.jkiss.dbeaver.core.migrate.connection" class="org.jkiss.dbeaver.ui.actions.NavigatorHandlerConnectionMigrate"/>
<handler commandId="org.jkiss.dbeaver.core.migrate.connection" class="org.jkiss.dbeaver.ui.actions.datasource.DataSourceMigrateHandler"/>
<handler commandId="org.jkiss.dbeaver.core.new.folder" class="org.jkiss.dbeaver.ui.navigator.actions.NavigatorHandlerLocalFolderCreate">
<enabledWhen>
<with variable="selection">
......@@ -589,7 +568,7 @@
</with>
</enabledWhen>
</handler>
<handler commandId="org.jkiss.dbeaver.core.navigator.bookmark.add" class="org.jkiss.dbeaver.ui.actions.NavigatorHandlerAddBookmark">
<handler commandId="org.jkiss.dbeaver.core.navigator.bookmark.add" class="org.jkiss.dbeaver.ui.actions.AddBookmarkHandler">
<enabledWhen>
<with variable="selection">
<count value="1"/>
......
......@@ -42,7 +42,7 @@ import org.jkiss.dbeaver.ui.navigator.actions.NavigatorHandlerObjectBase;
import org.jkiss.dbeaver.ui.navigator.database.DatabaseNavigatorTree;
import org.jkiss.dbeaver.ui.resources.bookmarks.BookmarksHandlerImpl;
public class NavigatorHandlerAddBookmark extends NavigatorHandlerObjectBase {
public class AddBookmarkHandler extends NavigatorHandlerObjectBase {
private IFolder targetFolder;
......
......@@ -31,13 +31,13 @@ import org.jkiss.dbeaver.ui.navigator.NavigatorUtils;
import java.util.Collection;
import java.util.List;
public class NavigatorActionExecuteTool implements IActionDelegate
public class ExecuteToolHandler implements IActionDelegate
{
private IWorkbenchWindow window;
private ToolDescriptor tool;
private ISelection selection;
public NavigatorActionExecuteTool(IWorkbenchWindow window, ToolDescriptor tool)
public ExecuteToolHandler(IWorkbenchWindow window, ToolDescriptor tool)
{
this.window = window;
this.tool = tool;
......
......@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.ui.actions;
package org.jkiss.dbeaver.ui.actions.datasource;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
......@@ -24,7 +24,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
import org.jkiss.dbeaver.ui.dialogs.connection.CreateConnectionDialog;
import org.jkiss.dbeaver.ui.dialogs.connection.NewConnectionWizard;
public class NavigatorHandlerConnectionCreate extends AbstractHandler {
public class DataSourceCreateHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
......
......@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.ui.actions;
package org.jkiss.dbeaver.ui.actions.datasource;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
......@@ -27,7 +27,7 @@ import org.jkiss.dbeaver.runtime.DBWorkbench;
import org.jkiss.dbeaver.ui.dialogs.ActiveWizardDialog;
import org.jkiss.dbeaver.ui.dialogs.connection.MigrateConnectionWizard;
public class NavigatorHandlerConnectionMigrate extends AbstractHandler {
public class DataSourceMigrateHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
......
......@@ -34,7 +34,7 @@ import org.jkiss.dbeaver.ui.ActionUtils;
import org.jkiss.dbeaver.ui.DBeaverIcons;
import org.jkiss.dbeaver.ui.UIUtils;
import org.jkiss.dbeaver.ui.actions.common.EmptyListAction;
import org.jkiss.dbeaver.ui.actions.NavigatorActionExecuteTool;
import org.jkiss.dbeaver.ui.actions.ExecuteToolHandler;
import org.jkiss.dbeaver.ui.editors.DatabaseEditorInput;
import org.jkiss.dbeaver.ui.editors.IDatabaseEditorInput;
import org.jkiss.dbeaver.ui.navigator.NavigatorUtils;
......@@ -141,7 +141,7 @@ public class DataSourceToolsContributor extends DataSourceMenuContributor
}
IAction action = ActionUtils.makeAction(
new NavigatorActionExecuteTool(workbenchWindow, tool),
new ExecuteToolHandler(workbenchWindow, tool),
activePart.getSite(),
selection,
tool.getLabel(),
......
......@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.ui.actions;
package org.jkiss.dbeaver.ui.actions.datasource;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
......@@ -22,7 +22,7 @@ import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.handlers.HandlerUtil;
import org.jkiss.dbeaver.ui.dialogs.driver.DriverManagerDialog;
public class NavigatorHandlerDriverManager extends AbstractHandler {
public class DriverManagerDialogHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
......
......@@ -5,15 +5,6 @@
<extension-point id="org.jkiss.dbeaver.databaseEditor" name="%extension-point.org.jkiss.dbeaver.databaseEditor.name" schema="schema/org.jkiss.dbeaver.databaseEditor.exsd"/>
<extension point="org.eclipse.core.expressions.propertyTesters">
<propertyTester
class="org.jkiss.dbeaver.ui.navigator.NavigatorPropertyTester"
id="org.jkiss.dbeaver.ui.navigator.NavigatorPropertyTester"
namespace="org.jkiss.dbeaver.core.navigator"
properties="active,focused"
type="org.eclipse.ui.IWorkbenchPart"/>
</extension>
<extension point="org.eclipse.core.runtime.adapters">
<factory adaptableType="org.jkiss.dbeaver.model.DBPObject" class="org.jkiss.dbeaver.ui.navigator.NavigatorAdapterFactory">
<adapter type="org.jkiss.dbeaver.model.DBPNamedObject"/>
......@@ -132,4 +123,37 @@
</editor>
</extension>
<extension point="org.eclipse.core.expressions.propertyTesters">
<propertyTester
class="org.jkiss.dbeaver.ui.navigator.NavigatorPropertyTester"
id="org.jkiss.dbeaver.ui.navigator.NavigatorPropertyTester"
namespace="org.jkiss.dbeaver.core.navigator"
properties="active,focused"
type="org.eclipse.ui.IWorkbenchPart"/>
</extension>
<extension point="org.eclipse.core.expressions.definitions">
<definition id="org.jkiss.dbeaver.core.ui.navigator.control">
<with variable="activeFocusControlId">
<equals value="org.jkiss.dbeaver.ui.navigator"/>
</with>
</definition>
<definition id="org.jkiss.dbeaver.core.ui.navigator.part">
<with variable="activePart">
<!--<instanceof value="org.jkiss.dbeaver.ui.navigator.INavigatorModelView"/>-->
<test property="org.jkiss.dbeaver.core.navigator.active" forcePluginActivation="true"/>
</with>
</definition>
<definition id="org.jkiss.dbeaver.core.ui.navigator.part.active">
<with variable="activePart">
<test property="org.jkiss.dbeaver.core.navigator.focused" forcePluginActivation="true"/>
</with>
</definition>
<definition id="org.jkiss.dbeaver.core.ui.folder.editor">
<with variable="activeEditor">
<instanceof value="org.jkiss.dbeaver.ui.editors.entity.FolderEditor"/>
</with>
</definition>
</extension>
</plugin>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册