Commit 1d3ae4cf authored by Florian Hölzl's avatar Florian Hölzl
Browse files

YELLOW

refs 311
parent b4ae6e03
......@@ -25,6 +25,5 @@ Export-Package: org.fortiss.af3.component.ui,
org.fortiss.af3.component.ui.simulator,
org.fortiss.af3.component.ui.simulator.component,
org.fortiss.af3.component.ui.simulator.menu,
org.fortiss.af3.component.ui.simulator.views,
org.fortiss.af3.component.ui.utils
org.fortiss.af3.component.ui.simulator.views
Import-Package: org.eclipse.ui.texteditor
......@@ -19,7 +19,7 @@ package org.fortiss.af3.component.ui.editor;
import static org.eclipse.swt.SWT.LEFT;
import static org.eclipse.swt.SWT.TOP;
import static org.fortiss.af3.component.ui.utils.ComponentFieldAssistUtils.getPorts;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.getPortNames;
import static org.fortiss.af3.expression.ui.utils.ExpressionFieldAssistUtils.getAllConstructors;
import static org.fortiss.af3.expression.ui.utils.ExpressionFieldAssistUtils.getFunctions;
import static org.fortiss.af3.expression.ui.utils.ExpressionFieldAssistUtils.getPrimitiveValues;
......@@ -50,7 +50,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.EditorBase;
* @author doebber
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating GREEN Hash: 0E930E7A79B45BE313CAA61210498E85
* @ConQAT.Rating YELLOW Hash: A9264F2FAEA25FFFF61D545DA6FE616E
*/
public class CodeSpecificationEditorBackend extends
......@@ -72,7 +72,8 @@ public class CodeSpecificationEditorBackend extends
@Override
/** {@inheritDoc} */
public String[] getProposals(String currentWord) {
ArrayList<String> prop = getPorts(editedObject.getComponent());
ArrayList<String> prop = getPortNames(editedObject
.getComponent());
prop.addAll(getFunctions(editedObject));
prop.addAll(getAllConstructors(editedObject, true));
prop.addAll(getPrimitiveValues());
......
/*--------------------------------------------------------------------------+
$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
| |
| Copyright 2012 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.component.ui.utils;
import java.util.ArrayList;
import org.fortiss.af3.component.model.Component;
import org.fortiss.tooling.base.model.element.IConnector;
import org.fortiss.tooling.kernel.model.INamedElement;
/**
* Utils class for assembling component related proposals for FieldAssist.
*
* @author doebber
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating RED Hash: B8276D1CCF8DABC54C532999BCE5B59B
*/
public class ComponentFieldAssistUtils {
// TODO(review): move method to ComponentArchitectureUtils and delete
// ComponentFieldAssistUtils
/**
* Returns all ports of given component.
*
* @param component
* the component to be searched for port names
* @return the list of port names
*/
public static ArrayList<String> getPorts(Component component) {
ArrayList<String> result = new ArrayList<String>();
for (IConnector conn : component.getConnectorsList()) {
if (conn instanceof INamedElement) {
result.add(((INamedElement) conn).getName());
}
}
return result;
}
}
......@@ -34,6 +34,7 @@ import org.fortiss.af3.component.model.impl.CausalityComponentSpecificationImpl;
import org.fortiss.af3.component.model.impl.ComponentArchitectureImpl;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.project.model.typesystem.IVariableDefinition;
import org.fortiss.tooling.base.model.element.IConnector;
import org.fortiss.tooling.base.model.element.IModelElementSpecification;
import org.fortiss.tooling.kernel.model.INamedElement;
import org.fortiss.tooling.kernel.model.IProjectRootElement;
......@@ -45,7 +46,7 @@ import org.fortiss.tooling.kernel.utils.KernelModelElementUtils;
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating GREEN Hash: 646669260DDEEF5C69AE086E9DE7C2F0
* @ConQAT.Rating YELLOW Hash: C0C643C288E703F03B701330601CF5B6
*/
public class ComponentArchitectureUtils {
......@@ -298,4 +299,21 @@ public class ComponentArchitectureUtils {
}
}
}
/**
* Returns all port names of given component.
*
* @param component
* the component to be searched for port names
* @return the list of port names
*/
public static ArrayList<String> getPortNames(Component component) {
ArrayList<String> result = new ArrayList<String>();
for (IConnector conn : component.getConnectorsList()) {
if (conn instanceof INamedElement) {
result.add(((INamedElement) conn).getName());
}
}
return result;
}
}
......@@ -17,8 +17,8 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z ratiu $
+--------------------------------------------------------------------------*/
package org.fortiss.af3.state.ui.properties;
import static org.fortiss.af3.component.ui.utils.ComponentFieldAssistUtils.getPorts;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.getEnclosingComponent;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.getPortNames;
import static org.fortiss.af3.expression.ui.utils.ExpressionFieldAssistUtils.getAllConstructors;
import static org.fortiss.af3.expression.ui.utils.ExpressionFieldAssistUtils.getFunctions;
import static org.fortiss.af3.expression.ui.utils.ExpressionFieldAssistUtils.getPrimitiveValues;
......@@ -55,7 +55,7 @@ import org.fortiss.tooling.kernel.utils.LoggingUtils;
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 8C91EBD1657A33350DF04B2B16B790DC
* @ConQAT.Rating YELLOW Hash: 68842731C1ACF4ABA18E10190E372FB6
*/
public class StateSpecificationPropertySection extends PropertySectionBase {
......@@ -93,7 +93,7 @@ public class StateSpecificationPropertySection extends PropertySectionBase {
@Override
/** {@inheritDoc} */
public String[] getProposals(String currentWord) {
ArrayList<String> prop = getPorts(getEnclosingComponent(state));
ArrayList<String> prop = getPortNames(getEnclosingComponent(state));
prop.addAll(getFunctions(state));
prop.addAll(getAllConstructors(state, true));
prop.addAll(getPrimitiveValues());
......
......@@ -17,8 +17,8 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z ratiu $
+--------------------------------------------------------------------------*/
package org.fortiss.af3.state.ui.properties;
import static org.fortiss.af3.component.ui.utils.ComponentFieldAssistUtils.getPorts;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.getEnclosingComponent;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.getPortNames;
import static org.fortiss.af3.expression.ui.utils.ExpressionFieldAssistUtils.getAllConstructors;
import static org.fortiss.af3.expression.ui.utils.ExpressionFieldAssistUtils.getFunctions;
import static org.fortiss.af3.expression.ui.utils.ExpressionFieldAssistUtils.getPrimitiveValues;
......@@ -57,7 +57,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @author ratiu
* @author $Author: ratiu $
* @version $Rev: 5320 $
* @ConQAT.Rating YELLOW Hash: 254F47BFD7867C2CC6B3B258295EE3A9
* @ConQAT.Rating YELLOW Hash: EDF6A5E471F01189F2AAD99AF717D69F
*/
public class TransitionSegmentSpecificationPropertySection extends
PropertySectionWithCopyPasteBase<TransitionSegmentSpecification> {
......@@ -90,7 +90,7 @@ public class TransitionSegmentSpecificationPropertySection extends
@Override
/** {@inheritDoc} */
public String[] getProposals(String currentWord) {
ArrayList<String> prop = getPorts(getEnclosingComponent(specification));
ArrayList<String> prop = getPortNames(getEnclosingComponent(specification));
prop.addAll(getFunctions(specification));
prop.addAll(getAllConstructors(specification, true));
prop.addAll(getPrimitiveValues());
......@@ -101,7 +101,7 @@ public class TransitionSegmentSpecificationPropertySection extends
@Override
/** {@inheritDoc} */
public String[] getProposals(String currentWord) {
ArrayList<String> prop = getPorts(getEnclosingComponent(specification));
ArrayList<String> prop = getPortNames(getEnclosingComponent(specification));
prop.addAll(getFunctions(specification));
prop.addAll(getAllConstructors(specification, true));
prop.addAll(getPrimitiveValues());
......
Supports Markdown
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