Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
58f6cbb0
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,发现更多精彩内容 >>
提交
58f6cbb0
编写于
6月 07, 2013
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Composite dialog pages model
Former-commit-id:
76233b64
上级
75913ddb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
80 addition
and
37 deletion
+80
-37
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ext/ui/ICompositeDialogPage.java
...re/src/org/jkiss/dbeaver/ext/ui/ICompositeDialogPage.java
+31
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ext/ui/IDataSourceConnectionEditorSite.java
...jkiss/dbeaver/ext/ui/IDataSourceConnectionEditorSite.java
+1
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/MultiPageWizardDialog.java
...c/org/jkiss/dbeaver/ui/dialogs/MultiPageWizardDialog.java
+48
-26
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/connection/ConnectionPageSettings.java
...dbeaver/ui/dialogs/connection/ConnectionPageSettings.java
+0
-9
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ext/ui/ICompositeDialogPage.java
0 → 100644
浏览文件 @
58f6cbb0
/*
* Copyright (C) 2010-2012 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.ext.ui
;
import
org.eclipse.jface.dialogs.IDialogPage
;
/**
* ICompositeDialogPage
*/
public
interface
ICompositeDialogPage
extends
IDialogPage
{
IDialogPage
[]
getSubPages
();
}
\ No newline at end of file
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ext/ui/IDataSourceConnectionEditorSite.java
浏览文件 @
58f6cbb0
...
...
@@ -19,6 +19,7 @@
package
org.jkiss.dbeaver.ext.ui
;
import
org.eclipse.jface.dialogs.IDialogPage
;
import
org.eclipse.jface.operation.IRunnableContext
;
import
org.jkiss.dbeaver.model.DBPConnectionInfo
;
import
org.jkiss.dbeaver.model.DBPDriver
;
...
...
@@ -38,7 +39,5 @@ public interface IDataSourceConnectionEditorSite
void
updateMessage
();
void
testConnection
();
boolean
openDriverEditor
();
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/MultiPageWizardDialog.java
浏览文件 @
58f6cbb0
...
...
@@ -38,7 +38,9 @@ import org.eclipse.swt.layout.GridLayout;
import
org.eclipse.swt.widgets.*
;
import
org.eclipse.ui.IWorkbenchWindow
;
import
org.eclipse.ui.IWorkbenchWizard
;
import
org.jkiss.dbeaver.ext.ui.ICompositeDialogPage
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.utils.CommonUtils
;
import
java.lang.reflect.InvocationTargetException
;
...
...
@@ -113,27 +115,8 @@ public class MultiPageWizardDialog extends TitleAreaDialog implements IWizardCon
Point
maxSize
=
new
Point
(
0
,
0
);
IWizardPage
[]
pages
=
wizard
.
getPages
();
for
(
int
i
=
0
,
pagesLength
=
pages
.
length
;
i
<
pagesLength
;
i
++)
{
IDialogPage
page
=
pages
[
i
];
page
.
createControl
(
pageArea
);
if
(
i
==
0
&&
page
instanceof
ActiveWizardPage
)
{
((
ActiveWizardPage
)
page
).
activatePage
();
}
Control
control
=
page
.
getControl
();
Point
pageSize
=
control
.
computeSize
(
SWT
.
DEFAULT
,
SWT
.
DEFAULT
);
if
(
pageSize
.
x
>
maxSize
.
x
)
maxSize
.
x
=
pageSize
.
x
;
if
(
pageSize
.
y
>
maxSize
.
y
)
maxSize
.
y
=
pageSize
.
y
;
GridData
gd
=
(
GridData
)
control
.
getLayoutData
();
if
(
gd
==
null
)
{
gd
=
new
GridData
(
GridData
.
FILL_BOTH
);
control
.
setLayoutData
(
gd
);
}
gd
.
exclude
=
i
>
0
;
control
.
setVisible
(
i
==
0
);
TreeItem
item
=
new
TreeItem
(
pagesTree
,
SWT
.
NONE
);
item
.
setText
(
page
.
getTitle
());
item
.
setData
(
page
);
for
(
IWizardPage
page
:
pages
)
{
addPage
(
null
,
page
,
maxSize
);
}
prevPage
=
(
IDialogPage
)
pagesTree
.
getItem
(
0
).
getData
();
GridData
gd
=
(
GridData
)
pageArea
.
getLayoutData
();
...
...
@@ -171,6 +154,42 @@ public class MultiPageWizardDialog extends TitleAreaDialog implements IWizardCon
return
composite
;
}
private
TreeItem
addPage
(
TreeItem
parentItem
,
IDialogPage
page
,
Point
maxSize
)
{
boolean
hasPages
=
pagesTree
.
getItemCount
()
!=
0
;
page
.
createControl
(
pageArea
);
if
(!
hasPages
&&
page
instanceof
ActiveWizardPage
)
{
((
ActiveWizardPage
)
page
).
activatePage
();
}
Control
control
=
page
.
getControl
();
Point
pageSize
=
control
.
computeSize
(
SWT
.
DEFAULT
,
SWT
.
DEFAULT
);
if
(
pageSize
.
x
>
maxSize
.
x
)
maxSize
.
x
=
pageSize
.
x
;
if
(
pageSize
.
y
>
maxSize
.
y
)
maxSize
.
y
=
pageSize
.
y
;
GridData
gd
=
(
GridData
)
control
.
getLayoutData
();
if
(
gd
==
null
)
{
gd
=
new
GridData
(
GridData
.
FILL_BOTH
);
control
.
setLayoutData
(
gd
);
}
gd
.
exclude
=
hasPages
;
control
.
setVisible
(!
gd
.
exclude
);
TreeItem
item
=
parentItem
==
null
?
new
TreeItem
(
pagesTree
,
SWT
.
NONE
)
:
new
TreeItem
(
parentItem
,
SWT
.
NONE
);
item
.
setText
(
page
.
getTitle
());
item
.
setData
(
page
);
// Ad sub pages
if
(
page
instanceof
ICompositeDialogPage
)
{
IDialogPage
[]
subPages
=
((
ICompositeDialogPage
)
page
).
getSubPages
();
for
(
IDialogPage
subPage
:
subPages
)
{
addPage
(
item
,
subPage
,
maxSize
);
}
}
return
item
;
}
private
void
changePage
()
{
pageArea
.
setRedraw
(
false
);
...
...
@@ -220,20 +239,23 @@ public class MultiPageWizardDialog extends TitleAreaDialog implements IWizardCon
@Override
public
IWizardPage
getCurrentPage
()
{
return
null
;
TreeItem
[]
selection
=
pagesTree
.
getSelection
();
if
(
CommonUtils
.
isEmpty
(
selection
))
{
return
null
;
}
IDialogPage
page
=
(
IDialogPage
)
selection
[
0
].
getData
();
return
page
instanceof
IWizardPage
?
(
IWizardPage
)
page
:
null
;
}
@Override
public
void
showPage
(
IWizardPage
page
)
{
/*
for (CTabItem item : pagesFolder.getItems()) {
for
(
TreeItem
item
:
pagesTree
.
getItems
())
{
if
(
item
.
getData
()
==
page
)
{
pages
Folder
.setSelection(item);
pages
Tree
.
setSelection
(
item
);
break
;
}
}
*/
}
@Override
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/connection/ConnectionPageSettings.java
浏览文件 @
58f6cbb0
...
...
@@ -190,15 +190,6 @@ class ConnectionPageSettings extends ActiveWizardPage<ConnectionWizard> implemen
getWizard
().
getContainer
().
updateTitleBar
();
}
@Override
public
void
testConnection
()
{
if
(
this
.
connectionEditor
!=
null
)
{
this
.
connectionEditor
.
saveSettings
();
this
.
wizard
.
testConnection
();
}
}
@Override
public
boolean
openDriverEditor
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录