Package com._1c.g5.v8.dt.qw.ui.utils
Class QueryWizardSource
java.lang.Object
java.util.Observable
com._1c.g5.v8.dt.qw.ui.utils.QueryWizardSource
Contains query schema and hold current query and current operator.
Also sync changes in query schema and notifies listeners about changes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Notification of change with valueclass
Edit adapter for query schema sourcestatic enum
Type of source change -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Integer
static final Integer
static final Integer
static final Integer
static final Integer
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final Integer
-
Constructor Summary
ConstructorsConstructorDescriptionQueryWizardSource
(QuerySchema querySchema, org.eclipse.core.resources.IProject project, IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager) Creates query wizard sourceQueryWizardSource
(QueryWizardSource qwSource, IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager) Creates query wizard source -
Method Summary
Modifier and TypeMethodDescriptionvoid
Disable change notificationsvoid
Enable change notificationsReturn current adapterGet all aliases used in queryGet available tables for query schemaGetsIBmModelManager
serviceCollection<org.eclipse.xtext.validation.Issue>
Returns schema issues calculated on lastrecalculateIssues(QuerySchemaBuilder)
call.org.eclipse.emf.common.util.EList<QuerySchemaExpression>
Return current indexes collectionGet current nested query, if was setReturn current operatorint
Return current operator indexorg.eclipse.emf.common.util.EList<QuerySchemaOperator>
Return current operatorsReturn current queryint
Return current query indexGet current fields mappingGet DbViewVirtualFieldProcessorGet DerivedTypeComputerForDbViewQuerygetEObjectText
(org.eclipse.emf.ecore.EObject object) Get EObject textGet cached expressions textorg.eclipse.emf.ecore.EObject
getExpressionPrototype
(int prototype, boolean checkScriptVariant) Get prototype of expressiongetFuncByName
(String name) Get FunctionExpression by nameorg.eclipse.core.resources.IProject
Get projectGets actualQlDerivedFunctionProvider
Get multiLang proposalsGet ql mapperGet queriesGet all parameters used in querygetQueryParameters
(boolean isAddAmpersand) Get all parameters used in queryReturn query schema.org.eclipse.xtext.validation.IResourceValidator
Get resource validatorGet current script variant (English or Russian)org.eclipse.xtext.serializer.ISerializer
Returns serializergetTempQuerySchema
(org.eclipse.core.resources.IProject project) Get temporary query schemagetTempTableFields
(QuerySchemaSource source) Get available fields for temporary tableGet type checkerGet v8 project managerboolean
Is used query schema for dcsboolean
Is enabled change notificationsvoid
Use this method for notify that query schema will be modified.void
notifyChange
(int notifyType) Notify adapter about changevoid
notifyChange
(int notifyType, Object value) Notify adapter about changevoid
Notify undo or redo ationvoid
recalculateIssues
(QuerySchemaBuilder builder) Recalculates schema issues.void
Refresh query schema modelvoid
setAvailableTables
(List<AvailableTable> availableTables) Set available tables for query schemavoid
setCurrentIndexes
(int index) Set current indexesvoid
setCurrentNestedQuery
(QuerySchemaSource nestedQuerySource) Set current nested query from query schema for workingvoid
setCurrentOperatorIndex
(int index) Set current operator indexvoid
setCurrentQueryIndex
(int index) Set current query indexvoid
setQuerySchema
(QuerySchema querySchema) Set query schemavoid
setQuerySchema
(QuerySchema querySchema, boolean addEditAdapter) Set query schemavoid
setQuerySchemaByCopy
(QuerySchema querySchema) Set query schema by copyvoid
setTempTableFields
(QuerySchemaSource source, List<?> fields) Set available fields for temporary tableCheck query schema on errorsMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Field Details
-
QUERY_SCHEMA_SOURCES_REMOVE
public static final int QUERY_SCHEMA_SOURCES_REMOVE- See Also:
-
QUERY_SCHEMA_SOURCES_REMOVE_ALL
public static final int QUERY_SCHEMA_SOURCES_REMOVE_ALL- See Also:
-
QUERY_SCHEMA_SOURCES_ADD
public static final int QUERY_SCHEMA_SOURCES_ADD- See Also:
-
QUERY_SCHEMA_SELECT_FIELD_SET
public static final int QUERY_SCHEMA_SELECT_FIELD_SET- See Also:
-
QUERY_SCHEMA_ALIAS_REMOVE
public static final int QUERY_SCHEMA_ALIAS_REMOVE- See Also:
-
QUERY_SCHEMA_SOURCES_CHANGE
public static final int QUERY_SCHEMA_SOURCES_CHANGE- See Also:
-
QUERY_SCHEMA_FILTER
public static final int QUERY_SCHEMA_FILTER- See Also:
-
QUERY_SCHEMA_FIELD_ALIAS_CHANGED
public static final int QUERY_SCHEMA_FIELD_ALIAS_CHANGED- See Also:
-
QUERY_SCHEMA_ORDER
public static final int QUERY_SCHEMA_ORDER- See Also:
-
QUERY_SCHEMA_VIRTUAL_TABLE_PARAMETERS_CHANGED
public static final int QUERY_SCHEMA_VIRTUAL_TABLE_PARAMETERS_CHANGED- See Also:
-
QUERY_SCHEMA_BEFORE_REMOVE_TEMPORARY_TABLE
public static final int QUERY_SCHEMA_BEFORE_REMOVE_TEMPORARY_TABLE- See Also:
-
QUERY_SCHEMA_TOTALS_CONTROLS_POINTS
public static final int QUERY_SCHEMA_TOTALS_CONTROLS_POINTS- See Also:
-
QUERY_SCHEMA_TOTALS_EXPRESSIONS
public static final int QUERY_SCHEMA_TOTALS_EXPRESSIONS- See Also:
-
QUERY_SCHEMA_DCS_SELECT_FIELDS
public static final int QUERY_SCHEMA_DCS_SELECT_FIELDS- See Also:
-
QUERY_SCHEMA_DCS_CONDITIONS
public static final int QUERY_SCHEMA_DCS_CONDITIONS- See Also:
-
QUERY_SOURCE_ALIAS_CHANGED
public static final int QUERY_SOURCE_ALIAS_CHANGED- See Also:
-
QUERY_SCHEMA_FIELD_ADD
public static final int QUERY_SCHEMA_FIELD_ADD- See Also:
-
SUM_EXPRESSION
-
MIN_EXPRESSION
-
MAX_EXPRESSION
-
AVG_EXPRESSION
-
COUNT_EXPRESSION
-
CONDITION_AND_EXPRESSION
-
-
Constructor Details
-
QueryWizardSource
public QueryWizardSource(QuerySchema querySchema, org.eclipse.core.resources.IProject project, IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager) Creates query wizard source- Parameters:
querySchema
- - querySchema query schema, cannot benull
project
- - context project, cannot benull
v8ProjectManager
- - v8 project manager, cannot benull
bmModelManager
-IBmModelManager
service reference, cannot benull
-
QueryWizardSource
public QueryWizardSource(QueryWizardSource qwSource, IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager) Creates query wizard source- Parameters:
qwSource
- - base query wizard source. Call notifyBeforeChange before editing query schema, cannot benull
v8ProjectManager
- - v8 project manager, cannot benull
bmModelManager
-IBmModelManager
service reference, cannot benull
-
-
Method Details
-
setQuerySchema
Set query schema- Parameters:
querySchema
-
-
setQuerySchemaByCopy
Set query schema by copy- Parameters:
querySchema
- - query schema
-
setQuerySchema
Set query schema- Parameters:
querySchema
-addEditAdapter
- - is need edit adapter. "false" can be if using query schema from another query wizard source, and also have edit adapter
-
isDcsMode
public boolean isDcsMode()Is used query schema for dcs- Returns:
- if query schema for dcs return true
-
getAdapter
Return current adapter- Returns:
-
getQuerySchema
Return query schema. Not use QuerySchema for getting queries. Use getQueries()- Returns:
- query schema
-
getQueries
Get queries- Returns:
- queries collection
-
getCurrentQuery
Return current query- Returns:
- current query
-
getCurrentIndexes
Return current indexes collection- Returns:
- current indexes collection, can be
null
if current query does not provide indexes
-
getCurrentRootFieldsMapping
Get current fields mapping- Returns:
- fields mapping
-
getCurrentOperator
Return current operator- Returns:
- current operator. Can be null if current query is not QuerySchemaSelectQuery or current operator index is not valid
-
getCurrentOperators
Return current operators- Returns:
- current operators. Can be null if current query is not QuerySchemaSelectQuery
-
setCurrentQueryIndex
public void setCurrentQueryIndex(int index) Set current query index- Parameters:
index
- - current query index
-
setCurrentIndexes
public void setCurrentIndexes(int index) Set current indexes- Parameters:
index
- index of current indexes set or 0 if indexes should be get fromQuerySchemaSelectQuery
-
setCurrentOperatorIndex
public void setCurrentOperatorIndex(int index) Set current operator index- Parameters:
index
- - current operator index
-
getCurrentQueryIndex
public int getCurrentQueryIndex()Return current query index- Returns:
- current query index
-
getCurrentOperatorIndex
public int getCurrentOperatorIndex()Return current operator index- Returns:
- current operator index
-
getTypeChecker
Get type checker- Returns:
- type checker
-
getQlGeneratorMultiLangProposals
Get multiLang proposals- Returns:
- multiLang proposals
-
getQlDerivedFunctionProvider
Gets actualQlDerivedFunctionProvider
- Returns:
- actual
QlDerivedFunctionProvider
, nevernull
-
getTempTableFields
Get available fields for temporary table- Returns:
- fields collection
-
setTempTableFields
Set available fields for temporary table- Parameters:
fields
- - fields collection
-
notifyBeforeChange
public void notifyBeforeChange()Use this method for notify that query schema will be modified. After call query schema will be replaced by copy, just one time for several calls. For copy-on-write support. -
refreshModel
public void refreshModel()Refresh query schema model -
getScriptVariant
Get current script variant (English or Russian)- Returns:
- script variant
-
getExpressionPrototype
public org.eclipse.emf.ecore.EObject getExpressionPrototype(int prototype, boolean checkScriptVariant) Get prototype of expression- Parameters:
prototype
- idcheckScriptVariant
- if need check current script variantproject
- current project- Returns:
- expression prototype
-
getTempQuerySchema
Get temporary query schema- Parameters:
project
- - project- Returns:
- query schema
-
validateQuerySchema
Check query schema on errors- Returns:
- null if no errors, or errors descriptions in query schema
-
notifyChange
public void notifyChange(int notifyType) Notify adapter about change- Parameters:
notifyType
-
-
notifyChange
Notify adapter about change- Parameters:
notifyType
-value
- changed value
-
getDbViewVirtualFieldProcessor
Get DbViewVirtualFieldProcessor- Returns:
- DbViewVirtualFieldProcessor
-
getDerivedTypeDbViewComputer
Get DerivedTypeComputerForDbViewQuery- Returns:
- DerivedTypeComputerForDbViewQuery
-
getQlMapper
Get ql mapper- Returns:
- ql mapper
-
getSerializer
public org.eclipse.xtext.serializer.ISerializer getSerializer()Returns serializer- Returns:
- serializer
-
getResourceValidator
public org.eclipse.xtext.validation.IResourceValidator getResourceValidator()Get resource validator- Returns:
- resource validator
-
getProject
public org.eclipse.core.resources.IProject getProject()Get project- Returns:
- current project, never
null
-
getV8ProjectManager
Get v8 project manager- Returns:
- current project, never
null
-
getBmModelManager
GetsIBmModelManager
service- Returns:
IBmModelManager
service reference, cannot benull
-
disableChangeNotifications
public void disableChangeNotifications()Disable change notifications -
enableChangeNotifications
public void enableChangeNotifications()Enable change notifications -
isEnabledChangeNotifications
public boolean isEnabledChangeNotifications()Is enabled change notifications- Returns:
-
getQueryParameters
Get all parameters used in query- Returns:
- list of parameters
-
getQueryParameters
Get all parameters used in query- Parameters:
isAddAmpersand
- - add ampersand before parameter- Returns:
- list of parameters
-
setAvailableTables
Set available tables for query schema- Parameters:
availableTables
-
-
getAvailableTables
Get available tables for query schema- Parameters:
availableTables
-
-
setCurrentNestedQuery
Set current nested query from query schema for working- Parameters:
nestedQuerySource
-
-
getCurrentNestedQuery
Get current nested query, if was set- Returns:
- nested query if was set, otherwise null
-
getExpressinsTextCache
Get cached expressions text- Returns:
-
getAllAliases
Get all aliases used in query- Returns:
- list of aliases
-
notifyUndoRedoAtions
public void notifyUndoRedoAtions()Notify undo or redo ation -
getEObjectText
Get EObject text- Parameters:
object
- - object- Returns:
- object text
-
getFuncByName
Get FunctionExpression by name- Parameters:
name
- - function name- Returns:
- FunctionExpression or null if not found
-
recalculateIssues
Recalculates schema issues.- Parameters:
builder
- - builder to build query schema. Cannot benull
.
-
getCachedIssues
Returns schema issues calculated on lastrecalculateIssues(QuerySchemaBuilder)
call.- Returns:
- cached schema issues. Cannot return
null
.
-