提交 b9b847d7 编写于 作者: A Alexander Fedorov

#2556 remove duplicated "Debug As" menu

Former-commit-id: ea8e2020
上级 20ddcf2f
......@@ -19,15 +19,6 @@
-->
<plugin>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
class="org.jkiss.dbeaver.debug.internal.ui.DebugContributionFactory"
locationURI="popup:org.eclipse.ui.popup.any?before=additions">
</menuContribution>
</extension>
<extension
point="org.eclipse.core.runtime.adapters">
<factory
......@@ -37,6 +28,13 @@
type="org.eclipse.debug.ui.actions.IToggleBreakpointsTarget">
</adapter>
</factory>
<factory
adaptableType="org.jkiss.dbeaver.ui.editors.entity.EntityEditorInput"
class="org.jkiss.dbeaver.debug.internal.ui.actions.DebugActionAdapterFactory">
<adapter
type="org.eclipse.debug.ui.actions.ILaunchable">
</adapter>
</factory>
</extension>
<extension
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2017 Alexander Fedorov (alexander.fedorov@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.debug.internal.ui;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.jkiss.dbeaver.debug.ui.LaunchContributionFactory;
import org.jkiss.dbeaver.debug.ui.LaunchContributionItem;
import org.jkiss.dbeaver.debug.ui.DebugUi;
public class DebugContributionFactory extends LaunchContributionFactory {
public DebugContributionFactory() {
super(DebugUi.DEBUG_AS_MENU_ID);
setText(DebugUiMessages.DebugContributionFactory_text);
setImageDescriptor(DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_ACT_DEBUG));
}
@Override
protected LaunchContributionItem createContributionItem()
{
return new DebugContributionItem();
}
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2017 Alexander Fedorov (alexander.fedorov@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.debug.internal.ui;
import org.eclipse.debug.core.ILaunchManager;
import org.jkiss.dbeaver.debug.ui.LaunchContributionItem;
public class DebugContributionItem extends LaunchContributionItem {
protected DebugContributionItem()
{
super(ILaunchManager.DEBUG_MODE);
}
}
......@@ -28,7 +28,7 @@ public class DebugUiMessages extends NLS {
public static String DatabaseTab_datasource_group_text;
public static String DatabaseTab_datasource_label_text;
public static String DatabaseTab_name;
public static String DebugContributionFactory_text;
public static String LaunchShortcut_e_launch;
public static String LaunchShortcut_select_cobfiguration_title;
static {
......
DatabaseStandardBreakpointPane_name=Breakpoint Settings
# DBeaver - Universal Database Manager
# Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
# Copyright (C) 2017 Alexander Fedorov (alexander.fedorov@jkiss.org)
......@@ -15,12 +14,13 @@ DatabaseStandardBreakpointPane_name=Breakpoint Settings
# See the License for the specific language governing permissions and
# limitations under the License.
DatabaseStandardBreakpointPane_name=Breakpoint Settings
DatabaseStandardBreakpointPane_description=Breakpoint settings
DatabaseTab_database_group_text=Database
DatabaseTab_database_label_text=Database
DatabaseTab_datasource_group_text=Connection
DatabaseTab_datasource_label_text=Connection
DatabaseTab_name=&Main
DebugContributionFactory_text=Debug As
LaunchShortcut_e_launch=Launch error
LaunchShortcut_select_cobfiguration_title=&Select existing configuration:
package org.jkiss.dbeaver.debug.internal.ui.actions;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.debug.ui.actions.ILaunchable;
import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
import org.jkiss.dbeaver.debug.ui.actions.ToggleSqlBreakpointTarget;
public class DebugActionAdapterFactory implements IAdapterFactory {
private static final Class<?>[] CLASSES = new Class[]{IToggleBreakpointsTarget.class};
private static final Class<?>[] CLASSES = new Class[] { ILaunchable.class, IToggleBreakpointsTarget.class };
private static final ILaunchable LAUNCHABLE = new ILaunchable() {
};
private final IToggleBreakpointsTarget toggleBreakpointTarget = new ToggleSqlBreakpointTarget();
......@@ -14,6 +18,9 @@ public class DebugActionAdapterFactory implements IAdapterFactory {
@SuppressWarnings("unchecked")
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType)
{
if (adapterType == ILaunchable.class) {
return (T) LAUNCHABLE;
}
if (adapterType == IToggleBreakpointsTarget.class) {
return (T) toggleBreakpointTarget;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册