Commit 152a1990 authored by Simon Barner's avatar Simon Barner
Browse files

Moving org.fortiss.af3.platform.beagle.ui

Issue-Ref: 3861
Issue-Url: https://af3-developer.fortiss.org/issues/3861

Signed-off-by: Simon Barner's avatarSimon Barner <barner@fortiss.org>
parents a20016ca 3d10f418
Pipeline #19162 failed with stages
in 3 minutes and 43 seconds
/*-------------------------------------------------------------------------+
| Copyright 2011 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.platform.beagle.ui.handler;
import static org.fortiss.af3.platform.beagle.ui.AF3PlatformBeagleUIActivator.getImageDescriptor;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.beagle.model.BeagleBoneExecutionUnit;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* Handler for {@link BeagleBoneExecutionUnit}s.
*
* @author hoelzl
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public class BeagleBoneExecutionUnitHandler
extends NamedCommentedModelElementHandlerBase<BeagleBoneExecutionUnit> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/beagle.png");
}
/** {@inheritDoc} */
@Override
public List<EObject> getConnectors(BeagleBoneExecutionUnit element) {
return (List)element.getConnectors();
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 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.platform.beagle.ui.handler;
import static org.fortiss.af3.platform.beagle.ui.AF3PlatformBeagleUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.beagle.model.ConsoleOutput;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* Handler for {@link ConsoleOutput}s.
*
* @author hoelzl
*/
public class ConsoleOutputTransmitterHandler
extends NamedCommentedModelElementHandlerBase<ConsoleOutput> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/console.png");
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 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.platform.beagle.ui.handler;
import static org.fortiss.af3.platform.beagle.ui.AF3PlatformBeagleUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.beagle.model.SerialInput;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* Handler for {@link SerialInput}s.
*
* @author hoelzl
*/
public class SerialInputReceiverHandler extends NamedCommentedModelElementHandlerBase<SerialInput> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 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.platform.beagle.ui.handler;
import static org.fortiss.af3.platform.beagle.ui.AF3PlatformBeagleUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.beagle.model.SerialOutput;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* Handler for {@link SerialOutput}s.
*
* @author hoelzl
*/
public class SerialOutputTransmitterHandler
extends NamedCommentedModelElementHandlerBase<SerialOutput> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 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.platform.beagle.ui.handler;
import static org.fortiss.af3.platform.beagle.ui.AF3PlatformBeagleUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.beagle.model.SimplAsciiInput;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* Handler for {@link SimplAsciiInput}s.
*
* @author hoelzl
*/
public class SimplAsciiInputReceiverHandler
extends NamedCommentedModelElementHandlerBase<SimplAsciiInput> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 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.platform.beagle.ui.handler;
import static org.fortiss.af3.platform.beagle.ui.AF3PlatformBeagleUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.beagle.model.SimplAsciiOutput;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* Handler for {@link SimplAsciiOutput}s.
*
* @author hoelzl
*/
public class SimplAsciiOutputReceiverHandler
extends NamedCommentedModelElementHandlerBase<SimplAsciiOutput> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 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.platform.beagle.ui.handler;
import static org.fortiss.af3.platform.beagle.ui.AF3PlatformBeagleUIActivator.getImageDescriptor;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.beagle.model.UDPMasterSlaveMultiCastNetwork;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* Handler for {@link UDPMasterSlaveMultiCastNetwork}s.
*
* @author hoelzl
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public class UDPMasterSlaveMutliCastNetworkHandler
extends NamedCommentedModelElementHandlerBase<UDPMasterSlaveMultiCastNetwork> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/udp.png");
}
/** {@inheritDoc} */
@Override
public List<EObject> getSubnodes(UDPMasterSlaveMultiCastNetwork element) {
return (List)element.getContainedElements();
}
/** {@inheritDoc} */
@Override
public List<EObject> getConnectors(UDPMasterSlaveMultiCastNetwork element) {
return (List)element.getConnectors();
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 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.platform.beagle.ui.handler;
import static org.fortiss.af3.platform.beagle.ui.AF3PlatformBeagleUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.beagle.model.UDPMasterSlaveTransceiver;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* Handler for {@link UDPMasterSlaveTransceiver}s.
*
* @author hoelzl
*/
public class UDPMasterSlaveTransceiverHandler
extends NamedCommentedModelElementHandlerBase<UDPMasterSlaveTransceiver> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/udp_connector.png");
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 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.platform.beagle.ui.handler;
import static org.fortiss.af3.platform.beagle.ui.AF3PlatformBeagleUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.beagle.model.VirtualKeyboardInput;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* Handler for {@link VirtualKeyboardInput}s.
*
* @author hoelzl
*/
public class VirtualKeyboardInputReceiverHandler
extends NamedCommentedModelElementHandlerBase<VirtualKeyboardInput> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/vkeyboard.png");
}
}
BeagleBoneExecutionUnitPropertySection.java 682f512fa4610627516c2c8c6fa7109c8237cd54 GREEN
SerialDevicePropertySection.java 50a53b5de5b507e5bdd2900f0ef42c4b8b85daa0 GREEN
SimplAsciiDevicePropertySection.java f00a85dee7abb06dcc32224407f639fbe63b17f7 GREEN
TCPUDPPortNumberValidator.java 8202eb6c9f36fbeddb107ddfe8312e610309dbcf GREEN
UDPMasterSlaveMultiCastNetworkPropertySection.java c43ef3ace8552f2fa97e0b247301ece8b1c4bae9 GREEN
UDPMasterSlaveTransceiverPropertySection.java 622f8bec02e5f652e1436e872179046a554c0e21 GREEN
VirtualKeyBoardInputPropertySection.java 040017b1f9a08711b1c0f9d92cc6e5fe4b276ceb GREEN
/*-------------------------------------------------------------------------+
| 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.platform.beagle.ui.properties;
import static org.fortiss.af3.expression.ui.databinding.validate.IntToStringConverter.INT_STRING_CONVERTER;
import static org.fortiss.af3.expression.ui.databinding.validate.StringToIntConverter.STRING_INT_CONVERTER;
import static org.fortiss.af3.platform.beagle.ui.properties.TCPUDPPortNumberValidator.NON_ASSIGNED_TCP_UDP_PORT_VALIDATOR;
import static org.fortiss.tooling.kernel.ui.databinding.IntValidator.INT_VALIDATOR;
import static org.fortiss.tooling.kernel.ui.databinding.NumberPositiveValidator.NUMBER_POSITIVE_VALIDATOR;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.performComplexTextBinding;
import static org.fortiss.tooling.kernel.ui.util.ObservableUtils.observeValue;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.fortiss.af3.platform.beagle.model.AF3PlatformBeaglePackage;
import org.fortiss.af3.platform.beagle.model.BeagleBoneExecutionUnit;
import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase;
/**
* Property section for {@link BeagleBoneExecutionUnit}s.
*
* @author hoelzl
*/
public class BeagleBoneExecutionUnitPropertySection extends PropertySectionBase {
/** The execution unit. */
private BeagleBoneExecutionUnit unit;
/** The virtual keyboard port number widget. */
private Text vkPortNumberText;
/** The computation period widget. */
private Text computationPeriodText;
/** {@inheritDoc} */
@Override
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
super.createControls(parent, tabbedPropertySheetPage);
computationPeriodText = createDecoratedFormText("Computation Period (ms)");
vkPortNumberText = createDecoratedFormText("Virtual Keyboard TCP Port");
}
/** {@inheritDoc} */
@Override
protected void setSectionInput(Object input) {
unit = (BeagleBoneExecutionUnit)input;
}
/** {@inheritDoc} */
@Override
public void refresh() {
super.refresh();
IObservableValue<?> modelObservable = observeValue(unit,
AF3PlatformBeaglePackage.Literals.BEAGLE_BONE_EXECUTION_UNIT__VIRTUAL_KEYBOARD_PORT);
performComplexTextBinding(dbc, vkPortNumberText, modelObservable, INT_STRING_CONVERTER,
STRING_INT_CONVERTER, INT_VALIDATOR, NON_ASSIGNED_TCP_UDP_PORT_VALIDATOR);
modelObservable = observeValue(unit,
AF3PlatformBeaglePackage.Literals.BEAGLE_BONE_EXECUTION_UNIT__COMPUTATION_PERIOD);
performComplexTextBinding(dbc, computationPeriodText, modelObservable, INT_STRING_CONVERTER,
STRING_INT_CONVERTER, INT_VALIDATOR, NUMBER_POSITIVE_VALIDATOR);
}
}
/*-------------------------------------------------------------------------+
| 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.platform.beagle.ui.properties;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.observeText;
import static org.fortiss.tooling.kernel.ui.util.ObservableUtils.observeValue;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.fortiss.af3.platform.beagle.model.AF3PlatformBeaglePackage;
import org.fortiss.af3.platform.beagle.model.SerialDevice;
import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase;
/**
* Property section for {@link SerialDevice}s.
*
* @author hoelzl
*/
public class SerialDevicePropertySection extends PropertySectionBase {
/** The serial device. */
private SerialDevice device;
/** The device ID widget. */
private Text deviceIdText;
/** {@inheritDoc} */
@Override
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
super.createControls(parent, tabbedPropertySheetPage);
deviceIdText = createDecoratedFormText("Device ID");
}
/** {@inheritDoc} */
@Override
protected void setSectionInput(Object input) {
device = (SerialDevice)input;
}
/** {@inheritDoc} */
@Override
public void refresh() {
super.refresh();
IObservableValue<?> modelObservable =
observeValue(device, AF3PlatformBeaglePackage.Literals.SERIAL_DEVICE__DEVICE_ID);
dbc.bindValue(observeText(deviceIdText, SWT.Modify), modelObservable, null, null);
}
}
/*-------------------------------------------------------------------------+
| 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.platform.beagle.ui.properties;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.observeText;
import static org.fortiss.tooling.kernel.ui.util.ObservableUtils.observeValue;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;