Commit 1ab1b893 authored by Carmen Carlan's avatar Carmen Carlan
Browse files

Fixed comments and code review for AF3SelectionDialogUtils class.



Issue-ref: 3986
Signed-off-by: Carmen Carlan's avatarCarmen Carlan <carlan@fortiss.org>
parent dbbd1726
AF3SelectionDialogUtils.java ec3c06f56289b7d2e73734c8d2b3c8cbd864363e RED
AF3SelectionDialogUtils.java 606c377620ecf8902101585cf60fa8117397bf30 GREEN
DropdownDialog.java 1ec9b26db0e5c2cf40f1761de7bb9a0e3b1b1355 GREEN
GSNSelectionDialogUtils.java 01cdc5c80a6d678e47b39d4dbd571de15b283d8f GREEN
InstantiationOfGSNElementsUtils.java 7f928f584cf3d978c35e9aad3f93049f6e82c832 RED
......
......@@ -58,7 +58,6 @@ import org.fortiss.tooling.kernel.ui.presentation.ModelElementLabelProvider;
import junit.framework.TestSuite;
// TODO Lots of code duplication! Also, further minor issues (missing static imports, ...)
/**
* Utility class to let user select an {@link IModelElement} from
* {@link ElementTreeSingleSelectDialog} or from {@link ElementTreeMultiSelectDialog}.
......@@ -429,12 +428,9 @@ public class AF3SelectionDialogUtils {
}
/**
* opens a dialog for selecting on component which is referenced to the argument element
*
* @param shell
* @param root
* @param selected
* @return list of components
* This method creates a tree dialog which displays all the existing {@link Component}s
* within the given list of {@link EObject}s. The user can choose only one
* {@link Component}.
*/
public static Component selectComponent(final Shell shell, List<? extends EObject> root,
Component selected) {
......@@ -460,14 +456,10 @@ public class AF3SelectionDialogUtils {
}
return selected;
}
/**
* opens a dialog for selecting on component which is referenced to the argument element
*
* @param shell
* @param root
* @param alreadyReferenced
* @param selected
* @return list of components
* This method creates a tree dialog which displays all the existing system model elements
* within the given list of {@link EObject}s. The user can choose one or more elements.
*/
public static List<Object> selectMultipleReferences(final Shell shell,
List<? extends EObject> root, List<EObject> alreadyReferenced, EObject selected) {
......@@ -510,7 +502,9 @@ public class AF3SelectionDialogUtils {
List<Object> selectedElements = d.getSelectedElements();
if(!selectedElements.containsAll(impactedElements)) {
boolean go = openConfirm(getCurrent().getActiveShell(), "",
"You have impacted changes, that references System Model Elements, which are not set as connected to this Argument Element. Would you like to add them to the referenced list?");
"You have impacted changes, that references System Model Elements " +
"that are not set as connected to this Argument Element. " +
"Would you like to add them to the referenced list?");
if(go) {
selectedElements.addAll(
impactedElements.stream().filter(i -> !selectedElements.contains(i))
......@@ -524,10 +518,8 @@ public class AF3SelectionDialogUtils {
}
/**
* @param shell
* @param root
* @param selected
* @return dialog
* This method creates a tree dialog which displays all the existing system model elements
* within the given list of {@link EObject}s. The user can choose exactly one element.
*/
public static EObject selectSystemModelElement(final Shell shell, List<? extends EObject> root,
EObject selected) {
......@@ -537,12 +529,12 @@ public class AF3SelectionDialogUtils {
/** {@inheritDoc} */
@Override
public List<? extends EObject> getChildren(EObject parent) {
List<ModeAutomaton> modeAutomata = new ArrayList<ModeAutomaton>();
List<StateAutomaton> stateAutomata = new ArrayList<StateAutomaton>();
new ArrayList<ModeAutomaton>();
new ArrayList<StateAutomaton>();
if(parent instanceof Component) {
modeAutomata = pickInstanceOf(ModeAutomaton.class,
pickInstanceOf(ModeAutomaton.class,
((Component)parent).getSpecifications());
stateAutomata = pickInstanceOf(StateAutomaton.class,
pickInstanceOf(StateAutomaton.class,
((Component)parent).getSpecifications());
}
return pickInstanceOf(asList(new Class<?>[] {Requirement.class,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment