|
Lines 24-32
Link Here
|
| 24 |
import org.eclipse.emf.ecore.EClass; |
24 |
import org.eclipse.emf.ecore.EClass; |
| 25 |
import org.eclipse.emf.ecore.EClassifier; |
25 |
import org.eclipse.emf.ecore.EClassifier; |
| 26 |
import org.eclipse.emf.ecore.EObject; |
26 |
import org.eclipse.emf.ecore.EObject; |
|
|
27 |
import org.eclipse.emf.ecore.EStructuralFeature; |
| 28 |
import org.eclipse.emf.ecore.util.EcoreUtil; |
| 27 |
import org.eclipse.hyades.loaders.cbe.CBEUtils; |
29 |
import org.eclipse.hyades.loaders.cbe.CBEUtils; |
| 28 |
import org.eclipse.hyades.models.cbe.CBECommonBaseEvent; |
30 |
import org.eclipse.hyades.models.cbe.CBECommonBaseEvent; |
| 29 |
import org.eclipse.hyades.models.cbe.CBEPackage; |
31 |
import org.eclipse.hyades.models.cbe.CBEPackage; |
|
|
32 |
import org.eclipse.hyades.models.hierarchy.extensions.BinaryExpression; |
| 33 |
import org.eclipse.hyades.models.hierarchy.extensions.LogicalExpression; |
| 34 |
import org.eclipse.hyades.models.hierarchy.extensions.Operand; |
| 35 |
import org.eclipse.hyades.models.hierarchy.extensions.SimpleOperand; |
| 36 |
import org.eclipse.hyades.models.hierarchy.extensions.SimpleSearchQuery; |
| 37 |
import org.eclipse.hyades.models.hierarchy.extensions.WhereExpression; |
| 38 |
import org.eclipse.hyades.models.hierarchy.util.internal.QueryUtils; |
| 30 |
import org.eclipse.hyades.sd.logc.internal.loader.LogInteractions; |
39 |
import org.eclipse.hyades.sd.logc.internal.loader.LogInteractions; |
| 31 |
import org.eclipse.hyades.trace.ui.HyadesUtil; |
40 |
import org.eclipse.hyades.trace.ui.HyadesUtil; |
| 32 |
import org.eclipse.hyades.trace.ui.ViewSelectionChangedEvent; |
41 |
import org.eclipse.hyades.trace.ui.ViewSelectionChangedEvent; |
|
Lines 47-52
Link Here
|
| 47 |
import org.eclipse.tptp.platform.log.views.internal.LogViewsPlugin; |
56 |
import org.eclipse.tptp.platform.log.views.internal.LogViewsPlugin; |
| 48 |
import org.eclipse.tptp.platform.log.views.internal.actions.provider.ILogFindProvider; |
57 |
import org.eclipse.tptp.platform.log.views.internal.actions.provider.ILogFindProvider; |
| 49 |
import org.eclipse.tptp.platform.log.views.internal.navigator.LogNavigator; |
58 |
import org.eclipse.tptp.platform.log.views.internal.navigator.LogNavigator; |
|
|
59 |
import org.eclipse.tptp.platform.log.views.internal.views.ComponentIdentificationFilterAttribute; |
| 50 |
import org.eclipse.ui.IViewPart; |
60 |
import org.eclipse.ui.IViewPart; |
| 51 |
import org.eclipse.ui.IWorkbench; |
61 |
import org.eclipse.ui.IWorkbench; |
| 52 |
import org.eclipse.ui.IWorkbenchPage; |
62 |
import org.eclipse.ui.IWorkbenchPage; |
|
Lines 319-322
Link Here
|
| 319 |
public static boolean isSymptomEditorAvailable() { |
329 |
public static boolean isSymptomEditorAvailable() { |
| 320 |
return (Platform.getBundle("org.eclipse.tptp.monitoring.symptom.editor")!=null); |
330 |
return (Platform.getBundle("org.eclipse.tptp.monitoring.symptom.editor")!=null); |
| 321 |
} |
331 |
} |
|
|
332 |
|
| 333 |
public static SimpleSearchQuery addFilterReference(SimpleSearchQuery filter) { |
| 334 |
if (filter==null) |
| 335 |
return QueryUtils.getEmptyQuery(); |
| 336 |
|
| 337 |
SimpleSearchQuery filterCopy = (SimpleSearchQuery)EcoreUtil.copy(filter); |
| 338 |
LogicalExpression expression = (LogicalExpression)(filterCopy.getWhereExpression()); |
| 339 |
checkFeatures(filterCopy,expression, null); |
| 340 |
|
| 341 |
return filterCopy; |
| 342 |
} |
| 343 |
|
| 344 |
private static void checkFeatures(SimpleSearchQuery filterCopy, WhereExpression expression, LogicalExpression parent) { |
| 345 |
if (expression == null) return; |
| 346 |
|
| 347 |
if (expression instanceof LogicalExpression) { |
| 348 |
LogicalExpression lExpression = (LogicalExpression)expression; |
| 349 |
for (int i=lExpression.getArguments().size()-1; i>=0; i--) { |
| 350 |
WhereExpression exp= (WhereExpression)(lExpression.getArguments().get(i)); |
| 351 |
if (exp!=null) checkFeatures(filterCopy, exp,lExpression); |
| 352 |
} |
| 353 |
} |
| 354 |
else if (expression instanceof BinaryExpression) { |
| 355 |
BinaryExpression bExpression = (BinaryExpression)expression; |
| 356 |
Operand leftOperand = bExpression.getLeftOperand(); |
| 357 |
if (leftOperand==null) return; |
| 358 |
if (leftOperand instanceof SimpleOperand && ((SimpleOperand)leftOperand).getFeature() instanceof EStructuralFeature) { |
| 359 |
EStructuralFeature feature = (EStructuralFeature)(((SimpleOperand)leftOperand).getFeature()); |
| 360 |
if (feature == CBEPackage.eINSTANCE.getCBEDefaultElement_Name() || |
| 361 |
feature == CBEPackage.eINSTANCE.getCBEDefaultElement_Values() || |
| 362 |
feature == CBEPackage.eINSTANCE.getCBEDefaultElement_Children() || |
| 363 |
feature == CBEPackage.eINSTANCE.getCBEExtendedDataElement_HexValue() || |
| 364 |
feature == CBEPackage.eINSTANCE.getCBEExtendedDataElement_Type()) { |
| 365 |
|
| 366 |
if (!filterCopy.getRequiredPaths().contains(CBEPackage.Literals.CBE_DEFAULT_EVENT__EXTENDED_PROPERTIES)) |
| 367 |
filterCopy.getRequiredPaths().add(CBEPackage.Literals.CBE_DEFAULT_EVENT__EXTENDED_PROPERTIES); |
| 368 |
} |
| 369 |
else if (feature == CBEPackage.eINSTANCE.getCBEComponentIdentification_Component() || |
| 370 |
feature == CBEPackage.eINSTANCE.getCBEComponentIdentification_ComponentIdType() || |
| 371 |
feature == CBEPackage.eINSTANCE.getCBEComponentIdentification_ComponentType() || |
| 372 |
feature == CBEPackage.eINSTANCE.getCBEComponentIdentification_ExecutionEnvironment() || |
| 373 |
feature == CBEPackage.eINSTANCE.getCBEComponentIdentification_InstanceId() || |
| 374 |
feature == CBEPackage.eINSTANCE.getCBEComponentIdentification_Location() || |
| 375 |
feature == CBEPackage.eINSTANCE.getCBEComponentIdentification_LocationType() || |
| 376 |
feature == CBEPackage.eINSTANCE.getCBEComponentIdentification_ProcessId() || |
| 377 |
feature == CBEPackage.eINSTANCE.getCBEComponentIdentification_SubComponent() || |
| 378 |
feature == CBEPackage.eINSTANCE.getCBEComponentIdentification_ThreadId()) { |
| 379 |
|
| 380 |
if (((SimpleOperand)leftOperand).getValue().equals(ComponentIdentificationFilterAttribute.SOURCE_COMPONENT_ID)) { |
| 381 |
if (!filterCopy.getRequiredPaths().contains(CBEPackage.Literals.CBE_COMMON_BASE_EVENT__SOURCE_COMPONENT_ID)) |
| 382 |
filterCopy.getRequiredPaths().add(CBEPackage.Literals.CBE_COMMON_BASE_EVENT__SOURCE_COMPONENT_ID); |
| 383 |
} |
| 384 |
else { |
| 385 |
if (!filterCopy.getRequiredPaths().contains(CBEPackage.Literals.CBE_COMMON_BASE_EVENT__REPORTER_COMPONENT_ID)) |
| 386 |
filterCopy.getRequiredPaths().add(CBEPackage.Literals.CBE_COMMON_BASE_EVENT__REPORTER_COMPONENT_ID); |
| 387 |
} |
| 388 |
} |
| 389 |
else if (feature == CBEPackage.eINSTANCE.getCBEContextDataElement_ContextId() || |
| 390 |
feature == CBEPackage.eINSTANCE.getCBEContextDataElement_ContextValue() || |
| 391 |
feature == CBEPackage.eINSTANCE.getCBEContextDataElement_Name() || |
| 392 |
feature == CBEPackage.eINSTANCE.getCBEContextDataElement_Type()) { |
| 393 |
|
| 394 |
if (!filterCopy.getRequiredPaths().contains(CBEPackage.Literals.CBE_COMMON_BASE_EVENT__CONTEXT_DATA_ELEMENTS)) |
| 395 |
filterCopy.getRequiredPaths().add(CBEPackage.Literals.CBE_COMMON_BASE_EVENT__CONTEXT_DATA_ELEMENTS); |
| 396 |
} |
| 397 |
else if (feature == CBEPackage.eINSTANCE.getCBEMsgDataElement_MsgCatalog() || |
| 398 |
feature == CBEPackage.eINSTANCE.getCBEMsgDataElement_MsgCatalogId() || |
| 399 |
feature == CBEPackage.eINSTANCE.getCBEMsgDataElement_MsgCatalogTokens() || |
| 400 |
feature == CBEPackage.eINSTANCE.getCBEMsgDataElement_MsgCatalogType() || |
| 401 |
feature == CBEPackage.eINSTANCE.getCBEMsgDataElement_MsgId() || |
| 402 |
feature == CBEPackage.eINSTANCE.getCBEMsgDataElement_MsgIdType() || |
| 403 |
feature == CBEPackage.eINSTANCE.getCBEMsgDataElement_MsgLocale()) { |
| 404 |
if (!filterCopy.getRequiredPaths().contains(CBEPackage.Literals.CBE_COMMON_BASE_EVENT__MSG_DATA_ELEMENT)) |
| 405 |
filterCopy.getRequiredPaths().add(CBEPackage.Literals.CBE_COMMON_BASE_EVENT__MSG_DATA_ELEMENT); |
| 406 |
} |
| 407 |
else if (feature == CBEPackage.eINSTANCE.getCBEAvailableSituation_AvailabilityDisposition() || |
| 408 |
feature == CBEPackage.eINSTANCE.getCBEAvailableSituation_OperationDisposition() || |
| 409 |
feature == CBEPackage.eINSTANCE.getCBEAvailableSituation_ProcessingDisposition() || |
| 410 |
feature == CBEPackage.eINSTANCE.getCBEConfigureSituation_SuccessDisposition() || |
| 411 |
feature == CBEPackage.eINSTANCE.getCBEConnectSituation_SituationDisposition() || |
| 412 |
feature == CBEPackage.eINSTANCE.getCBEConnectSituation_SuccessDisposition() || |
| 413 |
feature == CBEPackage.eINSTANCE.getCBECreateSituation_SuccessDisposition() || |
| 414 |
feature == CBEPackage.eINSTANCE.getCBEDependencySituation_DependencyDisposition() || |
| 415 |
feature == CBEPackage.eINSTANCE.getCBEDestroySituation_SuccessDisposition() || |
| 416 |
feature == CBEPackage.eINSTANCE.getCBEFeatureSituation_FeatureDisposition() || |
| 417 |
feature == CBEPackage.eINSTANCE.getCBEOtherSituation_AnyData() || |
| 418 |
feature == CBEPackage.eINSTANCE.getCBEReportSituation_ReportCategory() || |
| 419 |
feature == CBEPackage.eINSTANCE.getCBERequestSituation_SituationQualifier() || |
| 420 |
feature == CBEPackage.eINSTANCE.getCBERequestSituation_SuccessDisposition() || |
| 421 |
feature == CBEPackage.eINSTANCE.getCBESituation_CategoryName() || |
| 422 |
feature == CBEPackage.eINSTANCE.getCBESituation_ReasoningScope() || |
| 423 |
feature == CBEPackage.eINSTANCE.getCBEStartSituation_SituationQualifier() || |
| 424 |
feature == CBEPackage.eINSTANCE.getCBEStartSituation_SuccessDisposition() || |
| 425 |
feature == CBEPackage.eINSTANCE.getCBEStopSituation_SituationQualifier() || |
| 426 |
feature == CBEPackage.eINSTANCE.getCBEStopSituation_SuccessDisposition()) { |
| 427 |
|
| 428 |
if (!filterCopy.getRequiredPaths().contains(CBEPackage.Literals.CBE_COMMON_BASE_EVENT__SITUATION)) |
| 429 |
filterCopy.getRequiredPaths().add(CBEPackage.Literals.CBE_COMMON_BASE_EVENT__SITUATION); |
| 430 |
} |
| 431 |
} |
| 432 |
} |
| 433 |
return; |
| 434 |
} |
| 322 |
} |
435 |
} |