Package com._1c.g5.v8.dt.qw.ui.utils
Class QueryWizardServiceUtils
java.lang.Object
com._1c.g5.v8.dt.qw.ui.utils.QueryWizardServiceUtils
Services methods for query wizard
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addErrorMessage
(StringBuilder errorMessage, String message, int lineNumber, int columnNumber) Append issue description to errors messagestatic DbViewElement
computeDbView
(org.eclipse.emf.ecore.EObject object) ComputesDbViewElement
by objectstatic List<DbViewElement>
computeDbViewFields
(org.eclipse.emf.ecore.EObject object) Compute dbView fieldsstatic DbViewElement
computeDbViewForTempTable
(DbViewElement element, QueryWizardSource source) Compute DbView for temporary table.static QuerySchemaExpression
copyExpression
(QuerySchemaExpression expression) Get expression copystatic QuerySchemaExpression
copyExpression
(QuerySchemaExpression expression, NestedTableExpression parentNestedTable) Make copy of query schema expression.static org.eclipse.jface.dialogs.MessageDialog
createMessageDialog
(org.eclipse.swt.widgets.Shell shell, String errorMessage) Creates warning message dialog with text of errors and warnings from Query.static org.eclipse.jface.dialogs.MessageDialog
createMessageDialog
(org.eclipse.swt.widgets.Shell shell, String errorMessage, boolean askQuestion) Creates message dialog with text of errors and warnings from Query.static void
expandJoinsToChangedItems
(QueryWizardTreeViewer tree, List<QuerySchemaSource> changedSources) Expand joins tree to changed itemsstatic FunctionInvocationExpression
getAggregateFromExpressions
(org.eclipse.emf.common.util.EList<QuerySchemaExpression> fields) Is collection of expressions contain aggregate fieldstatic org.eclipse.swt.graphics.Image
getAliasImage
(QueryWizardSource source, Object element) Get image for aliasstatic List<QuerySchemaQuerySourceJoin>
getAllJoins
(QuerySchemaOperator operator) Get all joins in operatorstatic List<QuerySchemaQuerySourceJoin>
getAllJoins
(QueryWizardSource qwSource) Get all joins in operatorstatic List<QuerySchemaExpression>
getAllNestedTables
(org.eclipse.emf.common.util.EList<QuerySchemaExpression> fields) Get all nested tablesstatic Set<QuerySchemaSource>
getAllSources
(QuerySchemaOperator operator) Returns all sources contained in operatorstatic void
getConditionAndExpressions
(AbstractExpression condition, List<AbstractExpression> expressions) Break condition on expressions by AND operationstatic FunctionInvocationExpression
Get aggregate from expressionstatic List<DbViewFieldDef>
getDbViewElementFields
(DbViewElement element, QueryWizardSource source) Provides the list of fields for selectedDbViewElement
static List<DbViewFieldDef>
getDbViewFieldFields
(DbViewFieldDef sourceItem, QueryWizardSource queryWizardSource) Get children fields in fieldstatic List<DbViewFieldDef>
getDbViewFieldFields
(DbViewFieldDef sourceItem, QueryWizardSource queryWizardSource, boolean suppressNotifications) Get children fields in fieldstatic DbViewElement
getDbViewForQuery
(org.eclipse.emf.ecore.EObject source) Get DbView for nested querystatic String
getDcsFieldText
(Object element, QueryWizardSource source) Get dcs field textstatic String
getEmptyQuery
(ScriptVariant scriptVariant) Get empty query textstatic String
getExpressionAlias
(QueryWizardSource source, QuerySchemaExpression expression) Get alias for expressionstatic String
getExpressionText
(Object element, QueryWizardSource source) Get text for expressionstatic String
getExpressionText
(Object element, QueryWizardSource source, boolean removeLinesSeparators) Get text for expressionstatic String
getJoinPresentation
(QuerySchemaJoinType joinType) Get join type string presentationstatic String
getLocalName
(Object element, ScriptVariant scriptVariant) Get object name, depending of script variantstatic org.eclipse.core.resources.IProject
getParentProject
(org.eclipse.core.resources.IProject project, IV8ProjectManager v8ProjectManager) Returns the parent project ofIProject
if it's extension project or null otherwisestatic AbstractQuerySchemaTable
getPlacementTable
(QueryWizardSource source) Get table for placement from querystatic QuerySchemaExpression
Get presentation for ref expressionstatic List<? extends DbViewElement>
getQuerySchemaSourceFields
(Object sourceItem, QueryWizardSource queryWizardsource) Get fields for source or field from sourcestatic ScriptVariant
getScriptVariant
(org.eclipse.emf.ecore.EObject object) Get current script variant (English or Russian)static QuerySchemaSource
getSourceFromJoin
(Object source) Get source from joinstatic DbViewFromQuery
getTempTableDbView
(QuerySchemaSource source) Is source temporary tablestatic String
getTempTableName
(QuerySchemaSource tempTable) Get temporary table description namestatic Map<String,
QuerySchemaSelectQuery> getTempTables
(QueryWizardSource source) Get temporary tables available for current querystatic Map<String,
QuerySchemaSelectQuery> getTempTables
(QueryWizardSource source, int queryIndex) Get temporary tables available for query by indexgetTempTablesNames
(QueryWizardSource source) Get temporary tables names used in querygetTempTablesNames
(QueryWizardSource source, int endQueryIndex) Get temporary tables names available for query by indexstatic String
getTreeItemText
(org.eclipse.swt.widgets.TreeItem item) Get tree item text, use '.' as separator for fields, and '[]' for nested table part.static String
getTypeAsString
(TypeDescription type, QueryWizardSource source) Get TypeDescription as stringstatic String
getTypeAsString
(TypeDescription type, QueryWizardSource source, ScriptVariant scriptVariant) Get TypeDescription as stringstatic IV8Project
getV8project
(org.eclipse.emf.ecore.EObject object) Get the V8 project by specified object.static void
handleQueryWizardEditException
(QueryWizardEditProviderException qwException, QueryWizardControl qwControl) Processing query wizard exceptionstatic boolean
isContainIndex
(QueryWizardSource source, String value) Is index contain given expressionstatic boolean
isContainOrder
(QueryWizardSource source, String value) Is order contain given expressionstatic boolean
isContainTotal
(QueryWizardSource source, String value) Returns whether totals contain given expressionstatic boolean
isExpressionContainSource
(String sourceAlias, org.eclipse.emf.ecore.EObject expression) Is expression contain source aliasstatic boolean
isExpressionsInGroupings
(QuerySchemaOperator operator) If groupings have expressions - return truestatic boolean
isExtensionProject
(org.eclipse.core.resources.IProject project, IV8ProjectManager v8ProjectManager) Checks whether theIProject
is extension projectstatic boolean
isNestedTableInGroupings
(QuerySchemaOperator operator) If groupings have nested table - return truestatic boolean
isNestedTableInOperator
(QuerySchemaOperator operator) If operator have nested table - return truestatic boolean
isNestedTableInOperator
(QueryWizardSource source, int queryIndex, int operatorIndex) If operator have nested table - return truestatic boolean
isNumberExpression
(QueryWizardSource source, QuerySchemaExpression expression) Returns whether expression have number typestatic boolean
isObjectBelongsToCurrentProject
(DbViewElement dbView, IV8Project v8Project, IV8ProjectManager v8ProjectManager) Checks whether theDbViewElement
belongs to the selectedIProject
static boolean
isObjectBelongsToCurrentProject
(DbViewElement dbView, QueryWizardSource source) static boolean
isObjectBelongsToCurrentProject
(DbViewElement dbView, org.eclipse.core.resources.IProject project, IV8ProjectManager v8ProjectManager) Checks whether theDbViewElement
belongs to the selectedIProject
static boolean
isObjectBelongsToCurrentProject
(org.eclipse.emf.ecore.EObject eObject, IV8Project v8Project, IV8ProjectManager v8ProjectManager) Checks whether theEObject
belongs to the selectedIProject
static boolean
isObjectBelongsToCurrentProject
(org.eclipse.emf.ecore.EObject eObject, QueryWizardSource source) static boolean
isObjectBelongsToCurrentProject
(org.eclipse.emf.ecore.EObject eObject, org.eclipse.core.resources.IProject project, IV8ProjectManager v8ProjectManager) Checks whether theEObject
belongs to the selectedIProject
static boolean
isPresentationAlias
(QuerySchemaExpression expression, QueryWizardSource source) Is expressions from alias contain PRESENTATION functionstatic boolean
isPresentationExpression
(AbstractExpression expression) Is expression contain PRESENTATION functionstatic boolean
isQueriesEquals
(String query1, String query2) Is queries text equalsstatic boolean
isTempTableDescription
(QuerySchemaSource source, QueryWizardSource qwSource) Is source temporary table descriptionstatic String
normalizeString
(String text) Remove from text special characters and extra spacesstatic String
prepareQueryForTextModule
(String query, String lineFormatter, String lineSeparator) Prepare query text for text modulestatic boolean
replaceSourceAliasInExpression
(String[] oldAndNewAliases, org.eclipse.emf.ecore.EObject expression) Replace source alias in expressionstatic boolean
replaceSourceAliasInExpression
(String sourceAlias, String newSourceAlias, org.eclipse.emf.ecore.EObject expression) Replace source alias in expressionstatic void
setCanMove
(TreeViewer tree, org.eclipse.jface.action.Action moveUpAction, org.eclipse.jface.action.Action moveDownAction) Set enabled state for actions move up or move downstatic boolean
validateAlias
(QueryWizardControl queryWizard, String newAlias, List<String> existAliases) Check is valid alias for expression.static String
validateResource
(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.xtext.validation.IResourceValidator resourceValidator) Checking query schema on errorsstatic String
validateResource
(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.xtext.validation.IResourceValidator resourceValidator, boolean onlyCritical) Checking query schema on errors
-
Constructor Details
-
QueryWizardServiceUtils
public QueryWizardServiceUtils()
-
-
Method Details
-
getDbViewForQuery
Get DbView for nested query- Parameters:
source
- QuerySchemaNestedQuery- Returns:
- DbViewDef for source. Return null if parent container of nested query expression is not operator
-
computeDbView
ComputesDbViewElement
by object- Parameters:
object
- computeDbViewElement
for this object- Returns:
- computed
DbViewElement
-
computeDbViewFields
Compute dbView fields- Parameters:
object
- - fields source- Returns:
- fields collection
-
getAllSources
Returns all sources contained in operator- Parameters:
operator
-- Returns:
- all sources in operator
-
getJoinPresentation
Get join type string presentation- Parameters:
joinType
- join type- Returns:
- string presentation
-
getConditionAndExpressions
public static void getConditionAndExpressions(AbstractExpression condition, List<AbstractExpression> expressions) Break condition on expressions by AND operation- Parameters:
condition
- contain expression with binary operations. Not nullexpressions
- collection for storing expressions from condition (broke by AND operation). Not null
-
expandJoinsToChangedItems
public static void expandJoinsToChangedItems(QueryWizardTreeViewer tree, List<QuerySchemaSource> changedSources) Expand joins tree to changed items- Parameters:
tree
- tree viewerchangedSources
- list of changed sources
-
handleQueryWizardEditException
public static void handleQueryWizardEditException(QueryWizardEditProviderException qwException, QueryWizardControl qwControl) Processing query wizard exception- Parameters:
qwException
- query wizard exceptionqwControl
- parent query wizard control
-
isNestedTableInOperator
public static boolean isNestedTableInOperator(QueryWizardSource source, int queryIndex, int operatorIndex) If operator have nested table - return true- Parameters:
querySchema
- QueryWizardSourcequeryIndex
- query indexoperatorIndex
- operator index in query- Returns:
- true if is nested table in operator
-
isNestedTableInOperator
If operator have nested table - return true- Parameters:
operator
-- Returns:
- true if is nested table in operator
-
isNestedTableInGroupings
If groupings have nested table - return true- Parameters:
operator
-- Returns:
- true if is nested table in groupings
-
isExpressionsInGroupings
If groupings have expressions - return true- Parameters:
operator
-- Returns:
- true if is expression in groupings
-
getSourceFromJoin
Get source from join- Parameters:
source
- QuerySchemaSource- Returns:
- query schema source
-
copyExpression
Get expression copy- Parameters:
expression
- query schema expression- Returns:
- copy of expression
-
copyExpression
public static QuerySchemaExpression copyExpression(QuerySchemaExpression expression, NestedTableExpression parentNestedTable) Make copy of query schema expression. If expression from nested table, expression will be copied with parent nested table.- Parameters:
expression
- query schema expressionparentNestedTable
- parent nested table- Returns:
- expression copy
-
isExpressionContainSource
public static boolean isExpressionContainSource(String sourceAlias, org.eclipse.emf.ecore.EObject expression) Is expression contain source alias- Parameters:
sourceAlias
- source aliasexpression
- query schema expression- Returns:
- if contained - return true
-
replaceSourceAliasInExpression
public static boolean replaceSourceAliasInExpression(String[] oldAndNewAliases, org.eclipse.emf.ecore.EObject expression) Replace source alias in expression- Parameters:
oldAndNewAliases
- strings array with old and new aliasesexpression
- query schema expression- Returns:
- true if source alias was found
-
replaceSourceAliasInExpression
public static boolean replaceSourceAliasInExpression(String sourceAlias, String newSourceAlias, org.eclipse.emf.ecore.EObject expression) Replace source alias in expression- Parameters:
sourceAlias
- source aliasnewSourceAlias
- new source alias. If null, alias will not be replaced.expression
- query schema expression- Returns:
- true if source alias was found
-
getAggregateFromExpressions
public static FunctionInvocationExpression getAggregateFromExpressions(org.eclipse.emf.common.util.EList<QuerySchemaExpression> fields) Is collection of expressions contain aggregate field- Parameters:
fields
- fields list- Returns:
- first found aggregate, if contained or null otherwise
-
getTempTablesNames
Get temporary tables names used in query- Parameters:
source
- query wizard source- Returns:
- temporary tables names
-
getTempTablesNames
Get temporary tables names available for query by index- Parameters:
source
- - query wizard sourceendQueryIndex
- - query index- Returns:
- available temporary tables names
-
getTempTables
Get temporary tables available for current query- Parameters:
source
- - query wizard source- Returns:
- available temporary tables
-
getTempTables
public static Map<String,QuerySchemaSelectQuery> getTempTables(QueryWizardSource source, int queryIndex) Get temporary tables available for query by index- Parameters:
source
- - query wizard sourcequeryIndex
- - query index- Returns:
- available temporary tables
-
getContainedAggregate
Get aggregate from expression- Parameters:
field
- abstract expression- Returns:
- aggregate, if contained or null otherwise
-
getTreeItemText
Get tree item text, use '.' as separator for fields, and '[]' for nested table part.- Parameters:
item
- tree item- Returns:
- text for tree item
-
isTempTableDescription
Is source temporary table description- Parameters:
source
- - query schema source- Returns:
- true if temporary table description
-
getTempTableDbView
Is source temporary table- Parameters:
source
- - query schema source- Returns:
- true if source is temporary table
-
getLocalName
Get object name, depending of script variant- Parameters:
element
- - object for getting namescriptVariant
- - configuration script variant- Returns:
- object name
-
isContainOrder
Is order contain given expression- Parameters:
source
- query wizard sourcevalue
- expression or alias- Returns:
- true if contain
-
isContainIndex
Is index contain given expression- Parameters:
source
- query wizard sourcevalue
- expression or alias- Returns:
- true if contain
-
isContainTotal
Returns whether totals contain given expression- Parameters:
source
- query wizard sourcevalue
- expression or alias- Returns:
- true if contain
-
isNumberExpression
public static boolean isNumberExpression(QueryWizardSource source, QuerySchemaExpression expression) Returns whether expression have number type- Parameters:
source
- - query wizard sourceexpression
- - expression- Returns:
- is number type
-
getTempTableName
Get temporary table description name- Parameters:
tempTable
- - temporary table source- Returns:
- table name
-
getAllJoins
Get all joins in operator- Parameters:
qwSource
- - query wizard source- Returns:
- all joins in current operator
-
getAllJoins
Get all joins in operator- Parameters:
operator
- - operator- Returns:
- all joins in current operator
-
getPlacementTable
Get table for placement from query- Parameters:
source
- - query wizard control- Returns:
- if query have table for placement - return table, otherwise null
-
validateResource
public static String validateResource(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.xtext.validation.IResourceValidator resourceValidator) Checking query schema on errors- Parameters:
resource
- - checking resourceresourceValidator
- - resource validator- Returns:
- null if no errors or errors text description
-
validateResource
public static String validateResource(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.xtext.validation.IResourceValidator resourceValidator, boolean onlyCritical) Checking query schema on errors- Parameters:
resource
- - checking resourceresourceValidator
- - resource validatoronlyCritical
- - check only critical errors- Returns:
- null if no errors or errors text description
-
addErrorMessage
public static void addErrorMessage(StringBuilder errorMessage, String message, int lineNumber, int columnNumber) Append issue description to errors message- Parameters:
errorMessage
- - errors messages listmessage
- - new error messagelineNumber
- - line number with errorcolumnNumber
- - column number with error
-
computeDbViewForTempTable
public static DbViewElement computeDbViewForTempTable(DbViewElement element, QueryWizardSource source) Compute DbView for temporary table. My be it from parent query (for nested query)- Parameters:
element
- - temporary table dbview- Returns:
- real dbview
-
getEmptyQuery
Get empty query text- Parameters:
script
- variant- Returns:
- query text
-
getScriptVariant
Get current script variant (English or Russian)- Returns:
- script variant
-
getV8project
Get the V8 project by specified object.- Returns:
- v8project the V8 project, never
null
-
getAllNestedTables
public static List<QuerySchemaExpression> getAllNestedTables(org.eclipse.emf.common.util.EList<QuerySchemaExpression> fields) Get all nested tables- Parameters:
fields
- - fields collection- Returns:
- nested tables collection
-
setCanMove
public static void setCanMove(TreeViewer tree, org.eclipse.jface.action.Action moveUpAction, org.eclipse.jface.action.Action moveDownAction) Set enabled state for actions move up or move down- Parameters:
tree
- - tree viewermoveUpAction
- - move up actionmoveDownAction
- - move down action
-
normalizeString
Remove from text special characters and extra spaces- Parameters:
text
- - text- Returns:
- normalized text
-
getExpressionAlias
Get alias for expression- Parameters:
source
- - query wizard sourceexpression
- - expression from select fields- Returns:
- expression alias
-
getAliasImage
public static org.eclipse.swt.graphics.Image getAliasImage(QueryWizardSource source, Object element) Get image for alias- Parameters:
source
- query wizard sourceelement
- expression- Returns:
- image. Return null if image not found.
-
getDbViewFieldFields
public static List<DbViewFieldDef> getDbViewFieldFields(DbViewFieldDef sourceItem, QueryWizardSource queryWizardSource) Get children fields in field- Parameters:
sourceItem
- - parent field, cannot benull
queryWizardSource
- - query wizard source, cannot benull
- Returns:
- children fields, never
null
, can be empty collection
-
getDbViewFieldFields
public static List<DbViewFieldDef> getDbViewFieldFields(DbViewFieldDef sourceItem, QueryWizardSource queryWizardSource, boolean suppressNotifications) Get children fields in field- Parameters:
sourceItem
- - parent field, cannot benull
queryWizardSource
- - query wizard source, cannot benull
suppressNotifications
- - notifications suppression flag- Returns:
- children fields, never
null
, can be empty collection
-
getExpressionText
Get text for expression- Parameters:
element
- - expressionsource
- - query wizard source return text
-
getExpressionText
public static String getExpressionText(Object element, QueryWizardSource source, boolean removeLinesSeparators) Get text for expression- Parameters:
element
- - expressionsource
- - query wizard sourceremoveLinesSeparators
- - remove lines separators return text
-
getTypeAsString
Get TypeDescription as string- Parameters:
type
- - TypeDescriptionsource
- - query wizard source- Returns:
- string presentation
-
getQuerySchemaSourceFields
public static List<? extends DbViewElement> getQuerySchemaSourceFields(Object sourceItem, QueryWizardSource queryWizardsource) Get fields for source or field from source- Parameters:
sourceItem
- - source or fieldqueryWizardsource
- - query wizard source- Returns:
- array of fields
-
getDcsFieldText
Get dcs field text- Parameters:
element
- - dcs expressionsource
- - query wizard source- Returns:
- expression text
-
getTypeAsString
public static String getTypeAsString(TypeDescription type, QueryWizardSource source, ScriptVariant scriptVariant) Get TypeDescription as string- Parameters:
type
- - TypeDescriptionsource
- - query wizard sourcescriptVariant
- - script variant- Returns:
- string presentation
-
validateAlias
public static boolean validateAlias(QueryWizardControl queryWizard, String newAlias, List<String> existAliases) Check is valid alias for expression. Will show message dialog if not valid.- Parameters:
queryWizard
- - query wizard dialognewAlias
- - new aliasexistAliases
- - exist aliases- Returns:
- true if valid alias
-
getPresentationForRefExpression
public static QuerySchemaExpression getPresentationForRefExpression(QueryWizardSource source, QuerySchemaExpression field) Get presentation for ref expression- Parameters:
source
- - query wizard sourcefield
- - expression- Returns:
- expression presentation or null if field not ref
-
isPresentationExpression
Is expression contain PRESENTATION function- Parameters:
expression
- - expression- Returns:
- true if expression contain PRESENTATION function
-
isPresentationAlias
public static boolean isPresentationAlias(QuerySchemaExpression expression, QueryWizardSource source) Is expressions from alias contain PRESENTATION function- Parameters:
expression
- - expression from aliassource
- - query wizard source- Returns:
- true if alias contain presentation function
-
isQueriesEquals
Is queries text equals- Parameters:
query1
- - query textquery2
- - query text- Returns:
- true if equals otherwise false
-
prepareQueryForTextModule
public static String prepareQueryForTextModule(String query, String lineFormatter, String lineSeparator) Prepare query text for text module- Parameters:
query
- - query textlineFormatter
- - line formatterlineSeparator
- - line separator- Returns:
- formatted query text for text module
-
createMessageDialog
public static org.eclipse.jface.dialogs.MessageDialog createMessageDialog(org.eclipse.swt.widgets.Shell shell, String errorMessage, boolean askQuestion) Creates message dialog with text of errors and warnings from Query. Dialog will have one "OK" button ifaskQuestion
isfalse
or two buttons Yes and No ifaskQuestion
istrue
. Also ifaskQuestion
istrue
dialog will be Question dialog, otherwise Warning- Parameters:
shell
- activeShell
, cannot benull
errorMessage
- string contains all messages of errors and warnings, cannot benull
- Returns:
- created message dialog with text of errors and warnings from Query, never
null
-
createMessageDialog
public static org.eclipse.jface.dialogs.MessageDialog createMessageDialog(org.eclipse.swt.widgets.Shell shell, String errorMessage) Creates warning message dialog with text of errors and warnings from Query. Dialog will have one "OK" button.- Parameters:
shell
- activeShell
, cannot benull
errorMessage
- string contains all messages of errors and warnings, cannot benull
- Returns:
- created message dialog with text of errors and warnings from Query, never
null
-
getDbViewElementFields
public static List<DbViewFieldDef> getDbViewElementFields(DbViewElement element, QueryWizardSource source) Provides the list of fields for selectedDbViewElement
- Parameters:
element
- currentDbViewElement
, cannot benull
source
- selectedQueryWizardSource
, cannot benull
- Returns:
- the list of fields, never
null
, can be empty collection
-
isObjectBelongsToCurrentProject
public static boolean isObjectBelongsToCurrentProject(DbViewElement dbView, org.eclipse.core.resources.IProject project, IV8ProjectManager v8ProjectManager) Checks whether theDbViewElement
belongs to the selectedIProject
- Parameters:
dbView
- the dbView element, cannot benull
project
- the project, cannot benull
v8ProjectManager
- the v8 project manager, cannot benull
- Returns:
true
if element belongs to the project,false
otherwise
-
isObjectBelongsToCurrentProject
public static boolean isObjectBelongsToCurrentProject(DbViewElement dbView, IV8Project v8Project, IV8ProjectManager v8ProjectManager) Checks whether theDbViewElement
belongs to the selectedIProject
- Parameters:
dbView
- the dbView element, cannot benull
v8Project
- the v8 project, cannot benull
v8ProjectManager
- the v8 project manager, cannot benull
- Returns:
true
if element belongs to the project,false
otherwise
-
isObjectBelongsToCurrentProject
public static boolean isObjectBelongsToCurrentProject(org.eclipse.emf.ecore.EObject eObject, org.eclipse.core.resources.IProject project, IV8ProjectManager v8ProjectManager) Checks whether theEObject
belongs to the selectedIProject
- Parameters:
eObject
- theEObject
, cannot benull
project
- the project, cannot benull
v8ProjectManager
- the v8 project manager, cannot benull
- Returns:
true
if element belongs to the project,false
otherwise
-
isObjectBelongsToCurrentProject
public static boolean isObjectBelongsToCurrentProject(org.eclipse.emf.ecore.EObject eObject, IV8Project v8Project, IV8ProjectManager v8ProjectManager) Checks whether theEObject
belongs to the selectedIProject
- Parameters:
eObject
- theEObject
, cannot benull
v8Project
- the v8 project, cannot benull
v8ProjectManager
- the v8 project manager, cannot benull
- Returns:
true
if element belongs to the project,false
otherwise
-
isObjectBelongsToCurrentProject
public static boolean isObjectBelongsToCurrentProject(DbViewElement dbView, QueryWizardSource source) - Parameters:
eObject
- the dbView element, cannot benull
source
- the query wizard source, cannot benull
- Returns:
true
if element belongs to the project,false
otherwise
-
isObjectBelongsToCurrentProject
public static boolean isObjectBelongsToCurrentProject(org.eclipse.emf.ecore.EObject eObject, QueryWizardSource source) - Parameters:
eObject
- theEObject
, cannot benull
source
- the query wizard source, cannot benull
- Returns:
true
if element belongs to the project,false
otherwise
-
isExtensionProject
public static boolean isExtensionProject(org.eclipse.core.resources.IProject project, IV8ProjectManager v8ProjectManager) Checks whether theIProject
is extension project- Parameters:
project
- theIProject
, cannot benull
v8ProjectManager
- theIV8ProjectManager
, cannot benull
- Returns:
true
if the project is the extension,false
otherwise
-
getParentProject
public static org.eclipse.core.resources.IProject getParentProject(org.eclipse.core.resources.IProject project, IV8ProjectManager v8ProjectManager) Returns the parent project ofIProject
if it's extension project or null otherwise- Parameters:
project
- theIProject
, cannot benull
v8ProjectManager
- theIV8ProjectManager
, cannot benull
- Returns:
IProject
if the project is the extension,null
otherwise
-