Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
18f245d3
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,发现更多精彩内容 >>
提交
18f245d3
编写于
3月 09, 2018
作者:
A
Alexander Fedorov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#3118 extract PgSqlLaunchShortcut messages to common part
上级
136355e1
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
60 addition
and
44 deletion
+60
-44
plugins/org.jkiss.dbeaver.debug.ui/src/org/jkiss/dbeaver/debug/internal/ui/DebugUIMessages.java
.../org/jkiss/dbeaver/debug/internal/ui/DebugUIMessages.java
+10
-2
plugins/org.jkiss.dbeaver.debug.ui/src/org/jkiss/dbeaver/debug/internal/ui/DebugUIMessages.properties
...kiss/dbeaver/debug/internal/ui/DebugUIMessages.properties
+10
-2
plugins/org.jkiss.dbeaver.debug.ui/src/org/jkiss/dbeaver/debug/ui/DatabaseLaunchShortcut.java
...rc/org/jkiss/dbeaver/debug/ui/DatabaseLaunchShortcut.java
+36
-9
plugins/org.jkiss.dbeaver.ext.postgresql.debug.ui/src/org/jkiss/dbeaver/ext/postgresql/debug/ui/internal/PgSqlBaseLaunchShortcut.java
...postgresql/debug/ui/internal/PgSqlBaseLaunchShortcut.java
+2
-23
plugins/org.jkiss.dbeaver.ext.postgresql.debug.ui/src/org/jkiss/dbeaver/ext/postgresql/debug/ui/internal/PostgreDebugUIMessages.java
.../postgresql/debug/ui/internal/PostgreDebugUIMessages.java
+1
-4
plugins/org.jkiss.dbeaver.ext.postgresql.debug.ui/src/org/jkiss/dbeaver/ext/postgresql/debug/ui/internal/PostgreDebugUIMessages.properties
...resql/debug/ui/internal/PostgreDebugUIMessages.properties
+1
-4
未找到文件。
plugins/org.jkiss.dbeaver.debug.ui/src/org/jkiss/dbeaver/debug/internal/ui/DebugUIMessages.java
浏览文件 @
18f245d3
...
...
@@ -42,8 +42,16 @@ public class DebugUIMessages extends NLS {
public
static
String
DatabaseTab_name
;
public
static
String
LaunchShortcut_e_launch
;
public
static
String
LaunchShortcut_select_cobfiguration_title
;
public
static
String
DatabaseLaunchShortcut_e_launch
;
public
static
String
DatabaseLaunchShortcut_select_configuration_title
;
public
static
String
DatabaseLaunchShortcut_select_configuration_message
;
public
static
String
DatabaseLaunchShortcut_e_editor_empty
;
public
static
String
DatabaseLaunchShortcut_e_selection_empty
;
public
static
String
DatabaseLaunchShortcut_select_message
;
public
static
String
DatabaseLaunchShortcut_select_title
;
static
{
// initialize resource bundle
NLS
.
initializeMessages
(
BUNDLE_NAME
,
DebugUIMessages
.
class
);
...
...
plugins/org.jkiss.dbeaver.debug.ui/src/org/jkiss/dbeaver/debug/internal/ui/DebugUIMessages.properties
浏览文件 @
18f245d3
...
...
@@ -32,5 +32,13 @@ DatabaseTab_script_execute_text=Execute script
DatabaseTab_name
=
&Main
LaunchShortcut_e_launch
=
Launch error
LaunchShortcut_select_cobfiguration_title
=
&Select existing configuration:
DatabaseLaunchShortcut_e_launch
=
Launch error
DatabaseLaunchShortcut_select_configuration_title
=
Select Configuration
DatabaseLaunchShortcut_select_configuration_message
=
&Select existing configuration:
DatabaseLaunchShortcut_e_editor_empty
=
Editor does not contain {0} procedure
DatabaseLaunchShortcut_e_selection_empty
=
Selection does not contain {0} procedure
DatabaseLaunchShortcut_select_message
=
Select {0} procedure (? = any character, * = any String):
DatabaseLaunchShortcut_select_title
=
Select {0} Procedure
plugins/org.jkiss.dbeaver.debug.ui/src/org/jkiss/dbeaver/debug/ui/DatabaseLaunchShortcut.java
浏览文件 @
18f245d3
...
...
@@ -40,6 +40,7 @@ import org.eclipse.jface.viewers.ILabelProvider;
import
org.eclipse.jface.viewers.ISelection
;
import
org.eclipse.jface.viewers.IStructuredSelection
;
import
org.eclipse.jface.window.Window
;
import
org.eclipse.osgi.util.NLS
;
import
org.eclipse.swt.widgets.Shell
;
import
org.eclipse.ui.IEditorPart
;
import
org.eclipse.ui.IWorkbenchWindow
;
...
...
@@ -52,6 +53,14 @@ import org.jkiss.dbeaver.model.struct.DBSObject;
public
abstract
class
DatabaseLaunchShortcut
implements
ILaunchShortcut2
{
private
final
String
configurationTypeId
;
private
final
String
launchObjectName
;
public
DatabaseLaunchShortcut
(
String
typeId
,
String
objectName
)
{
this
.
configurationTypeId
=
typeId
;
this
.
launchObjectName
=
objectName
;
}
@Override
public
void
launch
(
ISelection
selection
,
String
mode
)
{
if
(
selection
instanceof
IStructuredSelection
)
{
...
...
@@ -76,13 +85,25 @@ public abstract class DatabaseLaunchShortcut implements ILaunchShortcut2 {
}
protected
abstract
String
getSelectionEmptyMessage
();
protected
String
getSelectionEmptyMessage
()
{
String
message
=
DebugUIMessages
.
DatabaseLaunchShortcut_e_selection_empty
;
return
NLS
.
bind
(
message
,
launchObjectName
);
}
protected
abstract
String
getEditorEmptyMessage
();
protected
String
getEditorEmptyMessage
()
{
String
message
=
DebugUIMessages
.
DatabaseLaunchShortcut_e_editor_empty
;
return
NLS
.
bind
(
message
,
launchObjectName
);
}
protected
abstract
String
getLaunchableSelectionTitle
(
String
mode
);
protected
String
getLaunchableSelectionTitle
(
String
mode
)
{
String
message
=
DebugUIMessages
.
DatabaseLaunchShortcut_select_title
;
return
NLS
.
bind
(
message
,
launchObjectName
);
}
protected
abstract
String
getLaunchableSelectionMessage
(
String
mode
);
protected
String
getLaunchableSelectionMessage
(
String
mode
)
{
String
message
=
DebugUIMessages
.
DatabaseLaunchShortcut_select_message
;
return
NLS
.
bind
(
message
,
launchObjectName
);
}
protected
ILabelProvider
getLaunchableSelectionRenderer
()
{
return
WorkbenchLabelProvider
.
getDecoratingWorkbenchLabelProvider
();
...
...
@@ -100,7 +121,7 @@ public abstract class DatabaseLaunchShortcut implements ILaunchShortcut2 {
List
<
DBSObject
>
extracted
=
DebugCore
.
extractLaunchable
(
scope
);
DBSObject
launchable
=
null
;
if
(
extracted
.
size
()
==
0
)
{
MessageDialog
.
openError
(
getShell
(),
DebugUIMessages
.
LaunchShortcut_e_launch
,
emptyMessage
);
MessageDialog
.
openError
(
getShell
(),
DebugUIMessages
.
Database
LaunchShortcut_e_launch
,
emptyMessage
);
}
else
if
(
extracted
.
size
()
>
1
)
{
launchable
=
selectLaunchable
(
getShell
(),
extracted
,
mode
);
}
else
{
...
...
@@ -130,7 +151,7 @@ public abstract class DatabaseLaunchShortcut implements ILaunchShortcut2 {
}
catch
(
CoreException
e
)
{
IStatus
status
=
e
.
getStatus
();
DebugUI
.
log
(
status
);
MessageDialog
.
openError
(
getShell
(),
DebugUIMessages
.
LaunchShortcut_e_launch
,
status
.
getMessage
());
MessageDialog
.
openError
(
getShell
(),
DebugUIMessages
.
Database
LaunchShortcut_e_launch
,
status
.
getMessage
());
return
;
}
}
...
...
@@ -146,7 +167,13 @@ public abstract class DatabaseLaunchShortcut implements ILaunchShortcut2 {
return
lm
.
getLaunchConfigurationType
(
configurationTypeId
);
}
protected
abstract
String
getConfigurationTypeId
();
protected
String
getConfigurationTypeId
()
{
return
configurationTypeId
;
}
protected
String
getLaunchObjectName
()
{
return
launchObjectName
;
}
protected
DBSObject
selectLaunchable
(
Shell
shell
,
List
<
DBSObject
>
launchables
,
String
mode
)
{
String
title
=
getLaunchableSelectionTitle
(
mode
);
...
...
@@ -189,8 +216,8 @@ public abstract class DatabaseLaunchShortcut implements ILaunchShortcut2 {
IDebugModelPresentation
labelProvider
=
DebugUITools
.
newDebugModelPresentation
();
ElementListSelectionDialog
dialog
=
new
ElementListSelectionDialog
(
getShell
(),
labelProvider
);
dialog
.
setElements
(
configList
.
toArray
());
dialog
.
setTitle
(
getLaunchableSelectionTitle
(
mode
)
);
dialog
.
setMessage
(
DebugUIMessages
.
LaunchShortcut_select_cobfiguration_titl
e
);
dialog
.
setTitle
(
DebugUIMessages
.
DatabaseLaunchShortcut_select_configuration_title
);
dialog
.
setMessage
(
DebugUIMessages
.
DatabaseLaunchShortcut_select_configuration_messag
e
);
dialog
.
setMultipleSelection
(
false
);
int
result
=
dialog
.
open
();
labelProvider
.
dispose
();
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.ui/src/org/jkiss/dbeaver/ext/postgresql/debug/ui/internal/PgSqlBaseLaunchShortcut.java
浏览文件 @
18f245d3
...
...
@@ -26,29 +26,8 @@ import org.jkiss.dbeaver.model.struct.DBSObject;
public
abstract
class
PgSqlBaseLaunchShortcut
extends
DatabaseLaunchShortcut
{
@Override
protected
String
getSelectionEmptyMessage
()
{
return
PostgreDebugUIMessages
.
PgSqlLaunchShortcut_e_selection_empty
;
}
@Override
protected
String
getEditorEmptyMessage
()
{
return
PostgreDebugUIMessages
.
PgSqlLaunchShortcut_e_editor_empty
;
}
@Override
protected
String
getLaunchableSelectionTitle
(
String
mode
)
{
return
PostgreDebugUIMessages
.
PgSqlLaunchShortcut_select_procedure_title
;
}
@Override
protected
String
getLaunchableSelectionMessage
(
String
mode
)
{
return
PostgreDebugUIMessages
.
PgSqlLaunchShortcut_select_procedure_message
;
}
@Override
protected
String
getConfigurationTypeId
()
{
return
PostgreSqlDebugCore
.
CONFIGURATION_TYPE
;
public
PgSqlBaseLaunchShortcut
()
{
super
(
PostgreSqlDebugCore
.
CONFIGURATION_TYPE
,
PostgreDebugUIMessages
.
PgSqlLaunchShortcut_name
);
}
@Override
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.ui/src/org/jkiss/dbeaver/ext/postgresql/debug/ui/internal/PostgreDebugUIMessages.java
浏览文件 @
18f245d3
...
...
@@ -23,10 +23,7 @@ public class PostgreDebugUIMessages extends NLS {
private
static
final
String
BUNDLE_NAME
=
"org.jkiss.dbeaver.ext.postgresql.debug.ui.internal.PostgreDebugUIMessages"
;
//$NON-NLS-1$
public
static
String
PgSqlLaunchShortcut_e_editor_empty
;
public
static
String
PgSqlLaunchShortcut_e_selection_empty
;
public
static
String
PgSqlLaunchShortcut_select_procedure_message
;
public
static
String
PgSqlLaunchShortcut_select_procedure_title
;
public
static
String
PgSqlLaunchShortcut_name
;
static
{
// initialize resource bundle
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.ui/src/org/jkiss/dbeaver/ext/postgresql/debug/ui/internal/PostgreDebugUIMessages.properties
浏览文件 @
18f245d3
...
...
@@ -14,7 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
PgSqlLaunchShortcut_e_editor_empty
=
Editor does not containt PostgreSQL procedure
PgSqlLaunchShortcut_e_selection_empty
=
Selection does not containt PostgreSQL procedure
PgSqlLaunchShortcut_select_procedure_message
=
Select &PostgreSQL Procedure (? = any character, * = any String):
PgSqlLaunchShortcut_select_procedure_title
=
Select PostgreSQL Procedure
PgSqlLaunchShortcut_name
=
PL/pgSQL
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录