Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
9e3951dd
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,发现更多精彩内容 >>
提交
9e3951dd
编写于
12月 28, 2013
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Null/NotNull anno, npe checks
Former-commit-id:
15d2afd6
上级
b6ec2920
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
171 addition
and
85 deletion
+171
-85
docs/todo.txt
docs/todo.txt
+1
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ext/IDataSourceContainerProvider.java
...c/org/jkiss/dbeaver/ext/IDataSourceContainerProvider.java
+2
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ext/IDataSourceContainerProviderEx.java
...org/jkiss/dbeaver/ext/IDataSourceContainerProviderEx.java
+2
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ext/IDataSourceProvider.java
...r.core/src/org/jkiss/dbeaver/ext/IDataSourceProvider.java
+2
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/DBPDataSource.java
...eaver.core/src/org/jkiss/dbeaver/model/DBPDataSource.java
+2
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
...src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
+2
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/struct/DBSObject.java
...er.core/src/org/jkiss/dbeaver/model/struct/DBSObject.java
+4
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/sql/SQLResultsConsumer.java
...src/org/jkiss/dbeaver/runtime/sql/SQLResultsConsumer.java
+2
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/transfer/database/DatabaseTransferProducer.java
...ver/tools/transfer/database/DatabaseTransferProducer.java
+6
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/transfer/wizard/DataTransferSettings.java
...s/dbeaver/tools/transfer/wizard/DataTransferSettings.java
+2
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/transfer/wizard/DataTransferWizard.java
...iss/dbeaver/tools/transfer/wizard/DataTransferWizard.java
+4
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/UIUtils.java
....jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/UIUtils.java
+42
-21
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/datasource/DataSourceConnectHandler.java
...eaver/ui/actions/datasource/DataSourceConnectHandler.java
+9
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/StandardErrorDialog.java
...src/org/jkiss/dbeaver/ui/dialogs/StandardErrorDialog.java
+6
-4
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/connection/ConnectionAuthDialog.java
...s/dbeaver/ui/dialogs/connection/ConnectionAuthDialog.java
+3
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
....core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
+54
-41
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorInput.java
.../src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorInput.java
+6
-3
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/syntax/SQLSyntaxManager.java
...jkiss/dbeaver/ui/editors/sql/syntax/SQLSyntaxManager.java
+20
-8
plugins/org.jkiss.dbeaver.wmi/src/org/jkiss/dbeaver/ext/wmi/model/WMIDataSource.java
...mi/src/org/jkiss/dbeaver/ext/wmi/model/WMIDataSource.java
+2
-0
未找到文件。
docs/todo.txt
浏览文件 @
9e3951dd
...
...
@@ -3,6 +3,7 @@ Major:
error: S/DB selector combo works as crap
SOCKS proxy, HTTP proxy
NoSQL model. Cassandra new driver, mongo db, redis. BerkeleyDB.
Performance profile (RSV, tab switch, connections props dialog)
1. Browse data by foreign keys
2. Tree-like grid
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ext/IDataSourceContainerProvider.java
浏览文件 @
9e3951dd
...
...
@@ -19,6 +19,7 @@
package
org.jkiss.dbeaver.ext
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.model.struct.DBSDataSourceContainer
;
/**
...
...
@@ -31,6 +32,7 @@ public interface IDataSourceContainerProvider {
* Underlying datasource container
* @return data source object.
*/
@Nullable
DBSDataSourceContainer
getDataSourceContainer
();
}
\ No newline at end of file
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ext/IDataSourceContainerProviderEx.java
浏览文件 @
9e3951dd
...
...
@@ -19,6 +19,7 @@
package
org.jkiss.dbeaver.ext
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.model.struct.DBSDataSourceContainer
;
/**
...
...
@@ -31,6 +32,6 @@ public interface IDataSourceContainerProviderEx extends IDataSourceContainerProv
* Change underlying datasource container
* @return data source object.
*/
boolean
setDataSourceContainer
(
DBSDataSourceContainer
dataSourceContainer
);
boolean
setDataSourceContainer
(
@Nullable
DBSDataSourceContainer
dataSourceContainer
);
}
\ No newline at end of file
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ext/IDataSourceProvider.java
浏览文件 @
9e3951dd
...
...
@@ -19,6 +19,7 @@
package
org.jkiss.dbeaver.ext
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
/**
...
...
@@ -31,6 +32,7 @@ public interface IDataSourceProvider {
* Underlying datasource
* @return data source object.
*/
@Nullable
DBPDataSource
getDataSource
();
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/DBPDataSource.java
浏览文件 @
9e3951dd
...
...
@@ -18,6 +18,7 @@
*/
package
org.jkiss.dbeaver.model
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.model.exec.DBCException
;
import
org.jkiss.dbeaver.model.exec.DBCExecutionContext
;
...
...
@@ -37,6 +38,7 @@ public interface DBPDataSource extends DBCExecutionContext
* Datasource container
* @return container implementation
*/
@NotNull
DBSDataSourceContainer
getContainer
();
/**
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
浏览文件 @
9e3951dd
...
...
@@ -18,6 +18,7 @@
*/
package
org.jkiss.dbeaver.model.impl.jdbc
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.model.*
;
...
...
@@ -197,6 +198,7 @@ public abstract class JDBCDataSource
return
new
JDBCConnectionImpl
(
context
,
monitor
,
purpose
,
taskTitle
);
}
@NotNull
@Override
public
DBSDataSourceContainer
getContainer
()
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/struct/DBSObject.java
浏览文件 @
9e3951dd
...
...
@@ -19,6 +19,7 @@
package
org.jkiss.dbeaver.model.struct
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
import
org.jkiss.dbeaver.model.DBPNamedObject
;
import
org.jkiss.dbeaver.model.DBPPersistedObject
;
...
...
@@ -34,6 +35,7 @@ public interface DBSObject extends DBPNamedObject, DBPPersistedObject
*
* @return object description or null
*/
@Nullable
String
getDescription
();
/**
...
...
@@ -41,12 +43,14 @@ public interface DBSObject extends DBPNamedObject, DBPPersistedObject
*
* @return parent object or null
*/
@Nullable
DBSObject
getParentObject
();
/**
* Datasource which this object belongs
* @return datasource reference
*/
@Nullable
DBPDataSource
getDataSource
();
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/sql/SQLResultsConsumer.java
浏览文件 @
9e3951dd
...
...
@@ -18,6 +18,7 @@
*/
package
org.jkiss.dbeaver.runtime.sql
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.model.data.DBDDataReceiver
;
/**
...
...
@@ -33,6 +34,7 @@ public interface SQLResultsConsumer
* @param resultSetNumber result set number
* @return
*/
@Nullable
DBDDataReceiver
getDataReceiver
(
SQLStatementInfo
statement
,
int
resultSetNumber
);
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/transfer/database/DatabaseTransferProducer.java
浏览文件 @
9e3951dd
...
...
@@ -21,6 +21,8 @@ package org.jkiss.dbeaver.tools.transfer.database;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
...
...
@@ -38,15 +40,17 @@ public class DatabaseTransferProducer implements IDataTransferProducer<DatabaseP
static
final
Log
log
=
LogFactory
.
getLog
(
DatabaseTransferProducer
.
class
);
@NotNull
private
DBSDataContainer
dataContainer
;
@Nullable
private
DBDDataFilter
dataFilter
;
public
DatabaseTransferProducer
(
DBSDataContainer
dataContainer
)
public
DatabaseTransferProducer
(
@NotNull
DBSDataContainer
dataContainer
)
{
this
.
dataContainer
=
dataContainer
;
}
public
DatabaseTransferProducer
(
DBSDataContainer
dataContainer
,
DBDDataFilter
dataFilter
)
public
DatabaseTransferProducer
(
@NotNull
DBSDataContainer
dataContainer
,
@Nullable
DBDDataFilter
dataFilter
)
{
this
.
dataContainer
=
dataContainer
;
this
.
dataFilter
=
dataFilter
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/transfer/wizard/DataTransferSettings.java
浏览文件 @
9e3951dd
...
...
@@ -25,6 +25,7 @@ import org.eclipse.jface.dialogs.DialogSettings;
import
org.eclipse.jface.dialogs.IDialogSettings
;
import
org.eclipse.jface.operation.IRunnableContext
;
import
org.eclipse.jface.wizard.IWizardPage
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.core.DBeaverCore
;
import
org.jkiss.dbeaver.registry.transfer.DataTransferNodeDescriptor
;
...
...
@@ -77,7 +78,7 @@ public class DataTransferSettings {
private
transient
int
curPipeNum
=
0
;
public
DataTransferSettings
(
IDataTransferProducer
[]
producers
,
IDataTransferConsumer
[]
consumers
)
public
DataTransferSettings
(
@Nullable
IDataTransferProducer
[]
producers
,
@Nullable
IDataTransferConsumer
[]
consumers
)
{
dataPipes
=
new
ArrayList
<
DataTransferPipe
>();
if
(!
CommonUtils
.
isEmpty
(
producers
)
&&
!
CommonUtils
.
isEmpty
(
consumers
))
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/transfer/wizard/DataTransferWizard.java
浏览文件 @
9e3951dd
...
...
@@ -24,6 +24,7 @@ import org.eclipse.jface.wizard.IWizardPage;
import
org.eclipse.jface.wizard.Wizard
;
import
org.eclipse.ui.IExportWizard
;
import
org.eclipse.ui.IWorkbench
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.core.DBeaverUI
;
...
...
@@ -43,7 +44,7 @@ public class DataTransferWizard extends Wizard implements IExportWizard {
private
DataTransferSettings
settings
;
public
DataTransferWizard
(
IDataTransferProducer
[]
producers
,
IDataTransferConsumer
[]
consumers
)
{
public
DataTransferWizard
(
@Nullable
IDataTransferProducer
[]
producers
,
@Nullable
IDataTransferConsumer
[]
consumers
)
{
this
.
settings
=
new
DataTransferSettings
(
producers
,
consumers
);
loadSettings
();
}
...
...
@@ -82,6 +83,7 @@ public class DataTransferWizard extends Wizard implements IExportWizard {
setNeedsProgressMonitor
(
true
);
}
@Nullable
@Override
public
IWizardPage
getNextPage
(
IWizardPage
page
)
{
...
...
@@ -108,6 +110,7 @@ public class DataTransferWizard extends Wizard implements IExportWizard {
return
pages
[
pages
.
length
-
1
];
}
@Nullable
@Override
public
IWizardPage
getPreviousPage
(
IWizardPage
page
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/UIUtils.java
浏览文件 @
9e3951dd
...
...
@@ -46,6 +46,8 @@ import org.eclipse.ui.handlers.IHandlerService;
import
org.eclipse.ui.services.IServiceLocator
;
import
org.eclipse.ui.swt.IFocusService
;
import
org.eclipse.ui.texteditor.AbstractTextEditor
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.DBeaverConstants
;
import
org.jkiss.dbeaver.core.CoreMessages
;
...
...
@@ -235,12 +237,12 @@ public class UIUtils {
}
}
public
static
void
packColumns
(
Tree
tree
)
public
static
void
packColumns
(
@NotNull
Tree
tree
)
{
packColumns
(
tree
,
false
,
null
);
}
public
static
void
packColumns
(
Tree
tree
,
boolean
fit
,
float
[]
ratios
)
public
static
void
packColumns
(
@NotNull
Tree
tree
,
boolean
fit
,
@Nullable
float
[]
ratios
)
{
tree
.
setRedraw
(
false
);
try
{
...
...
@@ -485,7 +487,8 @@ public class UIUtils {
return
createLabelText
(
parent
,
label
,
value
,
style
,
new
GridData
(
GridData
.
FILL_HORIZONTAL
));
}
public
static
Text
createLabelText
(
Composite
parent
,
String
label
,
String
value
,
int
style
,
Object
layoutData
)
@NotNull
public
static
Text
createLabelText
(
@NotNull
Composite
parent
,
@NotNull
String
label
,
@Nullable
String
value
,
int
style
,
@Nullable
Object
layoutData
)
{
createControlLabel
(
parent
,
label
);
...
...
@@ -501,7 +504,8 @@ public class UIUtils {
return
text
;
}
public
static
Spinner
createLabelSpinner
(
Composite
parent
,
String
label
,
int
value
,
int
minimum
,
int
maximum
)
@NotNull
public
static
Spinner
createLabelSpinner
(
@NotNull
Composite
parent
,
@NotNull
String
label
,
int
value
,
int
minimum
,
int
maximum
)
{
createControlLabel
(
parent
,
label
);
...
...
@@ -513,17 +517,20 @@ public class UIUtils {
return
spinner
;
}
@NotNull
public
static
Button
createLabelCheckbox
(
Composite
parent
,
String
label
,
boolean
checked
)
{
return
createLabelCheckbox
(
parent
,
label
,
null
,
checked
,
SWT
.
NONE
);
}
@NotNull
public
static
Button
createLabelCheckbox
(
Composite
parent
,
String
label
,
String
tooltip
,
boolean
checked
)
{
return
createLabelCheckbox
(
parent
,
label
,
tooltip
,
checked
,
SWT
.
NONE
);
}
public
static
Button
createLabelCheckbox
(
Composite
parent
,
String
label
,
String
tooltip
,
boolean
checked
,
int
style
)
@NotNull
public
static
Button
createLabelCheckbox
(
@NotNull
Composite
parent
,
@NotNull
String
label
,
@Nullable
String
tooltip
,
boolean
checked
,
int
style
)
{
Label
labelControl
=
createControlLabel
(
parent
,
label
);
//labelControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
...
...
@@ -582,22 +589,26 @@ public class UIUtils {
return
button
;
}
@Nullable
public
static
Shell
getActiveShell
()
{
IWorkbench
workbench
=
PlatformUI
.
getWorkbench
();
return
workbench
==
null
?
null
:
getShell
(
workbench
.
getActiveWorkbenchWindow
());
}
@Nullable
public
static
Shell
getShell
(
IShellProvider
provider
)
{
return
provider
==
null
?
null
:
provider
.
getShell
();
}
@Nullable
public
static
Shell
getShell
(
IWorkbenchPart
part
)
{
return
part
==
null
?
null
:
getShell
(
part
.
getSite
());
}
@Nullable
public
static
Integer
getTextInteger
(
Text
text
)
{
String
str
=
text
.
getText
();
...
...
@@ -613,6 +624,7 @@ public class UIUtils {
}
}
@Nullable
public
static
IHandlerActivation
registerKeyBinding
(
IServiceLocator
serviceLocator
,
IAction
action
)
{
IHandlerService
handlerService
=
(
IHandlerService
)
serviceLocator
.
getService
(
IHandlerService
.
class
);
...
...
@@ -647,6 +659,7 @@ public class UIUtils {
return
horizontalLine
;
}
@Nullable
public
static
String
getComboSelection
(
Combo
combo
)
{
int
selectionIndex
=
combo
.
getSelectionIndex
();
...
...
@@ -704,6 +717,7 @@ public class UIUtils {
return
encodingCombo
;
}
@NotNull
public
static
SashForm
createPartDivider
(
final
IWorkbenchPart
workbenchPart
,
Composite
parent
,
int
style
)
{
final
SashForm
sash
=
new
SashForm
(
parent
,
style
);
...
...
@@ -798,7 +812,7 @@ public class UIUtils {
Shell
shell
,
String
title
,
String
message
,
Throwable
error
)
@Nullable
Throwable
error
)
{
if
(
error
instanceof
DBException
&&
DBUtils
.
showDatabaseError
(
shell
,
title
,
message
,
(
DBException
)
error
))
{
// If this DB error was handled by some DB-specific way then just don't care about it
...
...
@@ -818,18 +832,18 @@ public class UIUtils {
}
public
static
void
showErrorDialog
(
Shell
shell
,
String
title
,
String
message
)
@Nullable
Shell
shell
,
@NotNull
String
title
,
@Nullable
String
message
)
{
showErrorDialog
(
shell
,
title
,
message
,
(
Throwable
)
null
);
}
public
static
void
showErrorDialog
(
Shell
shell
,
String
title
,
String
message
,
Collection
<
String
>
errorMessages
)
@Nullable
Shell
shell
,
@NotNull
String
title
,
@Nullable
String
message
,
@NotNull
Collection
<
String
>
errorMessages
)
{
//log.debug(message);
java
.
util
.
List
<
Status
>
messageStatuses
=
new
ArrayList
<
Status
>(
errorMessages
.
size
());
...
...
@@ -849,10 +863,10 @@ public class UIUtils {
}
public
static
void
showErrorDialog
(
final
Shell
shell
,
final
String
title
,
final
String
message
,
final
IStatus
status
)
@Nullable
final
Shell
shell
,
@NotNull
final
String
title
,
@Nullable
final
String
message
,
@NotNull
final
IStatus
status
)
{
//log.debug(message);
Runnable
runnable
=
new
Runnable
()
{
...
...
@@ -872,7 +886,7 @@ public class UIUtils {
runInUI
(
shell
,
runnable
);
}
public
static
void
runInUI
(
Shell
shell
,
Runnable
runnable
)
public
static
void
runInUI
(
@Nullable
Shell
shell
,
@NotNull
Runnable
runnable
)
{
final
Display
display
=
shell
==
null
?
Display
.
getDefault
()
:
shell
.
getDisplay
();
if
(
display
.
getThread
()
!=
Thread
.
currentThread
())
{
...
...
@@ -882,7 +896,8 @@ public class UIUtils {
}
}
public
static
String
formatMessage
(
String
message
,
Object
...
args
)
@NotNull
public
static
String
formatMessage
(
@Nullable
String
message
,
@Nullable
Object
...
args
)
{
if
(
message
==
null
)
{
return
""
;
//$NON-NLS-1$
...
...
@@ -891,7 +906,8 @@ public class UIUtils {
}
}
public
static
Button
createPushButton
(
Composite
parent
,
String
label
,
Image
image
)
@NotNull
public
static
Button
createPushButton
(
@NotNull
Composite
parent
,
@Nullable
String
label
,
@Nullable
Image
image
)
{
Button
button
=
new
Button
(
parent
,
SWT
.
PUSH
);
if
(
label
!=
null
)
{
...
...
@@ -918,6 +934,7 @@ public class UIUtils {
helpContextID
);
}
@NotNull
public
static
Text
createOutputFolderChooser
(
final
Composite
parent
,
String
label
,
ModifyListener
changeListener
)
{
UIUtils
.
createControlLabel
(
parent
,
label
!=
null
?
label
:
CoreMessages
.
data_transfer_wizard_output_label_directory
);
...
...
@@ -972,6 +989,7 @@ public class UIUtils {
return
"<a>"
+
text
+
"</a>"
;
//$NON-NLS-1$ //$NON-NLS-2$
}
@Nullable
public
static
<
T
>
T
findView
(
IWorkbenchWindow
workbenchWindow
,
Class
<
T
>
viewClass
)
{
IViewReference
[]
references
=
workbenchWindow
.
getActivePage
().
getViewReferences
();
...
...
@@ -984,6 +1002,7 @@ public class UIUtils {
return
null
;
}
@Nullable
public
static
IViewPart
findView
(
IWorkbenchWindow
workbenchWindow
,
String
viewId
)
{
IViewReference
[]
references
=
workbenchWindow
.
getActivePage
().
getViewReferences
();
...
...
@@ -1069,6 +1088,7 @@ public class UIUtils {
return
section
;
}
@Nullable
public
static
IWorkbenchPartSite
getWorkbenchPartSite
(
IServiceLocator
serviceLocator
)
{
IWorkbenchPartSite
partSite
=
(
IWorkbenchPartSite
)
serviceLocator
.
getService
(
IWorkbenchPartSite
.
class
);
...
...
@@ -1101,6 +1121,7 @@ public class UIUtils {
return
false
;
}
@Nullable
public
static
ISelectionProvider
getSelectionProvider
(
IServiceLocator
serviceLocator
)
{
ISelectionProvider
selectionProvider
=
(
ISelectionProvider
)
serviceLocator
.
getService
(
ISelectionProvider
.
class
);
...
...
@@ -1140,7 +1161,7 @@ public class UIUtils {
}
/**
* Determine wether this control or any of it's child has focus
* Determine w
h
ether this control or any of it's child has focus
* @param control control to check
* @return true if it has focus
*/
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/datasource/DataSourceConnectHandler.java
浏览文件 @
9e3951dd
...
...
@@ -26,6 +26,8 @@ import org.eclipse.core.runtime.jobs.Job;
import
org.eclipse.core.runtime.jobs.JobChangeAdapter
;
import
org.eclipse.jface.dialogs.IDialogConstants
;
import
org.eclipse.swt.widgets.Display
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.model.DBPEvent
;
import
org.jkiss.dbeaver.model.net.DBWHandlerConfiguration
;
import
org.jkiss.dbeaver.model.runtime.DBRProcessListener
;
...
...
@@ -40,6 +42,7 @@ import org.jkiss.utils.CommonUtils;
public
class
DataSourceConnectHandler
extends
DataSourceHandler
{
@Nullable
@Override
public
Object
execute
(
ExecutionEvent
event
)
throws
ExecutionException
{
...
...
@@ -56,7 +59,11 @@ public class DataSourceConnectHandler extends DataSourceHandler
* @param dataSourceContainer
* @param onFinish
*/
public
static
void
execute
(
DBRProgressMonitor
monitor
,
DBSDataSourceContainer
dataSourceContainer
,
final
DBRProcessListener
onFinish
)
{
public
static
void
execute
(
@Nullable
DBRProgressMonitor
monitor
,
@NotNull
DBSDataSourceContainer
dataSourceContainer
,
@Nullable
final
DBRProcessListener
onFinish
)
{
if
(
dataSourceContainer
instanceof
DataSourceDescriptor
&&
!
dataSourceContainer
.
isConnected
())
{
final
DataSourceDescriptor
dataSourceDescriptor
=
(
DataSourceDescriptor
)
dataSourceContainer
;
if
(!
CommonUtils
.
isEmpty
(
Job
.
getJobManager
().
find
(
dataSourceDescriptor
)))
{
...
...
@@ -153,7 +160,7 @@ public class DataSourceConnectHandler extends DataSourceHandler
false
);
}
public
static
boolean
askForPassword
(
final
DataSourceDescriptor
dataSourceContainer
,
final
DBWHandlerConfiguration
handler
)
public
static
boolean
askForPassword
(
@NotNull
final
DataSourceDescriptor
dataSourceContainer
,
@Nullable
final
DBWHandlerConfiguration
handler
)
{
final
boolean
[]
authResult
=
new
boolean
[]
{
false
};
UIUtils
.
runInUI
(
null
,
new
Runnable
()
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/StandardErrorDialog.java
浏览文件 @
9e3951dd
...
...
@@ -22,6 +22,8 @@ package org.jkiss.dbeaver.ui.dialogs;
import
org.eclipse.core.runtime.IStatus
;
import
org.eclipse.jface.dialogs.ErrorDialog
;
import
org.eclipse.swt.widgets.Shell
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
/**
* StandardErrorDialog
...
...
@@ -29,10 +31,10 @@ import org.eclipse.swt.widgets.Shell;
public
class
StandardErrorDialog
extends
ErrorDialog
{
public
StandardErrorDialog
(
Shell
parentShell
,
String
dialogTitle
,
String
message
,
IStatus
status
,
@NotNull
Shell
parentShell
,
@NotNull
String
dialogTitle
,
@Nullable
String
message
,
@NotNull
IStatus
status
,
int
displayMask
)
{
super
(
parentShell
,
dialogTitle
,
message
,
status
,
displayMask
);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/connection/ConnectionAuthDialog.java
浏览文件 @
9e3951dd
...
...
@@ -20,6 +20,8 @@ package org.jkiss.dbeaver.ui.dialogs.connection;
import
org.eclipse.osgi.util.NLS
;
import
org.eclipse.swt.widgets.Shell
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.model.net.DBWHandlerConfiguration
;
import
org.jkiss.dbeaver.registry.DataSourceDescriptor
;
...
...
@@ -33,7 +35,7 @@ public class ConnectionAuthDialog extends BaseAuthDialog
private
DataSourceDescriptor
dataSource
;
private
DBWHandlerConfiguration
networkHandler
;
public
ConnectionAuthDialog
(
Shell
parentShell
,
DataSourceDescriptor
dataSource
,
DBWHandlerConfiguration
networkHandler
)
public
ConnectionAuthDialog
(
@NotNull
Shell
parentShell
,
@NotNull
DataSourceDescriptor
dataSource
,
@Nullable
DBWHandlerConfiguration
networkHandler
)
{
super
(
parentShell
,
networkHandler
!=
null
?
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
浏览文件 @
9e3951dd
...
...
@@ -47,6 +47,7 @@ import org.eclipse.ui.texteditor.rulers.IColumnSupport;
import
org.eclipse.ui.texteditor.rulers.RulerColumnDescriptor
;
import
org.eclipse.ui.texteditor.rulers.RulerColumnRegistry
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.core.DBeaverActivator
;
...
...
@@ -103,6 +104,10 @@ public class SQLEditor extends SQLEditorBase
{
private
static
final
long
SCRIPT_UI_UPDATE_PERIOD
=
100
;
private
static
Image
IMG_DATA_GRID
=
DBeaverActivator
.
getImageDescriptor
(
"/icons/sql/page_data_grid.png"
).
createImage
();
//$NON-NLS-1$
private
static
Image
IMG_EXPLAIN_PLAN
=
DBeaverActivator
.
getImageDescriptor
(
"/icons/sql/page_explain_plan.png"
).
createImage
();
//$NON-NLS-1$
private
static
Image
IMG_LOG
=
DBeaverActivator
.
getImageDescriptor
(
"/icons/sql/page_error.png"
).
createImage
();
//$NON-NLS-1$
private
SashForm
sashForm
;
private
Control
editorControl
;
private
CTabFolder
resultTabs
;
...
...
@@ -116,23 +121,14 @@ public class SQLEditor extends SQLEditorBase
private
DBSDataSourceContainer
dataSourceContainer
;
private
final
DynamicFindReplaceTarget
findReplaceTarget
=
new
DynamicFindReplaceTarget
();
private
final
List
<
SQLStatementInfo
>
runningQueries
=
new
ArrayList
<
SQLStatementInfo
>();
private
static
Image
imgDataGrid
;
private
static
Image
imgExplainPlan
;
private
static
Image
imgLog
;
private
CompositeSelectionProvider
selectionProvider
;
static
{
imgDataGrid
=
DBeaverActivator
.
getImageDescriptor
(
"/icons/sql/page_data_grid.png"
).
createImage
();
//$NON-NLS-1$
imgExplainPlan
=
DBeaverActivator
.
getImageDescriptor
(
"/icons/sql/page_explain_plan.png"
).
createImage
();
//$NON-NLS-1$
imgLog
=
DBeaverActivator
.
getImageDescriptor
(
"/icons/sql/page_error.png"
).
createImage
();
//$NON-NLS-1$
}
public
SQLEditor
()
{
super
();
}
@Nullable
@Override
public
DBPDataSource
getDataSource
()
{
...
...
@@ -140,12 +136,14 @@ public class SQLEditor extends SQLEditorBase
return
dataSourceContainer
==
null
?
null
:
dataSourceContainer
.
getDataSource
();
}
@Nullable
public
IProject
getProject
()
{
IFile
file
=
ContentUtils
.
convertPathToWorkspaceFile
(
getEditorInput
().
getPath
());
return
file
==
null
?
null
:
file
.
getProject
();
}
@Nullable
@Override
public
int
[]
getCurrentLines
()
{
...
...
@@ -176,6 +174,7 @@ public class SQLEditor extends SQLEditorBase
}
}
@Nullable
@Override
public
DBSDataSourceContainer
getDataSourceContainer
()
{
...
...
@@ -183,7 +182,7 @@ public class SQLEditor extends SQLEditorBase
}
@Override
public
boolean
setDataSourceContainer
(
DBSDataSourceContainer
container
)
public
boolean
setDataSourceContainer
(
@Nullable
DBSDataSourceContainer
container
)
{
if
(
container
==
dataSourceContainer
)
{
return
true
;
...
...
@@ -231,6 +230,7 @@ public class SQLEditor extends SQLEditorBase
return
false
;
}
@Nullable
@Override
public
Object
getAdapter
(
Class
required
)
{
...
...
@@ -376,13 +376,13 @@ public class SQLEditor extends SQLEditorBase
CTabItem
item
=
new
CTabItem
(
resultTabs
,
SWT
.
NONE
);
item
.
setControl
(
planView
.
getControl
());
item
.
setText
(
CoreMessages
.
editors_sql_explain_plan
);
item
.
setImage
(
imgExplainPlan
);
item
.
setImage
(
IMG_EXPLAIN_PLAN
);
item
.
setData
(
planView
);
item
=
new
CTabItem
(
resultTabs
,
SWT
.
NONE
);
item
.
setControl
(
logViewer
);
item
.
setText
(
CoreMessages
.
editors_sql_execution_log
);
item
.
setImage
(
imgLog
);
item
.
setImage
(
IMG_LOG
);
item
.
setData
(
logViewer
);
selectionProvider
.
trackProvider
(
getTextViewer
().
getTextWidget
(),
getTextViewer
());
...
...
@@ -507,7 +507,7 @@ public class SQLEditor extends SQLEditorBase
}
}
private
void
processQueries
(
final
List
<
SQLStatementInfo
>
queries
,
final
boolean
newTab
,
final
boolean
export
)
private
void
processQueries
(
@NotNull
final
List
<
SQLStatementInfo
>
queries
,
final
boolean
newTab
,
final
boolean
export
)
{
if
(
queries
.
isEmpty
())
{
// Nothing to process
...
...
@@ -516,7 +516,10 @@ public class SQLEditor extends SQLEditorBase
try
{
checkSession
();
}
catch
(
DBException
ex
)
{
getResultSetViewer
().
setStatus
(
ex
.
getMessage
(),
true
);
ResultSetViewer
viewer
=
getResultSetViewer
();
if
(
viewer
!=
null
)
{
viewer
.
setStatus
(
ex
.
getMessage
(),
true
);
}
UIUtils
.
showErrorDialog
(
getSite
().
getShell
(),
CoreMessages
.
editors_sql_error_cant_obtain_session
,
...
...
@@ -618,7 +621,7 @@ public class SQLEditor extends SQLEditorBase
}
}
private
void
closeExtraResultTabs
(
QueryProcessor
queryProcessor
)
private
void
closeExtraResultTabs
(
@Nullable
QueryProcessor
queryProcessor
)
{
// Close all tabs except first one
for
(
int
i
=
resultTabs
.
getItemCount
()
-
1
;
i
>
0
;
i
--)
{
...
...
@@ -654,10 +657,11 @@ public class SQLEditor extends SQLEditorBase
for
(
QueryProcessor
queryProcessor
:
queryProcessors
)
{
for
(
QueryResultsProvider
resultsProvider
:
queryProcessor
.
getResultProviders
())
{
if
(
getDataSource
()
==
null
)
{
DBPDataSource
dataSource
=
getDataSource
();
if
(
dataSource
==
null
)
{
resultsProvider
.
getResultSetViewer
().
setStatus
(
CoreMessages
.
editors_sql_status_not_connected_to_database
);
}
else
{
resultsProvider
.
getResultSetViewer
().
setStatus
(
CoreMessages
.
editors_sql_staus_connected_to
+
getDataSource
()
.
getContainer
().
getName
()
+
"'"
);
//$NON-NLS-2$
resultsProvider
.
getResultSetViewer
().
setStatus
(
CoreMessages
.
editors_sql_staus_connected_to
+
dataSource
.
getContainer
().
getName
()
+
"'"
);
//$NON-NLS-2$
}
resultsProvider
.
getResultSetViewer
().
updateFiltersText
();
}
...
...
@@ -788,6 +792,7 @@ public class SQLEditor extends SQLEditorBase
return
ISaveablePart2
.
YES
;
}
@Nullable
@Override
public
ResultSetViewer
getResultSetViewer
()
{
...
...
@@ -802,6 +807,7 @@ public class SQLEditor extends SQLEditorBase
return
curQueryProcessor
==
null
?
null
:
curQueryProcessor
.
getCurrentResults
().
getResultSetViewer
();
}
@Nullable
@Override
public
DBSDataContainer
getDataContainer
()
{
...
...
@@ -820,7 +826,6 @@ public class SQLEditor extends SQLEditorBase
}
return
curQueryProcessor
!=
null
&&
curQueryProcessor
.
getFirstResults
()
!=
null
&&
curQueryProcessor
.
getFirstResults
().
isReadyToRun
();
}
...
...
@@ -877,12 +882,12 @@ public class SQLEditor extends SQLEditorBase
private
void
createResultsProvider
(
int
resultSetNumber
)
{
resultProviders
.
add
(
new
QueryResultsProvider
(
this
,
resultSetNumber
));
}
@NotNull
QueryResultsProvider
getFirstResults
()
{
return
resultProviders
.
isEmpty
()
?
null
:
resultProviders
.
get
(
0
);
return
resultProviders
.
get
(
0
);
}
@NotNull
QueryResultsProvider
getCurrentResults
()
{
if
(!
resultTabs
.
isDisposed
())
{
...
...
@@ -920,6 +925,14 @@ public class SQLEditor extends SQLEditorBase
CoreMessages
.
editors_sql_error_cant_execute_query_message
);
return
;
}
final
DBPDataSource
dataSource
=
getDataSource
();
if
(
dataSource
==
null
)
{
UIUtils
.
showErrorDialog
(
getSite
().
getShell
(),
CoreMessages
.
editors_sql_error_cant_execute_query_title
,
CoreMessages
.
editors_sql_status_not_connected_to_database
);
return
;
}
final
boolean
isSingleQuery
=
(
queries
.
size
()
==
1
);
// Prepare execution job
...
...
@@ -931,7 +944,7 @@ public class SQLEditor extends SQLEditorBase
final
SQLQueryJob
job
=
new
SQLQueryJob
(
getSite
(),
isSingleQuery
?
CoreMessages
.
editors_sql_job_execute_query
:
CoreMessages
.
editors_sql_job_execute_script
,
getDataSource
()
,
dataSource
,
queries
,
this
,
listener
);
...
...
@@ -972,8 +985,9 @@ public class SQLEditor extends SQLEditorBase
}
void
removeResults
(
QueryResultsProvider
resultsProvider
)
{
resultProviders
.
remove
(
resultsProvider
);
if
(
resultProviders
.
isEmpty
())
{
if
(
resultProviders
.
size
()
>
1
)
{
resultProviders
.
remove
(
resultsProvider
);
}
else
{
queryProcessors
.
remove
(
this
);
if
(
curQueryProcessor
==
this
)
{
if
(
queryProcessors
.
isEmpty
())
{
...
...
@@ -985,6 +999,7 @@ public class SQLEditor extends SQLEditorBase
}
}
@Nullable
@Override
public
DBDDataReceiver
getDataReceiver
(
SQLStatementInfo
statement
,
final
int
resultSetNumber
)
{
if
(
curDataReceiver
!=
null
)
{
...
...
@@ -1043,7 +1058,7 @@ public class SQLEditor extends SQLEditorBase
tabName
+=
" "
+
queryIndex
;
}
tabItem
.
setText
(
tabName
);
tabItem
.
setImage
(
imgDataGrid
);
tabItem
.
setImage
(
IMG_DATA_GRID
);
tabItem
.
setData
(
this
);
if
(
queryIndex
>
0
||
resultSetNumber
>
0
)
{
tabItem
.
setShowClose
(
true
);
...
...
@@ -1057,11 +1072,6 @@ public class SQLEditor extends SQLEditorBase
});
}
public
SQLEditor
getOwnerEditor
()
{
return
SQLEditor
.
this
;
}
@Override
public
ResultSetViewer
getResultSetViewer
()
{
...
...
@@ -1085,10 +1095,13 @@ public class SQLEditor extends SQLEditorBase
{
int
features
=
DATA_SELECT
;
final
SQLQueryJob
job
=
queryProcessor
.
curJob
;
if
(
job
!=
null
)
{
if
(
getDataSource
().
getInfo
().
supportsSubqueries
())
{
features
|=
DATA_FILTER
;
if
(
resultSetNumber
==
0
)
{
final
SQLQueryJob
job
=
queryProcessor
.
curJob
;
if
(
job
!=
null
)
{
DBPDataSource
dataSource
=
getDataSource
();
if
(
dataSource
!=
null
&&
dataSource
.
getInfo
().
supportsSubqueries
())
{
features
|=
DATA_FILTER
;
}
}
}
return
features
;
...
...
@@ -1135,12 +1148,14 @@ public class SQLEditor extends SQLEditorBase
return
CoreMessages
.
editors_sql_description
;
}
@Nullable
@Override
public
DBSObject
getParentObject
()
{
return
getDataSourceContainer
();
}
@Nullable
@Override
public
DBPDataSource
getDataSource
()
{
...
...
@@ -1233,7 +1248,7 @@ public class SQLEditor extends SQLEditorBase
}
// Get results window (it is possible that it was closed till that moment
QueryResultsProvider
results
=
queryProcessor
.
getFirstResults
();
if
(
results
!=
null
)
{
{
CTabItem
tabItem
=
results
.
tabItem
;
if
(!
tabItem
.
isDisposed
())
{
tabItem
.
setToolTipText
(
result
.
getStatement
().
getQuery
());
...
...
@@ -1267,11 +1282,9 @@ public class SQLEditor extends SQLEditorBase
}
sashForm
.
setMaximizedControl
(
null
);
QueryResultsProvider
results
=
queryProcessor
.
getFirstResults
();
if
(
results
!=
null
)
{
ResultSetViewer
viewer
=
results
.
getResultSetViewer
();
viewer
.
getModel
().
setStatistics
(
statistics
);
viewer
.
updateStatusMessage
();
}
ResultSetViewer
viewer
=
results
.
getResultSetViewer
();
viewer
.
getModel
().
setStatistics
(
statistics
);
viewer
.
updateStatusMessage
();
}
});
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorInput.java
浏览文件 @
9e3951dd
...
...
@@ -28,6 +28,7 @@ import org.eclipse.ui.IMemento;
import
org.eclipse.ui.IPersistableElement
;
import
org.eclipse.ui.internal.IPreferenceConstants
;
import
org.eclipse.ui.internal.WorkbenchPlugin
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.core.DBeaverCore
;
import
org.jkiss.dbeaver.ext.IAutoSaveEditorInput
;
...
...
@@ -122,10 +123,12 @@ public class SQLEditorInput extends ProjectFileEditorInput implements IPersistab
return
true
;
}
@Nullable
@Override
public
DBPDataSource
getDataSource
()
{
return
getDataSourceContainer
().
getDataSource
();
DBSDataSourceContainer
container
=
getDataSourceContainer
();
return
container
==
null
?
null
:
container
.
getDataSource
();
}
@Nullable
...
...
@@ -148,12 +151,12 @@ public class SQLEditorInput extends ProjectFileEditorInput implements IPersistab
}
}
public
static
void
setScriptDataSource
(
IFile
file
,
DBSDataSourceContainer
dataSourceContainer
)
public
static
void
setScriptDataSource
(
@NotNull
IFile
file
,
@Nullable
DBSDataSourceContainer
dataSourceContainer
)
{
setScriptDataSource
(
file
,
dataSourceContainer
,
false
);
}
public
static
void
setScriptDataSource
(
IFile
file
,
DBSDataSourceContainer
dataSourceContainer
,
boolean
notify
)
public
static
void
setScriptDataSource
(
@NotNull
IFile
file
,
@Nullable
DBSDataSourceContainer
dataSourceContainer
,
boolean
notify
)
{
try
{
file
.
setPersistentProperty
(
PROP_DATA_SOURCE_ID
,
dataSourceContainer
==
null
?
null
:
dataSourceContainer
.
getId
());
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/syntax/SQLSyntaxManager.java
浏览文件 @
9e3951dd
...
...
@@ -27,6 +27,8 @@ import org.eclipse.swt.widgets.Display;
import
org.eclipse.ui.PlatformUI
;
import
org.eclipse.ui.themes.ITheme
;
import
org.eclipse.ui.themes.IThemeManager
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
import
org.jkiss.dbeaver.model.DBPKeywordManager
;
import
org.jkiss.dbeaver.model.impl.EmptyKeywordManager
;
...
...
@@ -67,14 +69,18 @@ public class SQLSyntaxManager extends RuleBasedScanner {
THEME_PROPERTIES
.
add
(
CONFIG_COLOR_TEXT
);
THEME_PROPERTIES
.
add
(
CONFIG_COLOR_BACKGROUND
);
}
private
IThemeManager
themeManager
;
@NotNull
private
final
IThemeManager
themeManager
;
@NotNull
private
DBPKeywordManager
keywordManager
;
@Nullable
private
String
quoteSymbol
;
private
char
structSeparator
;
@NotNull
private
String
catalogSeparator
;
@NotNull
private
String
statementDelimiter
=
SQLConstants
.
DEFAULT_STATEMENT_DELIMITER
;
@NotNull
private
TreeMap
<
Integer
,
SQLScriptPosition
>
positions
=
new
TreeMap
<
Integer
,
SQLScriptPosition
>();
private
Set
<
SQLScriptPosition
>
addedPositions
=
new
HashSet
<
SQLScriptPosition
>();
...
...
@@ -89,7 +95,7 @@ public class SQLSyntaxManager extends RuleBasedScanner {
public
void
dispose
()
{
}
@NotNull
public
DBPKeywordManager
getKeywordManager
()
{
return
keywordManager
;
...
...
@@ -100,26 +106,31 @@ public class SQLSyntaxManager extends RuleBasedScanner {
return
structSeparator
;
}
@NotNull
public
String
getCatalogSeparator
()
{
return
catalogSeparator
;
}
@NotNull
public
String
getStatementDelimiter
()
{
return
statementDelimiter
;
}
@Nullable
public
String
getQuoteSymbol
()
{
return
quoteSymbol
;
}
@NotNull
public
Collection
<?
extends
Position
>
getPositions
(
int
offset
,
int
length
)
{
return
positions
.
subMap
(
offset
,
offset
+
length
).
values
();
}
@NotNull
public
synchronized
Set
<
SQLScriptPosition
>
getRemovedPositions
(
boolean
clear
)
{
Set
<
SQLScriptPosition
>
posList
=
removedPositions
;
...
...
@@ -129,6 +140,7 @@ public class SQLSyntaxManager extends RuleBasedScanner {
return
posList
;
}
@NotNull
public
synchronized
Set
<
SQLScriptPosition
>
getAddedPositions
(
boolean
clear
)
{
Set
<
SQLScriptPosition
>
posList
=
addedPositions
;
...
...
@@ -146,7 +158,7 @@ public class SQLSyntaxManager extends RuleBasedScanner {
structSeparator
=
SQLConstants
.
STRUCT_SEPARATOR
;
catalogSeparator
=
String
.
valueOf
(
SQLConstants
.
STRUCT_SEPARATOR
);
escapeChar
=
'\\'
;
statementDelimiter
=
null
;
statementDelimiter
=
SQLConstants
.
DEFAULT_STATEMENT_DELIMITER
;
}
else
{
keywordManager
=
dataSource
.
getContainer
().
getKeywordManager
();
quoteSymbol
=
dataSource
.
getInfo
().
getIdentifierQuoteString
();
...
...
@@ -222,18 +234,18 @@ public class SQLSyntaxManager extends RuleBasedScanner {
public
boolean
isWordStart
(
char
c
)
{
return
SQLConstants
.
DEFAULT_STATEMENT_DELIMITER
.
charAt
(
0
)
==
c
||
(
statementDelimiter
!=
null
&&
statementDelimiter
.
charAt
(
0
)
==
Character
.
toLowerCase
(
c
)
);
statementDelimiter
.
charAt
(
0
)
==
Character
.
toLowerCase
(
c
);
}
@Override
public
boolean
isWordPart
(
char
c
)
{
return
SQLConstants
.
DEFAULT_STATEMENT_DELIMITER
.
indexOf
(
c
)
!=
-
1
||
(
statementDelimiter
!=
null
&&
statementDelimiter
.
indexOf
(
Character
.
toLowerCase
(
c
))
!=
-
1
)
;
statementDelimiter
.
indexOf
(
Character
.
toLowerCase
(
c
))
!=
-
1
;
}
},
Token
.
UNDEFINED
,
true
);
delimRule
.
addWord
(
SQLConstants
.
DEFAULT_STATEMENT_DELIMITER
,
delimiterToken
);
if
(
statementDelimiter
!=
null
)
{
if
(
!
statementDelimiter
.
equals
(
SQLConstants
.
DEFAULT_STATEMENT_DELIMITER
)
)
{
delimRule
.
addWord
(
statementDelimiter
,
delimiterToken
);
}
rules
.
add
(
delimRule
);
...
...
plugins/org.jkiss.dbeaver.wmi/src/org/jkiss/dbeaver/ext/wmi/model/WMIDataSource.java
浏览文件 @
9e3951dd
...
...
@@ -19,6 +19,7 @@
package
org.jkiss.dbeaver.ext.wmi.model
;
import
org.eclipse.core.runtime.IAdaptable
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.model.DBPConnectionInfo
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
...
...
@@ -50,6 +51,7 @@ public class WMIDataSource implements DBPDataSource, IAdaptable//, DBSObjectCont
this
.
container
=
container
;
}
@NotNull
@Override
public
DBSDataSourceContainer
getContainer
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录