Commit e0a91683 authored by Simon Barner's avatar Simon Barner
Browse files

- Fix some SVN properties

parent 57bef994
/*--------------------------------------------------------------------------+
$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
$Id$
| |
| Copyright 2011 fortiss GmbH |
| |
......@@ -30,8 +30,8 @@ import org.eclipse.swt.widgets.Table;
* Base class configuring default table viewer.
*
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 9BD7A35B68F2A0C579302785D426E260
*/
public abstract class TableContentProviderBase implements IStructuredContentProvider {
......
<!--
$Id: package.html 2692 2012-01-09 13:17:37Z doebber $
@version $Rev: 2692 $
$Id$
@version $Rev$
@ConQAT.Rating GREEN Hash: D9D323B2BF3DF761682FF2386477DE42
-->
<body>
......
/*--------------------------------------------------------------------------+
$Id: AbstractDecoratedTextCellDatabindingEditingSupport.java 5274 2012-08-02 07:54:11Z mou $
$Id$
| |
| Copyright 2011 fortiss GmbH |
| |
......@@ -46,8 +46,8 @@ import org.fortiss.tooling.kernel.ui.util.DataBindingUtils;
* </p>
*
* @author hoelzl
* @author $Author: mou $
* @version $Rev: 5274 $
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: BC0D36A060AE96F7784E11F4E02E16E6
*/
public abstract class AbstractDecoratedTextCellWithTextStyledTextActionHandlerDatabindingEditingSupport
......
/*--------------------------------------------------------------------------+
$Id: AbstractTextCellDatabindingEditingSupport.java 5274 2012-08-02 07:54:11Z mou $
$Id$
| |
| Copyright 2011 fortiss GmbH |
| |
......@@ -29,8 +29,8 @@ import org.fortiss.tooling.kernel.ui.extension.base.EditorBase;
* Abstract base class for inline text cell, with copy-pasting.
*
* @author hoelzl
* @author $Author: mou $
* @version $Rev: 5274 $
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 129A3738C36A26DB5CC5ACCE0BD08D28
*/
public abstract class AbstractTextCellWithTextStyledTextActionHandlerDatabindingEditingSupport
......
<!--
$Id: package.html 2692 2012-01-09 13:17:37Z doebber $
@version $Rev: 2692 $
$Id$
@version $Rev$
@ConQAT.Rating GREEN Hash: D74C6E445A6F047469370DA7AD5EF541
-->
<body>
......
/*--------------------------------------------------------------------------+
$Id: ElementTreeMultiSelectDialog.java 5186 2012-07-27 20:23:37Z ratiu $
$Id$
| |
| Copyright 2011 fortiss GmbH |
| |
......@@ -35,8 +35,8 @@ import org.eclipse.swt.widgets.Shell;
* This dialog offers a question dialog with different button label
*
* @author wenwenchen
* @author $Author: ratiu $
* @version $Rev: 5186 $
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: E835C665671D57B2619E28232ABFC1F7
*/
public class ButtonDialog extends Dialog {
......
/*--------------------------------------------------------------------------+
$Id: ElementTreeMultiSelectDialogGUI.java 5186 2012-07-27 20:23:37Z ratiu $
$Id$
| |
| Copyright 2012 fortiss GmbH |
| |
......@@ -32,8 +32,8 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
* GUI for {@link ElementTreeMultiSelectDialog}.
*
* @author wenwenchen
* @author $Author: ratiu $
* @version $Rev: 5186 $
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: BFF2681187412D40C2A8ADE53F4A3276
*/
public class ButtonDialogGUI extends Composite {
......
/*--------------------------------------------------------------------------+
$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
$Id$
| |
| Copyright 2013 fortiss GmbH |
| |
......@@ -35,8 +35,8 @@ import org.eclipse.swt.widgets.Shell;
* A {@link TitleAreaDialog} that hosts a {@link CheckboxTreeViewer}.
*
* @author czhang
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 12D549CCF3FE22DF4C1CBA14E17B1AF0
*/
public class CheckBoxTreeDialog extends TitleAreaDialog {
......
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2015 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.tooling.base.ui.dialog;
import static org.fortiss.tooling.base.ui.dialog.MessageUtilsExtended.showWarningInUIThread;
import org.fortiss.tooling.base.compose.ModelElementWithRefCopyMessage;
import org.fortiss.tooling.base.model.element.IModelElementSpecification;
import org.fortiss.tooling.kernel.extension.LogMessageHandler;
import org.fortiss.tooling.kernel.extension.data.ILogMessageContext;
/**
* {@link LogMessageHandler} that displays warning dialogs of {@link ModelElementWithRefCopyMessage}
* s which are emitted when a user copies elements which reference
* {@link IModelElementSpecification}s.
*
* @author diewald
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: DB633B201306BEFFE60799B3549F4368
*/
public class ModelElementWithRefCopyMessageHandler implements
LogMessageHandler<ModelElementWithRefCopyMessage> {
/** Title of the dialog. */
private static final String TITLE = "References to external model elements.";
/** {@inheritDoc} */
@Override
public void showMessage(ModelElementWithRefCopyMessage message, ILogMessageContext context) {
if(message != null) {
showWarningInUIThread(TITLE, message.getMessage());
}
}
}
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2015 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.tooling.base.ui.dialog;
import static org.fortiss.tooling.base.ui.dialog.MessageUtilsExtended.showWarningInUIThread;
import org.fortiss.tooling.base.compose.ModelElementWithRefCopyMessage;
import org.fortiss.tooling.base.model.element.IModelElementSpecification;
import org.fortiss.tooling.kernel.extension.LogMessageHandler;
import org.fortiss.tooling.kernel.extension.data.ILogMessageContext;
/**
* {@link LogMessageHandler} that displays warning dialogs of {@link ModelElementWithRefCopyMessage}
* s which are emitted when a user copies elements which reference
* {@link IModelElementSpecification}s.
*
* @author diewald
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: DB633B201306BEFFE60799B3549F4368
*/
public class ModelElementWithRefCopyMessageHandler implements
LogMessageHandler<ModelElementWithRefCopyMessage> {
/** Title of the dialog. */
private static final String TITLE = "References to external model elements.";
/** {@inheritDoc} */
@Override
public void showMessage(ModelElementWithRefCopyMessage message, ILogMessageContext context) {
if(message != null) {
showWarningInUIThread(TITLE, message.getMessage());
}
}
}
/*--------------------------------------------------------------------------+
$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
| |
| Copyright 2016 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.tooling.base.ui.dialog;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.lang.math.NumberUtils;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.fortiss.tooling.base.annotation.valueprovider.IAnnotationValueProvider.AnnotationActionInputParameter;
import org.fortiss.tooling.base.annotation.valueprovider.IAnnotationValueProvider.AnnotationActionInputParameters;
/**
* {@link Dialog} that has a list of {@link Label}s and {@link Text} fields whose number matches the
* size of the loaded {@link AnnotationActionInputParameters}. The entries of the loaded
* {@link AnnotationActionInputParameters} define the displayed text and the expected value types.
*
* For now only a subset of {@link Number}s are allowed as values.
*
* @author diewald
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating RED Hash: 88FE42EEA15A676930456D288A66C084
*/
public class MultiFieldInputDialog extends Dialog {
/** Container composite for the fields of this dialog. */
private Composite container;
/** List of textual descriptors and the expected types. */
private AnnotationActionInputParameters parameters;
/** List of entered parameters. */
private Map<Text, AnnotationActionInputParameter> fieldParamAssoc = new HashMap<>();
/** Constructor. */
public MultiFieldInputDialog(Shell parentShell) {
super(parentShell);
}
/** {@inheritDoc} */
@Override
protected Control createDialogArea(Composite parent) {
Composite area = (Composite)super.createDialogArea(parent);
container = new Composite(area, SWT.NONE);
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
GridLayout layout = new GridLayout(2, false);
container.setLayout(layout);
addAllInputFields(parameters);
return area;
}
/**
* Loads the given list of input parameter descriptors whose gui elements are created after the
* dialog has been opened.
*/
public void loadAllInputFields(AnnotationActionInputParameters inputParameterList) {
parameters = inputParameterList;
}
/** Adds all labels and input fields described in the {@code parameterList}. */
protected void addAllInputFields(AnnotationActionInputParameters inputParameterList) {
for(AnnotationActionInputParameter curParameter : inputParameterList.keySet()) {
addInputFields(curParameter);
}
}
/**
* Add the gui elements of an input field consisting of a textual descriptor and a Text box.
*
* @param parameterSpec
* describes the expected input.
*/
protected void addInputFields(AnnotationActionInputParameter parameterSpec) {
Label parameterLabel = new Label(container, SWT.NONE);
parameterLabel.setText(parameterSpec.getFirst());
GridData gridInputParameter = new GridData();
gridInputParameter.grabExcessHorizontalSpace = true;
gridInputParameter.horizontalAlignment = GridData.FILL;
Text parameterInput = new Text(container, SWT.BORDER);
parameterInput.setLayoutData(gridInputParameter);
fieldParamAssoc.put(parameterInput, parameterSpec);
}
/** Returns the list of parameters entered in the dialog. */
public AnnotationActionInputParameters getParameterValues() {
return parameters;
}
/** {@inheritDoc} */
@Override
protected void okPressed() {
for(Entry<Text, AnnotationActionInputParameter> curInputField : fieldParamAssoc.entrySet()) {
String enteredValue = curInputField.getKey().getText();
@SuppressWarnings("unchecked") Class<Number> expectedType =
(Class<Number>)curInputField.getValue().getSecond();
Number value = null;
// TODO: Throw an Exception if the enteredString is not a number.
if(NumberUtils.isNumber(enteredValue)) {
// TODO: Avoid this cast to make the method more type-safe.
if(expectedType.isAssignableFrom(Byte.class)) {
value = Byte.valueOf(enteredValue);
} else if(expectedType.isAssignableFrom(Double.class)) {
value = Double.valueOf(enteredValue);
} else if(expectedType.isAssignableFrom(Float.class)) {
value = Float.valueOf(enteredValue);
} else if(expectedType.isAssignableFrom(Integer.class)) {
value = Integer.valueOf(enteredValue);
} else if(expectedType.isAssignableFrom(Long.class)) {
value = Long.valueOf(enteredValue);
} else if(expectedType.isAssignableFrom(Short.class)) {
value = Short.valueOf(enteredValue);
}
}
parameters.put(curInputField.getValue().getFirst(), expectedType, value);
}
super.okPressed();
}
}
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2016 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.tooling.base.ui.dialog;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.lang.math.NumberUtils;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.fortiss.tooling.base.annotation.valueprovider.IAnnotationValueProvider.AnnotationActionInputParameter;
import org.fortiss.tooling.base.annotation.valueprovider.IAnnotationValueProvider.AnnotationActionInputParameters;
/**
* {@link Dialog} that has a list of {@link Label}s and {@link Text} fields whose number matches the
* size of the loaded {@link AnnotationActionInputParameters}. The entries of the loaded
* {@link AnnotationActionInputParameters} define the displayed text and the expected value types.
*
* For now only a subset of {@link Number}s are allowed as values.
*
* @author diewald
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash: 88FE42EEA15A676930456D288A66C084
*/
public class MultiFieldInputDialog extends Dialog {
/** Container composite for the fields of this dialog. */
private Composite container;
/** List of textual descriptors and the expected types. */
private AnnotationActionInputParameters parameters;
/** List of entered parameters. */
private Map<Text, AnnotationActionInputParameter> fieldParamAssoc = new HashMap<>();
/** Constructor. */
public MultiFieldInputDialog(Shell parentShell) {
super(parentShell);
}
/** {@inheritDoc} */
@Override
protected Control createDialogArea(Composite parent) {
Composite area = (Composite)super.createDialogArea(parent);
container = new Composite(area, SWT.NONE);
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
GridLayout layout = new GridLayout(2, false);
container.setLayout(layout);
addAllInputFields(parameters);
return area;
}
/**
* Loads the given list of input parameter descriptors whose gui elements are created after the
* dialog has been opened.
*/
public void loadAllInputFields(AnnotationActionInputParameters inputParameterList) {
parameters = inputParameterList;
}
/** Adds all labels and input fields described in the {@code parameterList}. */
protected void addAllInputFields(AnnotationActionInputParameters inputParameterList) {
for(AnnotationActionInputParameter curParameter : inputParameterList.keySet()) {
addInputFields(curParameter);
}
}
/**
* Add the gui elements of an input field consisting of a textual descriptor and a Text box.
*
* @param parameterSpec
* describes the expected input.
*/
protected void addInputFields(AnnotationActionInputParameter parameterSpec) {
Label parameterLabel = new Label(container, SWT.NONE);
parameterLabel.setText(parameterSpec.getFirst());
GridData gridInputParameter = new GridData();
gridInputParameter.grabExcessHorizontalSpace = true;
gridInputParameter.horizontalAlignment = GridData.FILL;
Text parameterInput = new Text(container, SWT.BORDER);
parameterInput.setLayoutData(gridInputParameter);
fieldParamAssoc.put(parameterInput, parameterSpec);
}
/** Returns the list of parameters entered in the dialog. */
public AnnotationActionInputParameters getParameterValues() {
return parameters;
}
/** {@inheritDoc} */
@Override
protected void okPressed() {
for(Entry<Text, AnnotationActionInputParameter> curInputField : fieldParamAssoc.entrySet()) {
String enteredValue = curInputField.getKey().getText();
@SuppressWarnings("unchecked") Class<Number> expectedType =
(Class<Number>)curInputField.getValue().getSecond();
Number value = null;
// TODO: Throw an Exception if the enteredString is not a number.
if(NumberUtils.isNumber(enteredValue)) {
// TODO: Avoid this cast to make the method more type-safe.
if(expectedType.isAssignableFrom(Byte.class)) {
value = Byte.valueOf(enteredValue);
} else if(expectedType.isAssignableFrom(Double.class)) {
value = Double.valueOf(enteredValue);
} else if(expectedType.isAssignableFrom(Float.class)) {
value = Float.valueOf(enteredValue);
} else if(expectedType.isAssignableFrom(Integer.class)) {
value = Integer.valueOf(enteredValue);
} else if(expectedType.isAssignableFrom(Long.class)) {
value = Long.valueOf(enteredValue);
} else if(expectedType.isAssignableFrom(Short.class)) {
value = Short.valueOf(enteredValue);
}
}
parameters.put(curInputField.getValue().getFirst(), expectedType, value);
}
super.okPressed();
}
}
/*--------------------------------------------------------------------------+
$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
| |
| Copyright 2015 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.tooling.base.ui.editor;
import org.eclipse.emf.ecore.EObject;