Commit 7cd8bd6d authored by Tiziano Munaro's avatar Tiziano Munaro
Browse files

Merge remote-tracking branch 'origin/master' into 3452

parents ac570481 58edf189
AllocationPatternFXController.java 840bc404f6aefb8bc0e6f9b25f156d9db647178b GREEN
CouplingPatternFXController.java 937034aa2dd680abfcd815c32deb5f322663dc37 GREEN
AllocationPatternFXController.java 13cb6ad773ab746f167ee2f5684987b5be2e1424 GREEN
CouplingPatternFXController.java 4c6df087c82cdd5cee00936e73faf5cdf92f7a24 GREEN
MemoryPatternFXController.java b45b1eb1418d75cc4f4b2983b996b8ef4abab58d GREEN
SafetyPatternFXController.java 4d84c1bd15d1f8d15475849c5e2b9c24f094b76e GREEN
......@@ -28,6 +28,7 @@ import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeVie
import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.RadioButton;
import javafx.scene.control.SelectionMode;
import javafx.scene.control.ToggleGroup;
import javafx.scene.control.TreeTableView;
import javafx.scene.control.TreeView;
......@@ -184,6 +185,10 @@ public class AllocationPatternFXController extends PatternFXControllerBase {
allocationButton.setToggleGroup(group);
dislocationButton.setToggleGroup(group);
allocationButton.setSelected(true);
// sets the selection mode of the viewer to allow at most one row selected
taskView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
ecuView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
}
/** {@inheritDoc} */
......
......@@ -42,6 +42,7 @@ import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeVie
import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.RadioButton;
import javafx.scene.control.SelectionMode;
import javafx.scene.control.ToggleGroup;
import javafx.scene.control.TreeTableView;
import javafx.scene.control.TreeView;
......@@ -169,6 +170,9 @@ public class CouplingPatternFXController extends PatternFXControllerBase {
couplingButton.setToggleGroup(group);
decouplingButton.setToggleGroup(group);
couplingButton.setSelected(true);
// sets the selection mode of the viewer to allow multiple rows to be selected
view.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
}
/** {@inheritDoc} */
......
BusBandwidthOptimizationPatternFXController.java 51a11a64e1a94c8ce97e41cb2e9f0d81cdf691b8 GREEN
HardwareOptimizationPatternFXController.java 28d125e40b85e5054e40c046eb4a27e70589ebb4 GREEN
BusBandwidthOptimizationPatternFXController.java a8ca53c3dd130b80454f0272d4a6563465a7e8c2 GREEN
HardwareOptimizationPatternFXController.java d9bcf15caf37c784e80dbd9e5375c133217d8061 GREEN
......@@ -202,7 +202,7 @@ public class BusBandwidthOptimizationPatternFXController extends PatternFXContro
maxButton.setToggleGroup(group);
minButton.setSelected(true);
// sets the selection mode of the viewer to allow at most one row selected
// sets the selection mode of the viewer to allow only one row to be selected
view.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
}
......
......@@ -264,10 +264,12 @@ public class HardwareOptimizationPatternFXController extends PatternFXController
countButton.setToggleGroup(aggrGroup);
sumButton.setSelected(true);
// sets the selection mode of the viewer to allow at most one row selected
// sets the selection mode of the viewer to allow multiple rows to be selected
ecuView.getSelectionModel().selectAll();
propertyView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
taskView.getSelectionModel().selectAll();
ecuView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
propertyView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
taskView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
}
/** {@inheritDoc} */
......
......@@ -149,42 +149,6 @@
modelElementClass="org.fortiss.af3.safetycases.model.OptionEntity">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.safetycases.ui.handler.SafetyClaimPatternsDatabaseHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.requirementspatterns.model.PatternsDatabase">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.safetycases.ui.handler.WordAndObjectTypeHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.requirementspatterns.model.WordAndObjectType">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.safetycases.ui.handler.SafetyClaimPatternsCollectionHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.requirementspatterns.model.SafetyClaimPatternsCollection">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.safetycases.ui.handler.SafetyClaimPatternHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.requirementspatterns.model.SafetyClaimPattern">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.safetycases.ui.handler.LibraryPatternsDatabaseHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.requirementspatterns.model.LibraryPatternsDatabase">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.safetycases.ui.handler.LibraryPatternsDatabasePackageHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.requirementspatterns.model.LibraryPatternsDatabasePackage">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.safetycases.ui.handler.SafetyArgumentationPackageHandler">
<modelElementClass
......@@ -327,16 +291,6 @@
contributor="org.fortiss.af3.safetycases.ui.commands.ConnectToSystemModelElements">
</contextMenuContribution>
</extension>
<extension
point="org.eclipse.ui.views">
<view
class="org.fortiss.af3.safetycases.ui.views.RequirementsPatternsView"
icon="icons/patterns.png"
id="org.fortiss.af3.safetycases.ui.requirementspatterns"
name="Safety Claim Pattern Properties"
restorable="true">
</view>
</extension>
<extension
point="org.fortiss.tooling.kernel.ui.contextMenuContribution">
<contextMenuContribution
......
AF3SelectionDialogUtils.java 606c377620ecf8902101585cf60fa8117397bf30 GREEN
DropdownDialog.java 1ec9b26db0e5c2cf40f1761de7bb9a0e3b1b1355 GREEN
GSNSelectionDialogUtils.java 01cdc5c80a6d678e47b39d4dbd571de15b283d8f GREEN
InstantiationOfGSNElementsUtils.java 7f928f584cf3d978c35e9aad3f93049f6e82c832 RED
InstantiationOfGSNElementsUtils.java 17c317ebdf5b1ba3e98df37622a519d07c444ac4 GREEN
MaintenanceUtils.java 6666dea44eb6784c9f23c0c549bd6eada1eb1e17 GREEN
MultiPageWizard.java a901e2eb4967e3663b71a96cb22948283c200c2c GREEN
OptionEntityInstantiation.java 05f5cf61184d6db033b47d58c19492799468943e GREEN
......
RequirementsPatternsView.java 92a9d930a27ef5ffed116086c5e2aee5b180bb62 RED
/*-------------------------------------------------------------------------+
| Copyright 2013 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.safetycases.ui.views;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.part.ViewPart;
/**
* TODO (CC, #3174)
* IMPORTANT: This view will be in the future deleted and the code will be moved elsewhere.
* This is why it stays for the moment marked as red.
*
* A view for the attributes of requirements patterns.
*
* @author carlan
*/
public class RequirementsPatternsView extends ViewPart implements ISelectionListener {
/** {@inheritDoc} */
@Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
// TODO Auto-generated method stub
}
/** {@inheritDoc} */
@Override
public void createPartControl(Composite parent) {
// TODO Auto-generated method stub
}
/** {@inheritDoc} */
@Override
public void setFocus() {
// TODO Auto-generated method stub
}
// public RequirementsPatternsView() {
// }
//
// /** Currently selected element. */
// private ILayoutedModelElement currentlySelectedElement;
//
// /** {@link Text} displaying the the string of the word. */
// private Text wordText;
//
// /** {@link Text} displaying the type of element the word will reference to. */
// private Text objectTypeText;
//
// /** {@link Text} displaying the text of the sentence. */
// private Text sentenceText;
//
// private Label wordLabel;
// private Label objectTypeLabel;
// private Label sentenceLabel;
// private Label gsnTypeLabel;
// private Label wordsLabel;
// private Label objectTypesLabel;
//
// EMFDataBindingContext dbc = new EMFDataBindingContext();
//
// private ComboViewer comboWords;
// private ComboViewer comboObjectTypes;
// private ComboViewer gsnType;
//
// private Button addWordButton;
//
// /** {@inheritDoc} */
// @Override
// public void createPartControl(Composite parent) {
// Composite composite = new Composite(parent, SWT.NONE);
// createGUIForWordAndObjectTypeAttributes(composite);
// createGUIForSentenceAttribute(composite);
// getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(this);
// }
//
// /**
// * @param composite
// */
// private void createGUIForSentenceAttribute(Composite composite) {
// sentenceLabel = createLabel(composite, "The sentence", false, 10, 25, 75, 15);
// sentenceText = new Text(composite, SWT.BORDER);
// sentenceText.setBounds(91, 25, 493, 21);
// sentenceText.setVisible(false);
//
// wordsLabel = createLabel(composite, "Word", false, 10, 65, 75, 15);
// objectTypesLabel = createLabel(composite, "Object type", false, 10, 105, 75, 15);
// gsnTypeLabel = createLabel(composite, "GSN type", false, 10, 185, 75, 15);
//
// comboWords = new ComboViewer(composite, SWT.READ_ONLY);
// comboWords.setContentProvider(new ArrayContentProvider());
// comboWords.setLabelProvider(new LabelProvider());
// comboWords.getCombo().setBounds(91, 65, 493, 23);
// comboWords.getCombo().setVisible(false);
//
// comboObjectTypes = new ComboViewer(composite, SWT.READ_ONLY);
// comboObjectTypes.setLabelProvider(new LabelProvider());
// comboObjectTypes.getCombo().setBounds(91, 105, 493, 23);
// comboObjectTypes.getCombo().setVisible(false);
// comboObjectTypes.add(String.class.getCanonicalName());
// comboObjectTypes.add(Component.class.getCanonicalName());
// comboObjectTypes.add("List of " + Component.class.getCanonicalName());
// comboObjectTypes.add(Goal.class.getCanonicalName());
// comboObjectTypes.add("List of " + Goal.class.getCanonicalName());
// comboObjectTypes.add(Requirement.class.getCanonicalName());
// comboObjectTypes.add("List of " + Requirement.class.getCanonicalName());
// comboObjectTypes.add("Reference to an external file");
//
// gsnType = new ComboViewer(composite, SWT.READ_ONLY);
// gsnType.setLabelProvider(new LabelProvider());
// gsnType.getCombo().setBounds(91, 185, 493, 23);
// gsnType.getCombo().setVisible(false);
//
// addWordButton = new Button(composite, SWT.NONE);
// addWordButton.setBounds(91, 142, 75, 25);
// addWordButton.setText("Add word");
// addWordButton.setVisible(false);
// addWordButton.addSelectionListener(new SelectionAdapter() {
// /** {@inheritDoc} */
// @Override
// public void widgetSelected(SelectionEvent e) {
// if(currentlySelectedElement instanceof SafetyClaimPattern) {
// final ITopLevelElement topLevel =
// IPersistencyService.getInstance().getTopLevelElementFor(
// currentlySelectedElement);
// topLevel.runAsCommand(new Runnable() {
// @Override
// public void run() {
// WordAndObjectType word = createWord();
// word.setWord(comboWords.getCombo().getItem(
// comboWords.getCombo().getSelectionIndex()));
// word.setObjectType(comboObjectTypes.getCombo().getItem(
// comboObjectTypes.getCombo().getSelectionIndex()));
// word.setName(word.getWord());
// ((SafetyClaimPattern)currentlySelectedElement).getContainedElements()
// .add(word);
// }
// });
// }
// }
// });
//
// gsnType.add(Goal.class);
// gsnType.add(Context.class);
// gsnType.add(Assumption.class);
// gsnType.add(Justification.class);
// gsnType.add(Strategy.class);
// }
//
// /**
// * This method builds up the attributes of word and object type elements.
// */
// private void createGUIForWordAndObjectTypeAttributes(Composite composite) {
// wordLabel = createLabel(composite, "The word", false, 10, 25, 75, 15);
// wordText = new Text(composite, SWT.BORDER);
// wordText.setBounds(91, 25, 493, 21);
// wordText.setVisible(false);
//
// objectTypeLabel = createLabel(composite, "The type", false, 10, 55, 75, 15);
// objectTypeText = new Text(composite, SWT.BORDER);
// objectTypeText.setBounds(91, 55, 493, 21);
// objectTypeText.setVisible(false);
// }
//
// /** {@inheritDoc} */
// @Override
// public void dispose() {
// getSite().getWorkbenchWindow().getSelectionService().removeSelectionListener(this);
// super.dispose();
// }
//
// /** {@inheritDoc} */
// @Override
// public void selectionChanged(IWorkbenchPart part, ISelection selection) {
// dbc.dispose();
// deactivateAllAttributes();
// WordAndObjectType word = checkAndPickFirstSafe(selection, WordAndObjectType.class);
// if(word != null) {
// currentlySelectedElement = word;
// activateNeccessaryInfoForWords();
// currentlySelectedElementIsWordAndObjectType();
// }
// SafetyClaimPattern sentence = checkAndPickFirstSafe(selection, SafetyClaimPattern.class);
// if(sentence != null) {
// currentlySelectedElement = sentence;
// activateNeccessaryInfoForSentences();
// currentlySelectedElementIsSentence();
// }
// }
//
// /**
// * This method provides behavior of the widgets which define the attributes of sentences
// * elements.
// */
// private void currentlySelectedElementIsSentence() {
// IObservableValue modelObservable =
// ObservableUtils.observeValue(currentlySelectedElement,
// SAFETY_CLAIM_PATTERN__SENTENCE);
// dbc.bindValue(SWTObservables.observeText(sentenceText, SWT.FocusOut), modelObservable,
// null, null);
// dbc.bindValue(ViewersObservables.observeSinglePostSelection(gsnType), ObservableUtils
// .observeValue(currentlySelectedElement, SAFETY_CLAIM_PATTERN__TYPE_OF_GSN_ELEMENT));
//
// if(((SafetyClaimPattern)currentlySelectedElement).getSentence() != null &&
// ((SafetyClaimPattern)currentlySelectedElement).getSentence() != "") {
// final ITopLevelElement topLevel =
// IPersistencyService.getInstance().getTopLevelElementFor(
// currentlySelectedElement);
// topLevel.runAsCommand(new Runnable() {
// @Override
// public void run() {
// ((SafetyClaimPattern)currentlySelectedElement)
// .setName(((SafetyClaimPattern)currentlySelectedElement).getSentence());
// }
// });
// comboWords
// .setInput(createWordsMapForSentence(((SafetyClaimPattern)currentlySelectedElement)
// .getSentence()));
// comboWords.getControl().setEnabled(true);
// comboObjectTypes.getControl().setEnabled(true);
// addWordButton.setEnabled(true);
// } else {
// comboWords.getControl().setEnabled(false);
// comboObjectTypes.getControl().setEnabled(false);
// addWordButton.setEnabled(false);
// }
// }
//
// /**
// * This method provides behavior of the widgets which define the attributes of word and object
// * type elements.
// */
// private void currentlySelectedElementIsWordAndObjectType() {
// IObservableValue modelObservable =
// ObservableUtils.observeValue(currentlySelectedElement, WORD_AND_OBJECT_TYPE__WORD);
// dbc.bindValue(SWTObservables.observeText(wordText, SWT.FocusOut), modelObservable, null,
// null);
// IObservableValue modelObservable2 =
// ObservableUtils.observeValue(currentlySelectedElement,
// WORD_AND_OBJECT_TYPE__OBJECT_TYPE);
// dbc.bindValue(SWTObservables.observeText(objectTypeText, SWT.FocusOut), modelObservable2,
// null, null);
// }
//
// /** {@inheritDoc} */
// @Override
// public void setFocus() {
// // Do nothing.
// }
//
// /**
// * This method makes invisible all the widgets existing in the view.
// */
// private void deactivateAllAttributes() {
// wordLabel.setVisible(false);
// wordText.setVisible(false);
// objectTypeLabel.setVisible(false);
// objectTypeText.setVisible(false);
// addWordButton.setVisible(false);
// comboObjectTypes.getCombo().setVisible(false);
// comboWords.getCombo().setVisible(false);
// gsnType.getCombo().setVisible(false);
// gsnTypeLabel.setVisible(false);
// wordsLabel.setVisible(false);
// objectTypesLabel.setVisible(false);
// sentenceLabel.setVisible(false);
// sentenceText.setVisible(false);
// }
//
// /**
// * This method makes visible the necessary widgets for defining the attributes of word and
// * object type elements.
// */
// private void activateNeccessaryInfoForWords() {
// wordLabel.setVisible(true);
// wordText.setVisible(true);
// objectTypeLabel.setVisible(true);
// objectTypeText.setVisible(true);
// }
//
// /**
// * This method makes visible the necessary widgets for defining the attributes of sentence
// * elements.
// */
// private void activateNeccessaryInfoForSentences() {
// sentenceLabel.setVisible(true);
// sentenceText.setVisible(true);
// wordsLabel.setVisible(true);
// comboWords.getCombo().setVisible(true);
// objectTypesLabel.setVisible(true);
// comboObjectTypes.getCombo().setVisible(true);
// gsnTypeLabel.setVisible(true);
// gsnType.getCombo().setVisible(true);
// addWordButton.setVisible(true);
// }
//
// /**
// * This method identifies the words from the given string which are surrounded by curly
// * brackets.
// *
// * @param sentence
// * The string.
// * @return The list of identified words.
// */
// private static ArrayList<String> createWordsMapForSentence(String sentence) {
// ArrayList<String> word = new ArrayList<String>();
// Pattern messagePattern2 =
// Pattern.compile(".*\\{(.*)\\}.*\\{(.*)\\}.*", Pattern.CASE_INSENSITIVE);
// Pattern messagePattern1 = Pattern.compile(".*\\{(.*)\\}.*", Pattern.CASE_INSENSITIVE);
// Pattern messagePattern0 = Pattern.compile(".*\\[(.*)\\].*", Pattern.CASE_INSENSITIVE);
// Pattern messagePattern3 =
// Pattern.compile(".*\\{(.*)\\}.*\\{(.*)\\}.*\\{(.*)\\}.*", Pattern.CASE_INSENSITIVE);
// Matcher m, n, l, o = null;
//
// n = messagePattern1.matcher(sentence);
// m = messagePattern2.matcher(sentence);
// l = messagePattern0.matcher(sentence);
// o = messagePattern3.matcher(sentence);
// if(o.matches()) {
// word.add(o.group(1));
// word.add(o.group(2));
// word.add(o.group(3));
// } else if(l.matches()) {
// word.add(l.group(1));
// } else if(m.matches()) {
// word.add(m.group(1));
// word.add(m.group(2));
// } else if(n.matches()) {
// word.add(n.group(1));
// }
// return word;
// }
}
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