Skip to content
Snippets Groups Projects
Commit b8d0fb3a authored by Simon Barner's avatar Simon Barner
Browse files

Merge branch 'master' of https://git.fortiss.org/af3/kernel.git into 3470-timing_model

parents 506532a0 d7196a4c
No related branches found
No related tags found
1 merge request!393470 timing model
Showing
with 196 additions and 10 deletions
...@@ -3,8 +3,7 @@ CheckBoxTreeDialog.java 2737a18ff8dda511466ba0f467d777a3a56e99a3 GREEN ...@@ -3,8 +3,7 @@ CheckBoxTreeDialog.java 2737a18ff8dda511466ba0f467d777a3a56e99a3 GREEN
ElementTreeMultiSelectDialog.java 3b2ba4afc337e35175ce2e7d28e248f9d853ee32 GREEN ElementTreeMultiSelectDialog.java 3b2ba4afc337e35175ce2e7d28e248f9d853ee32 GREEN
ElementTreeSingleSelectDialog.java af76db0d43752b8a7af6ecdd6963f80c446f5b39 GREEN ElementTreeSingleSelectDialog.java af76db0d43752b8a7af6ecdd6963f80c446f5b39 GREEN
IDialogEditSupport.java 3c66b23d66cffaaf9bb4848b025a3fdb1a5b86dc GREEN IDialogEditSupport.java 3c66b23d66cffaaf9bb4848b025a3fdb1a5b86dc GREEN
MessageUtilsExtended.java 930a54539160f6a214b6c0d98b0e3b3459c0740c GREEN
ModelElementTreeContentProvider.java ac8da7ee7adf800850c528aa35e139b76a7d0318 GREEN ModelElementTreeContentProvider.java ac8da7ee7adf800850c528aa35e139b76a7d0318 GREEN
ModelElementWithRefCopyMessageHandler.java b03a5e82d540750852b3619ad9aeb5cf5f5b0617 GREEN ModelElementWithRefCopyMessageHandler.java 1eb24195dbc9d5e3c019a841c312370e676c70fa GREEN
MultiFieldInputDialog.java 780e7a2aaab687666325b69d51d8df02646d723a GREEN MultiFieldInputDialog.java 780e7a2aaab687666325b69d51d8df02646d723a GREEN
MultiRootTreeContentProvider.java 279ed5c5bcc5f000bf4e8f0fa3c131ba0411221b GREEN MultiRootTreeContentProvider.java 279ed5c5bcc5f000bf4e8f0fa3c131ba0411221b GREEN
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.dialog; package org.fortiss.tooling.base.ui.dialog;
import static org.fortiss.tooling.base.ui.dialog.MessageUtilsExtended.showWarningInUIThread; import static org.fortiss.tooling.kernel.ui.util.MessageUtilsExtended.showWarningInUIThread;
import org.fortiss.tooling.base.compose.ModelElementWithRefCopyMessage; import org.fortiss.tooling.base.compose.ModelElementWithRefCopyMessage;
import org.fortiss.tooling.base.model.element.IModelElementSpecification; import org.fortiss.tooling.base.model.element.IModelElementSpecification;
......
...@@ -159,4 +159,12 @@ ...@@ -159,4 +159,12 @@
</modelElementClass> </modelElementClass>
</modelElementHandler> </modelElementHandler>
</extension> </extension>
<extension point="org.fortiss.tooling.kernel.uiMessageHandler">
<uiMessageHandler
handler="org.fortiss.tooling.kernel.ui.extension.base.DialogMessageHandler">
<objectClass
objectClass="org.fortiss.tooling.kernel.extension.base.DialogMessage">
</objectClass>
</uiMessageHandler>
</extension>
</plugin> </plugin>
ConstraintUIBases.java 3676a600e0866091db9798763c6eee97eec5b55b GREEN ConstraintUIBases.java 3676a600e0866091db9798763c6eee97eec5b55b GREEN
ContextMenuSubMenuContributorBase.java 6275d96fe8690d9d4744bcbaef3c7d14ba8e30ff GREEN ContextMenuSubMenuContributorBase.java 6275d96fe8690d9d4744bcbaef3c7d14ba8e30ff GREEN
DialogMessageHandler.java 8714da09a777c8557de0a5c48ff68c340f9fa91d GREEN
EObjectActionBase.java 4ef9f8be59e64d4838acc9e268d418ba5d94fa1a GREEN EObjectActionBase.java 4ef9f8be59e64d4838acc9e268d418ba5d94fa1a GREEN
EReferenceListPropertySectionBase.java b43469e81cf9f959230e9b2353460c49d8d6a7d3 YELLOW EReferenceListPropertySectionBase.java b43469e81cf9f959230e9b2353460c49d8d6a7d3 YELLOW
EReferencePropertySectionBase.java 3347e99b2fc135dd4b3117407179900ef757092c GREEN EReferencePropertySectionBase.java 3347e99b2fc135dd4b3117407179900ef757092c GREEN
......
/*-------------------------------------------------------------------------+
| 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.kernel.ui.extension.base;
import static org.fortiss.tooling.kernel.ui.util.MessageUtilsExtended.showErrorInUIThread;
import static org.fortiss.tooling.kernel.ui.util.MessageUtilsExtended.showInfoInUIThread;
import static org.fortiss.tooling.kernel.ui.util.MessageUtilsExtended.showWarningInUIThread;
import org.fortiss.tooling.kernel.extension.ILogMessageHandler;
import org.fortiss.tooling.kernel.extension.base.DialogMessage;
import org.fortiss.tooling.kernel.extension.data.ILogMessageContext;
/**
* {@link ILogMessageHandler} that displays messages to a user in a dialog. It is used by backend
* plugins that may not have dependencies on UI plugins.
*
* @author diewald
*/
public class DialogMessageHandler implements ILogMessageHandler<DialogMessage> {
/** {@inheritDoc} */
@Override
public void showMessage(DialogMessage message, ILogMessageContext context) {
if(message != null) {
switch(message.getSeverity()) {
case ERROR:
showErrorInUIThread("Error", message.getMessage());
break;
case WARNING:
showWarningInUIThread("Warning", message.getMessage());
break;
case INFORMATION:
showInfoInUIThread("Information", message.getMessage());
break;
}
}
}
}
ActionUtils.java 4553e487264e3d1f86f4767da4a7400cce4b9a5d GREEN ActionUtils.java 4553e487264e3d1f86f4767da4a7400cce4b9a5d GREEN
ConstraintsUIUtils.java 69d5e08bbf768baf2790380e36f1020ef826a33e GREEN ConstraintsUIUtils.java 69d5e08bbf768baf2790380e36f1020ef826a33e GREEN
CopyPasteUtils.java bbc5cf9c9dc03ebf8dc75d42c919fe6eb60b388e GREEN CopyPasteUtils.java bbc5cf9c9dc03ebf8dc75d42c919fe6eb60b388e GREEN
DataBindingUtils.java 6ae66457694227b69c13c092ef62babdd4a2a137 GREEN DataBindingUtils.java 631c47881caa13fc567679a7e4416eb777af0713 GREEN
DragAndDropUtils.java 7aab91518aa12d76533a345bf6ed0be9ac7ff0e5 GREEN DragAndDropUtils.java 7aab91518aa12d76533a345bf6ed0be9ac7ff0e5 GREEN
EObjectSelectionUtils.java 128cf8f96c6b9478171dff3deda662d5934f5f44 GREEN EObjectSelectionUtils.java 128cf8f96c6b9478171dff3deda662d5934f5f44 GREEN
HierarchicalNameViewerComparator.java 199d82e392d4e437810cc65c0fc521dab52038e0 GREEN HierarchicalNameViewerComparator.java 199d82e392d4e437810cc65c0fc521dab52038e0 GREEN
KernelUIUtils.java 46d3279ef3523b104f89a6c526109f72d36f72f2 GREEN KernelUIUtils.java 46d3279ef3523b104f89a6c526109f72d36f72f2 GREEN
MessageUtilsExtended.java 67693ff5473d0b85081d273fc5f00612fdc8bfee GREEN
ObservableUtils.java 34abfd1dfaf9c0acbb31caf1f525e7b39416c116 GREEN ObservableUtils.java 34abfd1dfaf9c0acbb31caf1f525e7b39416c116 GREEN
PropertiesConstantUtils.java 59b1a1e4d594bb98db3aa396f2ff6474ba405920 GREEN PropertiesConstantUtils.java 59b1a1e4d594bb98db3aa396f2ff6474ba405920 GREEN
SelectionUtils.java 33aec7cccccb28e5568140cf8e5443ce0f9f59f7 GREEN SelectionUtils.java 33aec7cccccb28e5568140cf8e5443ce0f9f59f7 GREEN
......
...@@ -29,6 +29,7 @@ import org.eclipse.jface.databinding.swt.WidgetProperties; ...@@ -29,6 +29,7 @@ import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.jface.fieldassist.ControlDecoration; import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Widget;
/** /**
* Utility methods for data binding support. * Utility methods for data binding support.
...@@ -214,12 +215,38 @@ public final class DataBindingUtils { ...@@ -214,12 +215,38 @@ public final class DataBindingUtils {
* @param control * @param control
* the source {@link Control} * the source {@link Control}
* @return an observable value observing this value property on the given * @return an observable value observing this value property on the given
* widget * {@link Control}.
*/ */
public static ISWTObservableValue observeText(Control control, final int event) { public static ISWTObservableValue observeText(Control control, final int event) {
return WidgetProperties.text(event).observe(control); return WidgetProperties.text(event).observe(control);
} }
/**
* Returns an {@link ISWTObservableValue} observing this value property on
* the given {@link Widget}.
*
* @param widget
* the {@link Widget}
* @return an observable value observing this value property on the given
* {@link Widget}.
*/
public static ISWTObservableValue observeSelection(Widget widget) {
return WidgetProperties.selection().observe(widget);
}
/**
* Returns an observable value tracking the visible state of the given
* {@link Control}.
*
* @param control
* the {@link Control}
* @return an observable value tracking the visible state of the given
* {@link Control}.
*/
public static ISWTObservableValue observeVisible(Control control) {
return WidgetProperties.visible().observe(control);
}
/** /**
* Performs a complex binding of a cell editor control to a model element. The * Performs a complex binding of a cell editor control to a model element. The
* validation is performed on modification (i.e. always), while model * validation is performed on modification (i.e. always), while model
......
...@@ -13,7 +13,11 @@ ...@@ -13,7 +13,11 @@
| See the License for the specific language governing permissions and | | See the License for the specific language governing permissions and |
| limitations under the License. | | limitations under the License. |
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.dialog; package org.fortiss.tooling.kernel.ui.util;
import static org.conqat.ide.commons.ui.dialog.MessageUtils.showError;
import static org.conqat.ide.commons.ui.dialog.MessageUtils.showInfo;
import static org.conqat.ide.commons.ui.dialog.MessageUtils.showWarning;
import org.conqat.ide.commons.ui.dialog.MessageUtils; import org.conqat.ide.commons.ui.dialog.MessageUtils;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
...@@ -33,20 +37,25 @@ public class MessageUtilsExtended { ...@@ -33,20 +37,25 @@ public class MessageUtilsExtended {
syncExec(new Runnable() { syncExec(new Runnable() {
@Override @Override
public void run() { public void run() {
tempQuestionResult = MessageUtils.askQuestion(title, message); tempQuestionResult = askQuestion(title, message);
} }
}); });
return tempQuestionResult; return tempQuestionResult;
} }
/** Opens a error dialog in the UI thread. */
public static void showErrorInUIThread(final String title, final String message) {
syncExec(() -> showError(title, message));
}
/** Opens a warning dialog in the UI thread. */ /** Opens a warning dialog in the UI thread. */
public static void showWarningInUIThread(final String title, final String message) { public static void showWarningInUIThread(final String title, final String message) {
syncExec(() -> MessageUtils.showWarning(title, message)); syncExec(() -> showWarning(title, message));
} }
/** Opens an info dialog in the UI thread. */ /** Opens an info dialog in the UI thread. */
public static void showInfoInUIThread(final String title, final String message) { public static void showInfoInUIThread(final String title, final String message) {
syncExec(() -> MessageUtils.showInfo(title, message)); syncExec(() -> showInfo(title, message));
} }
/** Execute runnable in the UI thread */ /** Execute runnable in the UI thread */
......
ConstraintBases.java 93b4743cc1f5e2677635e644663ba934ef7f7f4e GREEN ConstraintBases.java 93b4743cc1f5e2677635e644663ba934ef7f7f4e GREEN
ConstraintCheckerBase.java 92de33f1a3071dc6d66a55d8c10f5d5cc967a4fc GREEN ConstraintCheckerBase.java 92de33f1a3071dc6d66a55d8c10f5d5cc967a4fc GREEN
ConstraintViolationBase.java ec66973ab2183623f0cd4a85c59c886dddad6cf6 GREEN ConstraintViolationBase.java ec66973ab2183623f0cd4a85c59c886dddad6cf6 GREEN
DialogMessage.java 8420640e999e4fb15fa644333e5d71e1d16c2559 GREEN
ElementCompositorBase.java 7a445e5adde11878fe0515baca8b915287149b28 GREEN ElementCompositorBase.java 7a445e5adde11878fe0515baca8b915287149b28 GREEN
MultiViolationConstraintCheckerBase.java 30886a94c99cf8948f64401b1db821abe06e1e6c GREEN MultiViolationConstraintCheckerBase.java 30886a94c99cf8948f64401b1db821abe06e1e6c GREEN
PrototypeProviderBase.java ebcd1794c3798b9899a620b01fd5aa0402129423 GREEN PrototypeProviderBase.java ebcd1794c3798b9899a620b01fd5aa0402129423 GREEN
......
/*-------------------------------------------------------------------------+
| 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.kernel.extension.base;
import org.fortiss.tooling.kernel.extension.data.LogMessage;
import org.fortiss.tooling.kernel.service.ILoggingService;
/**
* {@link LogMessage} that presents a defined string in a dialog to the user. It uses the
* {@link ILoggingService} to emit messages from non-UI plugins.
*
* @author diewald
*/
public class DialogMessage extends LogMessage {
/** Denotes the type of message for presenting the correct dialog type. */
@SuppressWarnings("javadoc")
public enum MSG_TYPE {
INFORMATION, WARNING, ERROR
}
/** Holds the severity of the message. */
private MSG_TYPE severity = MSG_TYPE.INFORMATION;
/** Constructor. Default severity: {@link MSG_TYPE#INFORMATION}. */
public DialogMessage(String dialogMsg) {
super(dialogMsg);
}
/** Constructor. Allows defining the severity. */
public DialogMessage(String dialogMsg, MSG_TYPE severity) {
super(dialogMsg);
this.severity = severity;
}
/** Returns the severity of the message. */
public MSG_TYPE getSeverity() {
return severity;
}
}
...@@ -8,7 +8,7 @@ HierarchicalNameComparator.java 6face1b673126701a0721af48ead2f9766c17d46 GREEN ...@@ -8,7 +8,7 @@ HierarchicalNameComparator.java 6face1b673126701a0721af48ead2f9766c17d46 GREEN
IdentifierUtils.java fff43dc4e84cdd89c3ece4f5d9d89aec4b0749c2 GREEN IdentifierUtils.java fff43dc4e84cdd89c3ece4f5d9d89aec4b0749c2 GREEN
JavaUtils.java 65cdadfb9137a240ad59992eacf53a15b7f20804 GREEN JavaUtils.java 65cdadfb9137a240ad59992eacf53a15b7f20804 GREEN
KernelModelElementUtils.java 56c86fe9afb23053f50d7279809afd2a5bb10eba GREEN KernelModelElementUtils.java 56c86fe9afb23053f50d7279809afd2a5bb10eba GREEN
LoggingUtils.java a982f7c3371e72feb8658510b5b0358876281a12 GREEN LoggingUtils.java 0e0aa5d466d80ea29cfc7e91178b23a5cdd4ddf7 GREEN
PrototypesUtils.java ec75bed75cfc5103f1f38e3a29df86f729428775 GREEN PrototypesUtils.java ec75bed75cfc5103f1f38e3a29df86f729428775 GREEN
ResourceUtils.java 698c7db34acb4f1a258a1953e6afcca9823763a8 GREEN ResourceUtils.java 698c7db34acb4f1a258a1953e6afcca9823763a8 GREEN
TransformationUtils.java 495891fae79b99c103cf61f607792dd1e48a5307 GREEN TransformationUtils.java 495891fae79b99c103cf61f607792dd1e48a5307 GREEN
......
...@@ -18,6 +18,9 @@ package org.fortiss.tooling.kernel.utils; ...@@ -18,6 +18,9 @@ package org.fortiss.tooling.kernel.utils;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.fortiss.tooling.kernel.extension.base.DialogMessage;
import org.fortiss.tooling.kernel.extension.base.DialogMessage.MSG_TYPE;
import org.fortiss.tooling.kernel.service.ILoggingService;
/** /**
* Utility code for performing logging. * Utility code for performing logging.
...@@ -126,4 +129,37 @@ public class LoggingUtils { ...@@ -126,4 +129,37 @@ public class LoggingUtils {
public static void info(Plugin plugin, String message) { public static void info(Plugin plugin, String message) {
info(plugin, message, null); info(plugin, message, null);
} }
/**
* Presents an error dialog to the user.
*
* @param message
* to be displayed.
*/
public static void showError(String message) {
ILoggingService.getInstance().processMessage(new DialogMessage(message, MSG_TYPE.ERROR),
null);
}
/**
* Presents a warning dialog to the user.
*
* @param message
* to be displayed.
*/
public static void showWarning(String message) {
ILoggingService.getInstance().processMessage(new DialogMessage(message, MSG_TYPE.WARNING),
null);
}
/**
* Presents a warning dialog to the user.
*
* @param message
* to be displayed.
*/
public static void showInfo(String message) {
ILoggingService.getInstance()
.processMessage(new DialogMessage(message, MSG_TYPE.INFORMATION), null);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment