diff --git a/features/org.jkiss.dbeaver.core/feature.xml b/features/org.jkiss.dbeaver.core/feature.xml index db786a80b6e5a917d7ee2da2f04125213e23f35e..ec3523599cda14e23730698b66210e085aa0d35c 100644 --- a/features/org.jkiss.dbeaver.core/feature.xml +++ b/features/org.jkiss.dbeaver.core/feature.xml @@ -25,7 +25,6 @@ - diff --git a/features/org.jkiss.dbeaver.rcp/feature.xml b/features/org.jkiss.dbeaver.rcp/feature.xml index f6275503dc66b6a741acdd3df08f9239d620001f..5db557e492ed625587695e61fbfec75f6076d417 100644 --- a/features/org.jkiss.dbeaver.rcp/feature.xml +++ b/features/org.jkiss.dbeaver.rcp/feature.xml @@ -2,7 +2,7 @@ + version="2.0.2"> Feature for standalone DBeaver RCP @@ -663,13 +663,6 @@ version="0.0.0" unpack="false"/> - - - diff --git a/features/org.jkiss.dbeaver.standalone/feature.xml b/features/org.jkiss.dbeaver.standalone/feature.xml index 6726c30e05015259114aa7912cc1329e28984c78..f39c9836ca1b00f65e396d65fe473654bed3bb75 100644 --- a/features/org.jkiss.dbeaver.standalone/feature.xml +++ b/features/org.jkiss.dbeaver.standalone/feature.xml @@ -57,7 +57,6 @@ - diff --git a/plugins/org.jkiss.dbeaver.core/META-INF/MANIFEST.MF b/plugins/org.jkiss.dbeaver.core/META-INF/MANIFEST.MF index 3d5ba756c692e0067feb2138a10dc47b51f42250..b6e2cef88282bdb21ec97ff88f52991a5cbe98e4 100644 --- a/plugins/org.jkiss.dbeaver.core/META-INF/MANIFEST.MF +++ b/plugins/org.jkiss.dbeaver.core/META-INF/MANIFEST.MF @@ -119,9 +119,9 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.resources, org.eclipse.core.expressions, org.eclipse.ui, + org.eclipse.ui.views, org.eclipse.ui.workbench, org.eclipse.ui.workbench.texteditor, - org.eclipse.ui.views.properties.tabbed, org.eclipse.swt, org.eclipse.jface, org.eclipse.jface.text, diff --git a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderComposite.java b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderComposite.java index ebdd69a82228df30e1cb53054ccd81ca4707a0b6..ebd1290532d8c4291b908fc6065aa830c99d1669 100644 --- a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderComposite.java +++ b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderComposite.java @@ -40,7 +40,6 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -import org.jkiss.dbeaver.ui.UIUtils; import java.util.ArrayList; import java.util.HashMap; @@ -56,7 +55,7 @@ public class FolderComposite extends Composite implements IFolderContainer { private final FolderList folderList; private final Composite pane; - private final Map contentsMap = new HashMap(); + private final Map contentsMap = new HashMap(); private IFolder curFolder; private Control curContent; private List listeners = new ArrayList(); @@ -84,21 +83,21 @@ public class FolderComposite extends Composite implements IFolderContainer { folderList.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - onFolderSwitch(folderList.getElementAt(folderList.getSelectionIndex()).getTabItem()); + onFolderSwitch(folderList.getElementAt(folderList.getSelectionIndex()).getInfo()); } }); addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent e) { - for (IFolderDescription folderDescription : contentsMap.keySet()) { + for (FolderInfo folderDescription : contentsMap.keySet()) { folderDescription.getContents().dispose(); } } }); } - private void onFolderSwitch(IFolderDescription folder) { + private void onFolderSwitch(FolderInfo folder) { Composite newContent = contentsMap.get(folder); IFolder newFolder = folder.getContents(); if (newContent == null) { @@ -126,7 +125,7 @@ public class FolderComposite extends Composite implements IFolderContainer { } } - public void setFolders(IFolderDescription[] folders) { + public void setFolders(FolderInfo[] folders) { boolean firstTime = folderList.getNumberOfElements() == 0; folderList.setFolders(folders); folderList.select(0); @@ -135,19 +134,19 @@ public class FolderComposite extends Composite implements IFolderContainer { } } - public IFolderDescription[] getFolders() { + public FolderInfo[] getFolders() { return folderList.getElements(); } @Override public IFolder getActiveFolder() { - return folderList.getElementAt(folderList.getSelectionIndex()).getTabItem().getContents(); + return folderList.getElementAt(folderList.getSelectionIndex()).getInfo().getContents(); } @Override public void switchFolder(String folderId) { for (int i = 0; i < folderList.getNumberOfElements(); i++) { - if (folderList.getElementAt(i).getTabItem().getId().equals(folderId)) { + if (folderList.getElementAt(i).getInfo().getId().equals(folderId)) { folderList.select(i); break; } diff --git a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderDescription.java b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderInfo.java similarity index 87% rename from plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderDescription.java rename to plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderInfo.java index 089d6b9bdd8dc4a1fb7a005368454a970fa74527..add062a8a120c4828f408f372fc0eb530dc5c34f 100644 --- a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderDescription.java +++ b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderInfo.java @@ -31,12 +31,11 @@ package org.jkiss.dbeaver.ui.controls.folders; import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.part.IPage; /** - * Folders composite + * Folder info */ -public class FolderDescription implements IFolderDescription { +public class FolderInfo { private String id; private String text; @@ -44,7 +43,7 @@ public class FolderDescription implements IFolderDescription { private String tooltip; private IFolder contents; - public FolderDescription(String id, String text, Image image, String tooltip, IFolder contents) { + public FolderInfo(String id, String text, Image image, String tooltip, IFolder contents) { this.id = id; this.text = text; this.image = image; @@ -52,32 +51,26 @@ public class FolderDescription implements IFolderDescription { this.contents = contents; } - @Override public String getId() { return id; } - @Override public String getText() { return text; } - @Override public Image getImage() { return image; } - @Override public String getTooltip() { return tooltip; } - @Override public boolean isIndented() { return false; } - @Override public IFolder getContents() { return contents; } diff --git a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderList.java b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderList.java index 86a4b0e1e2af917e15dcff03179c2360a2fade78..513a4a99d63c7b90d68d98f70b1afbfbcc84f29e 100644 --- a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderList.java +++ b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderList.java @@ -94,7 +94,7 @@ public class FolderList extends Composite { */ public class ListElement extends Canvas { - private IFolderDescription tab; + private FolderInfo tab; private int index; private boolean selected; private boolean hover; @@ -106,7 +106,7 @@ public class FolderList extends Composite { * @param tab the tab item for the element. * @param index the index in the list. */ - public ListElement(Composite parent, final IFolderDescription tab, int index) { + public ListElement(Composite parent, final FolderInfo tab, int index) { super(parent, SWT.NO_FOCUS); this.tab = tab; hover = false; @@ -256,7 +256,7 @@ public class FolderList extends Composite { * * @return the tab item. */ - public IFolderDescription getTabItem() { + public FolderInfo getInfo() { return tab; } @@ -524,10 +524,10 @@ public class FolderList extends Composite { return null; } - public IFolderDescription[] getElements() { - IFolderDescription[] tabs = new IFolderDescription[elements.length]; + public FolderInfo[] getElements() { + FolderInfo[] tabs = new FolderInfo[elements.length]; for (int i = 0; i < elements.length; i++) { - tabs[i] = elements[i].getTabItem(); + tabs[i] = elements[i].getInfo(); } return tabs; } @@ -562,7 +562,7 @@ public class FolderList extends Composite { /** * Sets the new list elements. */ - public void setFolders(IFolderDescription[] children) { + public void setFolders(FolderInfo[] children) { if (elements != ELEMENTS_EMPTY) { removeAll(); } @@ -592,17 +592,17 @@ public class FolderList extends Composite { computeTopAndBottomTab(); } - private int getTabWidth(IFolderDescription tabItem) { - int width = getTextDimension(tabItem.getText()).x; + private int getTabWidth(FolderInfo folderInfo) { + int width = getTextDimension(folderInfo.getText()).x; /* * To anticipate for the icon placement we should always keep the * space available after the label. So when the active tab includes * an icon the width of the tab doesn't change. */ - if (tabItem.getImage() != null) { - width = width + tabItem.getImage().getBounds().width + 4; + if (folderInfo.getImage() != null) { + width = width + folderInfo.getImage().getBounds().width + 4; } - if (tabItem.isIndented()) { + if (folderInfo.isIndented()) { width = width + INDENT; } return width; @@ -667,7 +667,7 @@ public class FolderList extends Composite { /* * Add INDENT pixels to the left of the longest tab as a margin. */ - int width = getTabWidth(elements[widestLabelIndex].getTabItem()) + INDENT; + int width = getTabWidth(elements[widestLabelIndex].getInfo()) + INDENT; /* * Add 10 pixels to the right of the longest tab as a margin. */ @@ -903,13 +903,13 @@ public class FolderList extends Composite { public void getName(AccessibleEvent e) { if (getSelectionIndex() != NONE) { - e.result = elements[getSelectionIndex()].getTabItem().getText(); + e.result = elements[getSelectionIndex()].getInfo().getText(); } } public void getHelp(AccessibleEvent e) { if (getSelectionIndex() != NONE) { - e.result = elements[getSelectionIndex()].getTabItem().getText(); + e.result = elements[getSelectionIndex()].getInfo().getText(); } } }); diff --git a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/IFolderContainer.java b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/IFolderContainer.java index 28418be483c04cd3dbb102c09786d79b0b946f62..dfa972e4434886914bf431e4ae3b09a191c18e16 100644 --- a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/IFolderContainer.java +++ b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/IFolderContainer.java @@ -19,8 +19,6 @@ package org.jkiss.dbeaver.ui.controls.folders; -import org.eclipse.ui.part.IPage; -import org.eclipse.ui.views.properties.tabbed.ITabDescriptor; import org.jkiss.code.Nullable; /** diff --git a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/IFolderDescription.java b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/IFolderDescription.java deleted file mode 100644 index ddfd206bd43e99f0ff6137c0a37a8bfb8cd27d63..0000000000000000000000000000000000000000 --- a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/IFolderDescription.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2010-2014 Serge Rieder - * serge@jkiss.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -package org.jkiss.dbeaver.ui.controls.folders; - -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.part.IPage; - -/** - * Represents a tab to be displayed in the tab list in the tabbed property sheet - * page. - * - * @author Anthony Hunter - * @author Serge Rieder - */ -public interface IFolderDescription { - - /** - * Tab unique ID. - */ - public String getId(); - - /** - * Get the text label for the tab. - * - * @return the text label for the tab. - */ - public String getText(); - - /** - * Get the icon image for the tab. - * - * @return the icon image for the tab. - */ - public Image getImage(); - - /** - * Tab tooltip. - */ - public String getTooltip(); - - /** - * Determine if this tab is indented. - * - * @return true if this tab is indented. - */ - public boolean isIndented(); - - /** - * Creates tab contents - */ - public IFolder getContents(); - -} diff --git a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/entity/properties/ObjectPropertiesEditor.java b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/entity/properties/ObjectPropertiesEditor.java index 9f82517e1e396c3fb343f4d22c93c6a7e1de400a..8a844fb70a1bfef9ee7702bd9fa91859b4620bbf 100644 --- a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/entity/properties/ObjectPropertiesEditor.java +++ b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/entity/properties/ObjectPropertiesEditor.java @@ -25,14 +25,12 @@ import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Link; import org.eclipse.ui.*; -import org.eclipse.ui.part.IPage; import org.jkiss.code.Nullable; import org.jkiss.dbeaver.DBException; import org.jkiss.dbeaver.core.CoreMessages; @@ -171,12 +169,12 @@ public class ObjectPropertiesEditor extends AbstractDatabaseObjectEditor tabList = new ArrayList(); + List tabList = new ArrayList(); makeStandardPropertiesTabs(tabList); if (part instanceof IDatabaseEditor) { makeDatabaseEditorTabs((IDatabaseEditor)part, tabList); } - return tabList.toArray(new IFolderDescription[tabList.size()]); + return tabList.toArray(new FolderInfo[tabList.size()]); } - private void makeStandardPropertiesTabs(List tabList) + private void makeStandardPropertiesTabs(List tabList) { - tabList.add(new FolderDescription( + tabList.add(new FolderInfo( //PropertiesContributor.CATEGORY_INFO, PropertiesContributor.TAB_STANDARD, CoreMessages.ui_properties_category_information, @@ -428,7 +426,7 @@ public class ObjectPropertiesEditor extends AbstractDatabaseObjectEditor tabList) + private void makeDatabaseEditorTabs(IDatabaseEditor part, List tabList) { final DBNDatabaseNode node = part.getEditorInput().getTreeNode(); final DBSObject object = node.getObject(); @@ -463,7 +461,7 @@ public class ObjectPropertiesEditor extends AbstractDatabaseObjectEditor tabList, final NavigatorTabInfo tabInfo) + private void addNavigatorNodeTab(final IDatabaseEditor part, List tabList, final NavigatorTabInfo tabInfo) { - tabList.add(new FolderDescription( + tabList.add(new FolderInfo( //PropertiesContributor.CATEGORY_STRUCT, tabInfo.getName(), tabInfo.getName(), diff --git a/plugins/org.jkiss.dbeaver.test/src/org/jkiss/dbeaver/ext/test/ui/TestDialog.java b/plugins/org.jkiss.dbeaver.test/src/org/jkiss/dbeaver/ext/test/ui/TestDialog.java index 3bf17ee2dc172e3e0d9aea10e3d185a10aff0e32..c88416605c88e99ca9d8d698c5e4994e20c83672 100644 --- a/plugins/org.jkiss.dbeaver.test/src/org/jkiss/dbeaver/ext/test/ui/TestDialog.java +++ b/plugins/org.jkiss.dbeaver.test/src/org/jkiss/dbeaver/ext/test/ui/TestDialog.java @@ -24,34 +24,33 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.*; import org.jkiss.dbeaver.ui.DBIcon; import org.jkiss.dbeaver.ui.controls.folders.FolderComposite; -import org.jkiss.dbeaver.ui.controls.folders.FolderDescription; +import org.jkiss.dbeaver.ui.controls.folders.FolderInfo; import org.jkiss.dbeaver.ui.controls.folders.FolderPage; -import org.jkiss.dbeaver.ui.controls.folders.IFolderDescription; public class TestDialog extends TrayDialog { private FolderComposite folderComposite; - private final IFolderDescription[] tabs; + private final FolderInfo[] tabs; public TestDialog(Shell shell) { super(shell); - tabs = new IFolderDescription[3]; - tabs[0] = new FolderDescription("tab1", "Tab 1", DBIcon.TREE_TABLE.getImage(), "Tooltip 1", new FolderPage() { + tabs = new FolderInfo[3]; + tabs[0] = new FolderInfo("tab1", "Tab 1", DBIcon.TREE_TABLE.getImage(), "Tooltip 1", new FolderPage() { @Override public void createControl(Composite parent) { new Text(parent, SWT.NONE); } }); - tabs[1] = new FolderDescription("tab2", "Tab with long-long name", DBIcon.TREE_COLUMNS.getImage(), "Tooltip 2", new FolderPage() { + tabs[1] = new FolderInfo("tab2", "Tab with long-long name", DBIcon.TREE_COLUMNS.getImage(), "Tooltip 2", new FolderPage() { @Override public void createControl(Composite parent) { new Label(parent, SWT.NONE); } }); - tabs[2] = new FolderDescription("tab3", "Example", DBIcon.PROJECT.getImage(), "123123", new FolderPage() { + tabs[2] = new FolderInfo("tab3", "Example", DBIcon.PROJECT.getImage(), "123123", new FolderPage() { @Override public void createControl(Composite parent) {