Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
b33247d2
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b33247d2
编写于
2月 17, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Folder list (replace of tabbed sheet)
上级
b88167ce
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
152 addition
and
68 deletion
+152
-68
plugins/org.jkiss.dbeaver.core/META-INF/MANIFEST.MF
plugins/org.jkiss.dbeaver.core/META-INF/MANIFEST.MF
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderComposite.java
...rg/jkiss/dbeaver/ui/controls/folders/FolderComposite.java
+39
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderDescription.java
.../jkiss/dbeaver/ui/controls/folders/FolderDescription.java
+76
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderList.java
...src/org/jkiss/dbeaver/ui/controls/folders/FolderList.java
+8
-0
plugins/org.jkiss.dbeaver.test/src/org/jkiss/dbeaver/ext/test/ui/TestDialog.java
...er.test/src/org/jkiss/dbeaver/ext/test/ui/TestDialog.java
+28
-67
未找到文件。
plugins/org.jkiss.dbeaver.core/META-INF/MANIFEST.MF
浏览文件 @
b33247d2
...
@@ -66,13 +66,13 @@ Export-Package: org.jkiss.dbeaver,
...
@@ -66,13 +66,13 @@ Export-Package: org.jkiss.dbeaver,
org.jkiss.dbeaver.ui.actions.datasource,
org.jkiss.dbeaver.ui.actions.datasource,
org.jkiss.dbeaver.ui.actions.navigator,
org.jkiss.dbeaver.ui.actions.navigator,
org.jkiss.dbeaver.ui.controls,
org.jkiss.dbeaver.ui.controls,
org.jkiss.dbeaver.ui.controls.folders,
org.jkiss.dbeaver.ui.controls.imageview,
org.jkiss.dbeaver.ui.controls.imageview,
org.jkiss.dbeaver.ui.controls.itemlist,
org.jkiss.dbeaver.ui.controls.itemlist,
org.jkiss.dbeaver.ui.controls.lightgrid,
org.jkiss.dbeaver.ui.controls.lightgrid,
org.jkiss.dbeaver.ui.controls.querylog,
org.jkiss.dbeaver.ui.controls.querylog,
org.jkiss.dbeaver.ui.controls.resultset,
org.jkiss.dbeaver.ui.controls.resultset,
org.jkiss.dbeaver.ui.controls.spreadsheet,
org.jkiss.dbeaver.ui.controls.spreadsheet,
org.jkiss.dbeaver.ui.controls.vtabs,
org.jkiss.dbeaver.ui.dialogs,
org.jkiss.dbeaver.ui.dialogs,
org.jkiss.dbeaver.ui.dialogs.connection,
org.jkiss.dbeaver.ui.dialogs.connection,
org.jkiss.dbeaver.ui.dialogs.data,
org.jkiss.dbeaver.ui.dialogs.data,
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderComposite.java
浏览文件 @
b33247d2
...
@@ -30,6 +30,12 @@
...
@@ -30,6 +30,12 @@
package
org.jkiss.dbeaver.ui.controls.folders
;
package
org.jkiss.dbeaver.ui.controls.folders
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.events.SelectionAdapter
;
import
org.eclipse.swt.events.SelectionEvent
;
import
org.eclipse.swt.layout.FillLayout
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.layout.GridLayout
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Composite
;
...
@@ -39,7 +45,40 @@ import org.eclipse.swt.widgets.Composite;
...
@@ -39,7 +45,40 @@ import org.eclipse.swt.widgets.Composite;
public
class
FolderComposite
extends
Composite
{
public
class
FolderComposite
extends
Composite
{
private
final
FolderList
folderList
;
private
final
Composite
pane
;
private
Composite
curFolder
;
public
FolderComposite
(
Composite
parent
,
int
style
)
{
public
FolderComposite
(
Composite
parent
,
int
style
)
{
super
(
parent
,
style
);
super
(
parent
,
style
);
GridLayout
gl
=
new
GridLayout
(
2
,
false
);
gl
.
horizontalSpacing
=
0
;
gl
.
verticalSpacing
=
0
;
gl
.
marginHeight
=
0
;
gl
.
marginWidth
=
0
;
setLayout
(
gl
);
folderList
=
new
FolderList
(
this
);
folderList
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_BOTH
));
pane
=
new
Composite
(
this
,
SWT
.
NONE
);
pane
.
setLayout
(
new
FillLayout
());
pane
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_BOTH
));
folderList
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
switchFolder
(
folderList
.
getElementAt
(
folderList
.
getSelectionIndex
()).
getTabItem
());
}
});
}
}
private
void
switchFolder
(
IFolderDescription
folder
)
{
}
public
void
setFolders
(
IFolderDescription
[]
folders
)
{
folderList
.
setFolders
(
folders
);
folderList
.
select
(
0
);
}
}
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderDescription.java
0 → 100644
浏览文件 @
b33247d2
/*******************************************************************************
* Copyright (c) 2001, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Mariot Chauvin <mariot.chauvin@obeo.fr> - bug 259553
* Amit Joglekar <joglekar@us.ibm.com> - Support for dynamic images (bug 385795)
*
* 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
;
/**
* Folders composite
*/
public
abstract
class
FolderDescription
implements
IFolderDescription
{
private
String
id
;
private
String
text
;
private
Image
image
;
private
String
tooltip
;
public
FolderDescription
(
String
id
,
String
text
,
Image
image
,
String
tooltip
)
{
this
.
id
=
id
;
this
.
text
=
text
;
this
.
image
=
image
;
this
.
tooltip
=
tooltip
;
}
@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
;
}
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/folders/FolderList.java
浏览文件 @
b33247d2
...
@@ -947,4 +947,12 @@ public class FolderList extends Composite {
...
@@ -947,4 +947,12 @@ public class FolderList extends Composite {
}
}
});
});
}
}
public
void
addSelectionListener
(
SelectionListener
listener
)
{
checkWidget
();
TypedListener
typedListener
=
new
TypedListener
(
listener
);
addListener
(
SWT
.
Selection
,
typedListener
);
addListener
(
SWT
.
DefaultSelection
,
typedListener
);
}
}
}
plugins/org.jkiss.dbeaver.test/src/org/jkiss/dbeaver/ext/test/ui/TestDialog.java
浏览文件 @
b33247d2
...
@@ -20,29 +20,45 @@ package org.jkiss.dbeaver.ext.test.ui;
...
@@ -20,29 +20,45 @@ package org.jkiss.dbeaver.ext.test.ui;
import
org.eclipse.jface.dialogs.TrayDialog
;
import
org.eclipse.jface.dialogs.TrayDialog
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.graphics.Image
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Control
;
import
org.eclipse.swt.widgets.Control
;
import
org.eclipse.swt.widgets.Shell
;
import
org.eclipse.swt.widgets.Shell
;
import
org.eclipse.swt.widgets.Text
;
import
org.jkiss.dbeaver.ui.DBIcon
;
import
org.jkiss.dbeaver.ui.DBIcon
;
import
org.jkiss.dbeaver.ui.
UIUtils
;
import
org.jkiss.dbeaver.ui.
controls.folders.FolderComposite
;
import
org.jkiss.dbeaver.ui.controls.folders.Folder
List
;
import
org.jkiss.dbeaver.ui.controls.folders.Folder
Description
;
import
org.jkiss.dbeaver.ui.controls.folders.IFolderDescription
;
import
org.jkiss.dbeaver.ui.controls.folders.IFolderDescription
;
public
class
TestDialog
extends
TrayDialog
{
public
class
TestDialog
extends
TrayDialog
{
private
IFolderDescription
[]
tabs
;
private
FolderComposite
folderComposite
;
private
final
IFolderDescription
[]
tabs
;
public
TestDialog
(
Shell
shell
)
public
TestDialog
(
Shell
shell
)
{
{
super
(
shell
);
super
(
shell
);
tabs
=
new
IFolderDescription
[
3
];
tabs
=
new
IFolderDescription
[
3
];
tabs
[
0
]
=
new
FolderDescriptionImpl
(
"tab1"
,
"Tab 1"
,
DBIcon
.
TREE_TABLE
.
getImage
());
tabs
[
0
]
=
new
FolderDescription
(
"tab1"
,
"Tab 1"
,
DBIcon
.
TREE_TABLE
.
getImage
(),
"Tooltip 1"
)
{
tabs
[
1
]
=
new
FolderDescriptionImpl
(
"tab2"
,
"Tab with long-long name"
,
DBIcon
.
TREE_COLUMNS
.
getImage
());
@Override
tabs
[
2
]
=
new
FolderDescriptionImpl
(
"tab3"
,
"Example"
,
DBIcon
.
PROJECT
.
getImage
());
public
Composite
createControl
(
Composite
parent
)
{
return
null
;
}
};
tabs
[
1
]
=
new
FolderDescription
(
"tab2"
,
"Tab with long-long name"
,
DBIcon
.
TREE_COLUMNS
.
getImage
(),
"Tooltip 2"
)
{
@Override
public
Composite
createControl
(
Composite
parent
)
{
return
null
;
}
};
tabs
[
2
]
=
new
FolderDescription
(
"tab3"
,
"Example"
,
DBIcon
.
PROJECT
.
getImage
(),
"123123"
)
{
@Override
public
Composite
createControl
(
Composite
parent
)
{
return
null
;
}
};
}
}
@Override
@Override
...
@@ -58,69 +74,14 @@ public class TestDialog extends TrayDialog {
...
@@ -58,69 +74,14 @@ public class TestDialog extends TrayDialog {
GridData
gd
=
new
GridData
(
GridData
.
FILL_BOTH
);
GridData
gd
=
new
GridData
(
GridData
.
FILL_BOTH
);
group
.
setLayoutData
(
gd
);
group
.
setLayoutData
(
gd
);
Composite
sheet
=
UIUtils
.
createPlaceholder
(
group
,
2
);
folderComposite
=
new
FolderComposite
(
group
,
SWT
.
BORDER
);
sheet
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_BOTH
));
FolderList
folderList
=
new
FolderList
(
sheet
);
gd
=
new
GridData
(
GridData
.
FILL_BOTH
);
gd
=
new
GridData
(
GridData
.
FILL_BOTH
);
gd
.
widthHint
=
300
;
gd
.
heightHint
=
300
;
gd
.
heightHint
=
300
;
gd
.
widthHint
=
500
;
folderComposite
.
setLayoutData
(
gd
);
folderList
.
setLayoutData
(
gd
);
folderComposite
.
setFolders
(
tabs
);
folderList
.
setFolders
(
tabs
);
folderList
.
select
(
0
);
Text
pane
=
new
Text
(
sheet
,
SWT
.
NONE
);
pane
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_BOTH
));
//pane.setLayout(new FillLayout());
/*
Composite propsGroup = new Composite(group, SWT.NONE);
propsGroup.setLayout(new GridLayout(2, false));
gd = new GridData(GridData.FILL_HORIZONTAL);
propsGroup.setLayoutData(gd);
*/
return
group
;
return
group
;
}
}
private
static
class
FolderDescriptionImpl
implements
IFolderDescription
{
private
String
id
;
private
String
text
;
private
Image
image
;
private
FolderDescriptionImpl
(
String
id
,
String
text
,
Image
image
)
{
this
.
id
=
id
;
this
.
text
=
text
;
this
.
image
=
image
;
}
@Override
public
Image
getImage
()
{
return
image
;
}
@Override
public
String
getTooltip
()
{
return
text
+
" information"
;
}
@Override
public
String
getId
()
{
return
id
;
}
@Override
public
String
getText
()
{
return
text
;
}
@Override
public
boolean
isIndented
()
{
return
false
;
}
@Override
public
Composite
createControl
(
Composite
parent
)
{
return
new
Composite
(
parent
,
SWT
.
BORDER
);
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录