提交 225be9b7 编写于 作者: S serge-rider

Vertical separators contribution


Former-commit-id: 3e5d76f5
上级 687cec02
......@@ -95,6 +95,7 @@ import org.jkiss.dbeaver.tools.transfer.wizard.DataTransferWizard;
import org.jkiss.dbeaver.ui.*;
import org.jkiss.dbeaver.ui.actions.datasource.DataSourceHandler;
import org.jkiss.dbeaver.ui.controls.CustomSashForm;
import org.jkiss.dbeaver.ui.controls.ToolbarSeparatorContribution;
import org.jkiss.dbeaver.ui.controls.resultset.*;
import org.jkiss.dbeaver.ui.dialogs.ActiveWizardDialog;
import org.jkiss.dbeaver.ui.dialogs.ConfirmationDialog;
......@@ -579,18 +580,24 @@ public class SQLEditor extends SQLEditorBase implements
sideToolBar = new ToolBarManager(SWT.VERTICAL);
sideToolBar.add(new Separator(TOOLBAR_GROUP_TOP));
//sideToolBar.add(new GroupMarker(TOOLBAR_GROUP_TOP));
sideToolBar.add(ActionUtils.makeCommandContribution(getSite(), CoreCommands.CMD_EXECUTE_STATEMENT));
sideToolBar.add(ActionUtils.makeCommandContribution(getSite(), CoreCommands.CMD_EXECUTE_STATEMENT_NEW));
sideToolBar.add(ActionUtils.makeCommandContribution(getSite(), CoreCommands.CMD_EXECUTE_SCRIPT));
sideToolBar.add(ActionUtils.makeCommandContribution(getSite(), CoreCommands.CMD_EXECUTE_SCRIPT_NEW));
sideToolBar.add(ActionUtils.makeCommandContribution(getSite(), CoreCommands.CMD_EXPLAIN_PLAN));
sideToolBar.add(new GroupMarker(TOOLBAR_GROUP_ADDITIONS));
sideToolBar.add(new Separator());
sideToolBar.add(new ToolbarSeparatorContribution(false));
sideToolBar.add(ActionUtils.makeCommandContribution(getSite(), CoreCommands.CMD_SQL_SHOW_OUTPUT, CommandContributionItem.STYLE_CHECK));
sideToolBar.add(ActionUtils.makeCommandContribution(getSite(), CoreCommands.CMD_SQL_SHOW_LOG, CommandContributionItem.STYLE_CHECK));
final IMenuService menuService = getSite().getService(IMenuService.class);
if (menuService != null) {
int prevSize = sideToolBar.getSize();
menuService.populateContributionManager(sideToolBar, TOOLBAR_CONTRIBUTION_ID);
if (prevSize != sideToolBar.getSize()) {
// Something was populated
sideToolBar.insertBefore(TOOLBAR_GROUP_ADDITIONS, new ToolbarSeparatorContribution(false));
}
}
sideToolBar.update(true);
......
......@@ -28,7 +28,8 @@ public class UIIcon {
public static final DBIcon DBEAVER_LOGO_SMALL = new DBIcon("dbeaver_logo_small", "dbeaver_logo_small.png"); //$NON-NLS-1$ //$NON-NLS-2$
public static final DBIcon DBEAVER_MARKETPLACE = new DBIcon("dbeaver_marketplace", "actions/marketplace.png"); //$NON-NLS-1$ //$NON-NLS-2$
public static final DBIcon DRAG_HANDLE = new DBIcon("dragHandle", "platform:/plugin/org.eclipse.platform/images/dragHandle.png");
public static final DBIcon SEPARATOR_V = new DBIcon("separator_v", "misc/separator_v.png"); //$NON-NLS-1$ //$NON-NLS-2$
public static final DBIcon SEPARATOR_H = new DBIcon("separator_h", "misc/separator_h.png"); //$NON-NLS-1$ //$NON-NLS-2$
public static final DBIcon LOADING1 = new DBIcon("loading1", "animation/loading1.gif"); //$NON-NLS-1$ //$NON-NLS-2$
public static final DBIcon LOADING2 = new DBIcon("loading2", "animation/loading2.gif"); //$NON-NLS-1$ //$NON-NLS-2$
......
......@@ -41,7 +41,6 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
......@@ -158,7 +157,7 @@ public class UIUtils {
public static void createToolBarSeparator(ToolBar toolBar, int style) {
Label label = new Label(toolBar, SWT.NONE);
label.setImage(DBeaverIcons.getImage(UIIcon.DRAG_HANDLE));
label.setImage(DBeaverIcons.getImage(UIIcon.SEPARATOR_V));
new ToolItem(toolBar, SWT.SEPARATOR).setControl(label);
}
......
......@@ -25,19 +25,22 @@ import org.jkiss.dbeaver.ui.DBeaverIcons;
import org.jkiss.dbeaver.ui.UIIcon;
/**
* ToolbarVerticalSeparator
* ToolbarSeparatorContribution
*/
public class ToolbarVerticalSeparator extends WorkbenchWindowControlContribution {
public ToolbarVerticalSeparator()
public class ToolbarSeparatorContribution extends WorkbenchWindowControlContribution {
private boolean vertical;
public ToolbarSeparatorContribution(boolean vertical)
{
super();
this.vertical = vertical;
}
@Override
protected Control createControl(Composite parent)
{
Label label = new Label(parent, SWT.NONE);
label.setImage(DBeaverIcons.getImage(UIIcon.DRAG_HANDLE));
label.setImage(DBeaverIcons.getImage(vertical ? UIIcon.SEPARATOR_V : UIIcon.SEPARATOR_H));
return label;
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册