Skip to content
Permalink
Browse files
HOP-2027 : Fix button positions in dialogs (DB Explorer)
  • Loading branch information
mattcasters committed Jun 2, 2021
1 parent 9e5e94b commit 8ea4257f0e7b222f62d812c7a1b04abb807322c4
Showing 1 changed file with 12 additions and 8 deletions.
@@ -64,7 +64,6 @@
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;

@@ -131,6 +130,9 @@ public class DatabaseExplorerDialog extends Dialog {
private String activeSchemaTable;
private Button bTruncate;

private ToolBar toolBar;
private GuiToolbarWidgets toolBarWidgets;

public DatabaseExplorerDialog(
Shell parent,
int style,
@@ -215,13 +217,13 @@ public boolean open() {

// Add a toolbar
//
ToolBar toolBar = new ToolBar(shell, SWT.WRAP | SWT.LEFT | SWT.HORIZONTAL);
GuiToolbarWidgets toolBarWidgets = new GuiToolbarWidgets();
toolBar = new ToolBar(shell, SWT.WRAP | SWT.LEFT | SWT.HORIZONTAL);
toolBarWidgets = new GuiToolbarWidgets();
toolBarWidgets.registerGuiPluginObject(this);
toolBarWidgets.createToolbarWidgets(toolBar, GUI_PLUGIN_TOOLBAR_PARENT_ID);
FormData layoutData = new FormData();
layoutData.left = new FormAttachment(0, 0);
layoutData.top = new FormAttachment(0, 0);
layoutData.left = new FormAttachment(0, 0);
layoutData.right = new FormAttachment(100, 0);
toolBar.setLayoutData(layoutData);
toolBar.pack();
@@ -235,7 +237,7 @@ public boolean open() {
props.setLook(wTree);
FormData fdTree = new FormData();
fdTree.left = new FormAttachment(0, 0); // To the right of the label
fdTree.top = new FormAttachment(0, toolBar.getBounds().height);
fdTree.top = new FormAttachment(toolBar, margin);
fdTree.right = new FormAttachment(buttonsComposite, -margin);
fdTree.bottom = new FormAttachment(wOk, -2 * margin);
wTree.setLayoutData(fdTree);
@@ -418,15 +420,16 @@ public void widgetSelected(SelectionEvent e) {

FormData fdComposite = new FormData();
fdComposite.right = new FormAttachment(100, 0);
fdComposite.top = new FormAttachment(0, 20);
fdComposite.top = new FormAttachment(0, toolBar.getBounds().height);
buttonsComposite.setLayoutData(fdComposite);
}

@GuiToolbarElement(
root = GUI_PLUGIN_TOOLBAR_PARENT_ID,
id = TOOLBAR_ITEM_EXPAND_ALL,
toolTip = "i18n::DatabaseExplorerDialog.Toolbar.ExpandAll.Tooltip",
type = GuiToolbarElementType.BUTTON)
type = GuiToolbarElementType.BUTTON,
image = "ui/images/expand-all.svg")
public void expandAll() {
expandAllItems(wTree.getItems(), true);
}
@@ -435,7 +438,8 @@ public void expandAll() {
root = GUI_PLUGIN_TOOLBAR_PARENT_ID,
id = TOOLBAR_ITEM_COLLAPSE_ALL,
toolTip = "i18n::DatabaseExplorerDialog.Toolbar.CollapseAll.Tooltip",
type = GuiToolbarElementType.BUTTON)
type = GuiToolbarElementType.BUTTON,
image = "ui/images/collapse-all.svg")
public void collapseAll() {
expandAllItems(wTree.getItems(), false);
}

0 comments on commit 8ea4257

Please sign in to comment.