Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
7fda56b9
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
7fda56b9
编写于
2月 04, 2019
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#5191 Dashboard view, commands stubs
Former-commit-id:
9045bcda
上级
fbbe460b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
253 addition
and
1 deletion
+253
-1
plugins/org.jkiss.dbeaver.ui.dashboard/OSGI-INF/l10n/bundle.properties
...kiss.dbeaver.ui.dashboard/OSGI-INF/l10n/bundle.properties
+1
-1
plugins/org.jkiss.dbeaver.ui.dashboard/src/org/jkiss/dbeaver/ui/dashboard/registry/DashboardDescriptor.java
...ss/dbeaver/ui/dashboard/registry/DashboardDescriptor.java
+67
-0
plugins/org.jkiss.dbeaver.ui.dashboard/src/org/jkiss/dbeaver/ui/dashboard/registry/DashboardRegistry.java
...kiss/dbeaver/ui/dashboard/registry/DashboardRegistry.java
+69
-0
plugins/org.jkiss.dbeaver.ui.dashboard/src/org/jkiss/dbeaver/ui/dashboard/view/DashboardView.java
...rc/org/jkiss/dbeaver/ui/dashboard/view/DashboardView.java
+76
-0
plugins/org.jkiss.dbeaver.ui.dashboard/src/org/jkiss/dbeaver/ui/dashboard/view/HandlerDashboardOpen.java
...jkiss/dbeaver/ui/dashboard/view/HandlerDashboardOpen.java
+40
-0
未找到文件。
plugins/org.jkiss.dbeaver.ui.dashboard/OSGI-INF/l10n/bundle.properties
浏览文件 @
7fda56b9
...
@@ -3,7 +3,7 @@ Bundle-Name = DBeaver Dashboard UI
...
@@ -3,7 +3,7 @@ Bundle-Name = DBeaver Dashboard UI
extension-point.org.jkiss.dbeaver.dashboard.name
=
Dashboard
extension-point.org.jkiss.dbeaver.dashboard.name
=
Dashboard
view.dashboard.title
=
Dashboard
view.dashboard.title
=
Da
tabase Da
shboard
wizard.org.jkiss.dbeaver.dashboard.new.dashboard.name
=
Dashboard
wizard.org.jkiss.dbeaver.dashboard.new.dashboard.name
=
Dashboard
wizard.org.jkiss.dbeaver.dashboard.new.dashboard.description
=
Create custom dashboard
wizard.org.jkiss.dbeaver.dashboard.new.dashboard.description
=
Create custom dashboard
...
...
plugins/org.jkiss.dbeaver.ui.dashboard/src/org/jkiss/dbeaver/ui/dashboard/registry/DashboardDescriptor.java
0 → 100644
浏览文件 @
7fda56b9
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.ui.dashboard.registry
;
import
org.eclipse.core.runtime.IConfigurationElement
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.dbeaver.model.app.DBPPlatformLanguage
;
import
org.jkiss.dbeaver.model.impl.AbstractContextDescriptor
;
/**
* DashboardDescriptor
*/
public
class
DashboardDescriptor
extends
AbstractContextDescriptor
implements
DBPPlatformLanguage
{
public
static
final
String
EXTENSION_ID
=
"org.jkiss.dbeaver.dashboard"
;
//$NON-NLS-1$
private
final
String
id
;
private
final
String
label
;
private
final
String
description
;
public
DashboardDescriptor
(
IConfigurationElement
config
)
{
super
(
config
);
this
.
id
=
config
.
getAttribute
(
"id"
);
this
.
label
=
config
.
getAttribute
(
"label"
);
this
.
description
=
config
.
getAttribute
(
"description"
);
}
@NotNull
@Override
public
String
getId
()
{
return
id
;
}
@NotNull
@Override
public
String
getLabel
()
{
return
label
;
}
public
String
getDescription
()
{
return
description
;
}
@Override
public
String
toString
()
{
return
id
;
}
}
plugins/org.jkiss.dbeaver.ui.dashboard/src/org/jkiss/dbeaver/ui/dashboard/registry/DashboardRegistry.java
0 → 100644
浏览文件 @
7fda56b9
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.ui.dashboard.registry
;
import
org.eclipse.core.runtime.IConfigurationElement
;
import
org.eclipse.core.runtime.IExtensionRegistry
;
import
org.eclipse.core.runtime.Platform
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
DashboardRegistry
{
private
static
DashboardRegistry
instance
=
null
;
public
synchronized
static
DashboardRegistry
getInstance
()
{
if
(
instance
==
null
)
{
instance
=
new
DashboardRegistry
(
Platform
.
getExtensionRegistry
());
}
return
instance
;
}
private
final
List
<
DashboardDescriptor
>
descriptors
=
new
ArrayList
<>();
private
DashboardRegistry
(
IExtensionRegistry
registry
)
{
// Load data descriptors from external plugins
{
IConfigurationElement
[]
extElements
=
registry
.
getConfigurationElementsFor
(
DashboardDescriptor
.
EXTENSION_ID
);
for
(
IConfigurationElement
ext
:
extElements
)
{
DashboardDescriptor
formatterDescriptor
=
new
DashboardDescriptor
(
ext
);
descriptors
.
add
(
formatterDescriptor
);
}
}
}
public
List
<
DashboardDescriptor
>
getAllDashboards
()
{
return
descriptors
;
}
public
DashboardDescriptor
getDashboard
(
String
id
)
{
for
(
DashboardDescriptor
descriptor
:
descriptors
)
{
if
(
descriptor
.
getId
().
equals
(
id
))
{
return
descriptor
;
}
}
return
null
;
}
public
List
<
DashboardDescriptor
>
getDashboard
(
DBPDataSourceContainer
dataSourceContainer
)
{
List
<
DashboardDescriptor
>
result
=
new
ArrayList
<>();
return
result
;
}
}
plugins/org.jkiss.dbeaver.ui.dashboard/src/org/jkiss/dbeaver/ui/dashboard/view/DashboardView.java
0 → 100644
浏览文件 @
7fda56b9
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.ui.dashboard.view
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.ui.IMemento
;
import
org.eclipse.ui.IViewSite
;
import
org.eclipse.ui.PartInitException
;
import
org.eclipse.ui.part.ViewPart
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.IDataSourceContainerProvider
;
import
org.jkiss.utils.CommonUtils
;
public
class
DashboardView
extends
ViewPart
implements
IDataSourceContainerProvider
{
public
static
final
String
VIEW_ID
=
"org.jkiss.dbeaver.ui.dashboardView"
;
public
DashboardView
()
{
super
();
}
@Override
public
void
createPartControl
(
Composite
parent
)
{
//UIUtils.setHelp(parent, IHelpContextIds.CTX_DATABASE_NAVIGATOR);
String
secondaryId
=
getViewSite
().
getSecondaryId
();
if
(!
CommonUtils
.
isEmpty
(
secondaryId
))
{
/*
try {
DBNNode node = getNodeFromSecondaryId(secondaryId);
setPartName(node.getNodeName());
setTitleImage(DBeaverIcons.getImage(node.getNodeIconDefault()));
} catch (DBException e) {
// ignore
}
*/
}
}
@Override
public
void
setFocus
()
{
}
@Override
public
void
init
(
IViewSite
site
)
throws
PartInitException
{
super
.
init
(
site
);
}
@Override
public
void
saveState
(
IMemento
memento
)
{
super
.
saveState
(
memento
);
}
@Override
public
DBPDataSourceContainer
getDataSourceContainer
()
{
return
null
;
}
}
plugins/org.jkiss.dbeaver.ui.dashboard/src/org/jkiss/dbeaver/ui/dashboard/view/HandlerDashboardOpen.java
0 → 100644
浏览文件 @
7fda56b9
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.ui.dashboard.view
;
import
org.eclipse.core.commands.AbstractHandler
;
import
org.eclipse.core.commands.ExecutionEvent
;
import
org.eclipse.core.commands.ExecutionException
;
import
org.eclipse.ui.commands.IElementUpdater
;
import
org.eclipse.ui.menus.UIElement
;
import
java.util.Map
;
public
class
HandlerDashboardOpen
extends
AbstractHandler
implements
IElementUpdater
{
@Override
public
Object
execute
(
ExecutionEvent
event
)
throws
ExecutionException
{
return
null
;
}
@Override
public
void
updateElement
(
UIElement
element
,
Map
parameters
)
{
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录