/* * @see ILabelProvider#getText(Object) */ @Override public String getText(Object element) { TreeStructuredElement treeElement = (TreeStructuredElement) element; String name = treeElement.getName(); if (treeElement.getType() == TreeType.EXECUTION_CONDITION_TYPE) { if (((ExecutionCondition) treeElement).isMethodExecutionCondition()) { ExecutionCondition methodExecutionCondition = (ExecutionCondition) treeElement; if (methodExecutionCondition.getPatternMapping() != null) { String methodName = ExecutionConditionUtils.getEscapedNameFromPattern( methodExecutionCondition.getPatternMapping().getBehaviorPattern()); int index = methodName.indexOf("#"); // $NON-NLS-1$ if (index >= 0) { methodName = methodName.substring(index + 1, methodName.length()); } name += " : " + methodName; // $NON-NLS-1$ } } } else if (treeElement.getType() == TreeType.CLASS_TYPE) { name = ExecutionConditionUtils.getClassNameFromPattern(name); } else if (treeElement.getType() == TreeType.PACKAGE_TYPE) { name = ExecutionConditionUtils.getEscapedNameFromPattern(name); } return name; }
public ManageMethodExecutionConditionCommand( MappedTreeStructuredElement executionConditionContainer, ExecutionCondition executionCondition) { super(executionConditionContainer, executionCondition, false); packageRootType = executionCondition.getAntecesor(TreeType.PACKAGE_ROOT_TYPE); this.keyParents = new String[] {"", "", "", ""}; // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ this.levelOrder = new TreeType[] { TreeType.PROJECT_TYPE, TreeType.PACKAGE_ROOT_TYPE, TreeType.PACKAGE_TYPE, TreeType.CLASS_TYPE }; setLabel( Messages.getString( "org.isistan.flabot.executionmapping.commands.executioncondition.ManageMethodExecutionConditionCommand.commandDeleteName")); //$NON-NLS-1$ }