Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • af3/kernel
  • diewald/kernel
2 results
Show changes
Commits on Source (38)
Showing
with 148 additions and 27 deletions
......@@ -2,10 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tooling Base UI
Bundle-SymbolicName: org.fortiss.tooling.base.ui;singleton:=true
Bundle-Version: 2.22.0.qualifier
Bundle-Version: 2.23.0.qualifier
Bundle-Activator: org.fortiss.tooling.base.ui.ToolingBaseUIActivator
Require-Bundle: org.fortiss.tooling.base;bundle-version="2.22.0";visibility:=reexport,
org.fortiss.tooling.kernel.ui;bundle-version="2.22.0";visibility:=reexport,
Require-Bundle: org.fortiss.tooling.base;bundle-version="2.23.0";visibility:=reexport,
org.fortiss.tooling.kernel.ui;bundle-version="2.23.0";visibility:=reexport,
org.eclipse.swt,
org.fortiss.tooling.common.ui
Bundle-ActivationPolicy: lazy
......
AbstractNameEditingSupport.java c57336a0e0da18711a1610ca667dfea76728807f GREEN
ActionUtils.java 322f43d4f92f992daef8ac88eb0f9197c840c89b GREEN
ContextMenuUtils.java 1b4f2a63dfca9ad363942baf320c93145c251836 GREEN
ContextMenuUtils.java ac3ce102c5b0cf00ed6ef5d91078c91581d169de GREEN
EllipseLayoutUIUtils.java 0af2cfc038661828b1bb8c51c0a3816d453e8313 GREEN
FXDNDUtils.java 6ce94e239e68f9e2b3cc0524b072606f4a120076 GREEN
FontUtils.java a167a05bdaa8da9853705cc5134f30f6d81bc9f2 GREEN
......
......@@ -21,6 +21,9 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IContributionItem;
import org.fortiss.tooling.base.dnd.ElementDropContext;
import org.fortiss.tooling.base.layout.IAutoLayouter;
import org.fortiss.tooling.base.layout.KielerAutoLayouter;
......@@ -33,6 +36,8 @@ import org.fortiss.tooling.kernel.service.ICommandStackService;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
import org.fortiss.tooling.kernel.service.IPrototypeService;
import org.fortiss.tooling.kernel.ui.extension.IModelEditor;
import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider;
import org.fortiss.tooling.kernel.ui.service.IContextMenuService;
import org.fortiss.tooling.kernel.ui.service.IModelEditorBindingService;
import javafx.scene.control.Menu;
......@@ -149,4 +154,36 @@ public final class ContextMenuUtils {
Point loc = createPoint((int)x, (int)y, "CompositionPoint");
return new ElementDropContext(target, loc, isRoot, zoom);
}
/**
* Creates javafx context {@link MenuItem}s for the given 'target' {@link EObject}, using the
* {@link IContextMenuService}.
*
* @param target
* The {@link EObject} to create context {@link MenuItem}s.
* @param contextProvider
* The {@link ContextMenuContextProvider} to provide for the
* {@link IContextMenuService}.
* @return A {@link List} of {@link MenuItem}s for the given 'target'
*/
public static List<MenuItem> createContextMenuEntriesFromService(EObject target,
ContextMenuContextProvider contextProvider) {
List<MenuItem> ret = new ArrayList<MenuItem>();
List<IContributionItem> contributions = IContextMenuService.getInstance()
.getContextMenuContributions(target, contextProvider);
for(IContributionItem c : contributions) {
if(c instanceof ActionContributionItem) {
IAction action = ((ActionContributionItem)c).getAction();
MenuItem menuItem = new MenuItem(action.getText());
menuItem.setOnAction(evt -> {
action.run();
});
ret.add(menuItem);
}
}
return ret;
}
}
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.fortiss.tooling.base;singleton:=true
Bundle-Version: 2.22.0.qualifier
Bundle-Version: 2.23.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
......
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tooling Commons UI
Bundle-SymbolicName: org.fortiss.tooling.common.ui;singleton:=true
Bundle-Version: 2.22.0.qualifier
Bundle-Version: 2.23.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.fortiss.tooling.common;visibility:=reexport,
org.eclipse.core.resources;visibility:=reexport,
......
......@@ -5,7 +5,7 @@ DynamicTextFieldTreeTableCell.java 62fa0c08b11d87e0eed41f84be85505c2740e75d GREE
DynamicTreeContentProviderBase.java 91896b1fb5104d126544c44c1ff8c30f2a13a8d6 GREEN
DynamicTreeItem.java 7e81ea98038b5eca90df583e0268d4e8f37aaf25 GREEN
DynamicTreeItemBase.java d883066ecc181120302ca32f328538de7a45b093 GREEN
DynamicTreeTableUIProviderBase.java 29aa753793ab90676d45e5b76b11f7b46ce02a97 GREEN
DynamicTreeTableUIProviderBase.java 360df9d5114c5d4a391a7a7afe70a5b8ad584490 GREEN
DynamicTreeTableViewer.java 77e9995a3bee37d57578dad9434a53c702128efa YELLOW
DynamicTreeUIProviderBase.java 82d3c051213f0147f4c67ad247a08696cee73110 GREEN
DynamicTreeViewer.java 33066062a82101cf28410e4d04f85bb9c24251db GREEN
......
......@@ -322,6 +322,8 @@ public abstract class DynamicTreeTableUIProviderBase<T> {
final Node icon = getIconNode(data, columnIndex);
cell.setGraphic(icon);
cell.setStyle(getCellStyle(data, columnIndex));
addContextMenuToCell(cell, columnIndex);
} else {
// reset icon for cases, in which a row was styled before, but became empty by now.
cell.setGraphic(null);
......@@ -585,7 +587,7 @@ public abstract class DynamicTreeTableUIProviderBase<T> {
* @param columnIndex
* The column index of the given {@code cell}.
*/
private void addContextMenuToCell(TreeTableCell<T, String> cell, int columnIndex) {
private void addContextMenuToCell(TreeTableCell<T, ?> cell, int columnIndex) {
ContextMenu menu;
T data = cell.getTreeTableRow().getItem();
......@@ -603,7 +605,7 @@ public abstract class DynamicTreeTableUIProviderBase<T> {
* {@link DynamicTreeViewer} due to the absence of proper selection interfaces in
* JFX.
*/
private void addContextMenuHandler(TreeTableCell<T, String> cell, ContextMenu menu, T element) {
private void addContextMenuHandler(TreeTableCell<T, ?> cell, ContextMenu menu, T element) {
cell.getTreeTableView().addEventHandler(MouseEvent.MOUSE_RELEASED, e -> {
if(e.getButton() == MouseButton.SECONDARY) {
TreeItem<T> selected =
......
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tooling Commons
Bundle-SymbolicName: org.fortiss.tooling.common;singleton:=true
Bundle-Version: 2.22.0.qualifier
Bundle-Version: 2.23.0.qualifier
Require-Bundle: org.eclipse.core.runtime;visibility:=reexport,
com.ibm.icu;visibility:=reexport,
org.junit;visibility:=reexport
......
......@@ -3,7 +3,7 @@ Automatic-Module-Name: org.fortiss.tooling.ext.reuse.ui
Bundle-ManifestVersion: 2
Bundle-Name: AF3 Reuse UI
Bundle-SymbolicName: org.fortiss.tooling.ext.reuse.ui;singleton:=true
Bundle-Version: 2.22.0.qualifier
Bundle-Version: 2.23.0.qualifier
Bundle-Activator: org.fortiss.tooling.ext.reuse.ui.ToolingReuseUIActivator
Require-Bundle: org.eclipse.ui.ide;visibility:=reexport,
org.fortiss.tooling.base.ui;visibility:=reexport,
......
org.fortiss.tooling.ext.reuse.ui/icons/af3_icon64.png

6.11 KiB

org.fortiss.tooling.ext.reuse.ui/icons/af3_logo.png

22.2 KiB

org.fortiss.tooling.ext.reuse.ui/icons/af3_logo_square.png

33.5 KiB

ReuseLibraryUIUtils.java 0f8d233c725d9dbd39ff6613a69c997786264054 GREEN
ReuseLibraryUIUtils.java fed62784975bf8e6fc1625505636e247dfb6c86e GREEN
ReuseLibraryViewUtils.java 34a852dc692ec56cb3e9fd8dcea99d64f31503b3 GREEN
......@@ -16,10 +16,12 @@
package org.fortiss.tooling.ext.reuse.ui.utils;
import static java.lang.String.join;
import static javafx.scene.control.Alert.AlertType.INFORMATION;
import static org.conqat.ide.commons.ui.dialog.MessageUtils.askQuestion;
import static org.conqat.ide.commons.ui.dialog.MessageUtils.showInfo;
import static org.conqat.ide.commons.ui.dialog.MessageUtils.showWarning;
import static org.conqat.ide.commons.ui.ui.WorkbenchUtils.getActiveWorkbenchWindow;
import static org.fortiss.tooling.common.ui.javafx.util.GraphicUtils.getFXImage;
import static org.fortiss.tooling.ext.reuse.storage.ReuseLibraryStorageManager.REUSE_PROJECT_DIR;
import static org.fortiss.tooling.ext.reuse.utils.ReuseLibraryUtilsBasics.getAllReuseSpecs;
import static org.fortiss.tooling.ext.reuse.utils.ReuseLibraryUtilsBasics.getElementInsideLibrary;
......@@ -35,8 +37,16 @@ import org.eclipse.swt.widgets.Shell;
import org.fortiss.tooling.base.model.element.IModelElement;
import org.fortiss.tooling.ext.reuse.model.ReuseElementSpec;
import org.fortiss.tooling.ext.reuse.model.ReuseLibrary;
import org.fortiss.tooling.ext.reuse.ui.ToolingReuseUIActivator;
import org.fortiss.tooling.ext.reuse.ui.dialog.SelectLibDialog;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.DialogPane;
import javafx.scene.control.TextArea;
import javafx.scene.image.Image;
import javafx.stage.Stage;
/**
* Utility methods for {@link ReuseLibrary}s' UI.
*
......@@ -44,6 +54,12 @@ import org.fortiss.tooling.ext.reuse.ui.dialog.SelectLibDialog;
*/
public class ReuseLibraryUIUtils {
/** Standard width preference for dialog windows used in the reuse context. */
private final static Double DIALOG_WINDOW_WIDTH_PREF = 700.0;
/** Standard height preference for dialog windows used in the reuse context. */
private final static Double DIALOG_WINDOW_HEIGHT_PREF = 500.0;
/**
* Returns the selected {@link ReuseElementSpec} by user from all
* {@link ReuseElementSpec}s of the given element. Returns null if no
......@@ -231,18 +247,84 @@ public class ReuseLibraryUIUtils {
List<EObject> externalRefs = getExternalReferencesOfElement(reuseElement);
if (!externalRefs.isEmpty()) {
String infoMessage = "The following elements were found as references inside the reuse element you "
String headerText = "The following elements were found as references inside the reuse element you "
+ actionText + ".\n\nIn case of reusing this element" + currentReuseTest
+ ", these referenced elements will be needed in the new environment, too. "
+ "Therefore, you might want to add/update these reference elements as well (if not already done).\n";
String bodyText = "";
for (EObject externalRef : externalRefs) {
infoMessage += "\n- " + getReuseElementName(externalRef) + " (" + externalRef.getClass().getSimpleName()
bodyText += "\n- " + getReuseElementName(externalRef) + " (" + externalRef.getClass().getSimpleName()
+ ")";
if (getReuseElementName(externalRef).equals(getReuseElementName(reuseElement))) {
infoMessage += " [ignore this if it is actually " + sourceText + "]";
bodyText += " [ignore this if it is actually " + sourceText + "]";
}
}
showInfo(infoTitle, infoMessage);
showBasicScrollableInformation(shellTitle, headerText, bodyText);
}
}
/**
* Creates and displays a information box with only an OK button. Everything is
* already set except the text for the title, the header and the body.
*
* @param windowTitle The title of the dialog window
* @param headerText The text of the header between title and body
* @param bodyText The actual text body
*/
public static void showBasicScrollableInformation(String windowTitle, String headerText, String bodyText) {
boolean showSymbol = true;
showCustomScrollableAlert(INFORMATION, windowTitle, headerText, bodyText, showSymbol, DIALOG_WINDOW_WIDTH_PREF,
DIALOG_WINDOW_HEIGHT_PREF);
}
/**
* Creates and displays a dialog/alert message box depending on the given
* {@link AlertType}. You can customize the title, the text in the header, if
* the symbol besides the header should be displayed, the actual text body and
* the preferred size of the window (null if nothing is preferred).
*
* @param alertType The alert type like Information, Error, etc.
* @param windowTitle The title of the dialog window
* @param headerText The text of the header between title and body
* @param bodyText The actual text body
* @param showSymbol Whether the symbol besides the header text should be
* displayed
* @param windowPrefWidth Preferred width of the window
* @param windowPrefHeight Preferred height of the window
*/
public static void showCustomScrollableAlert(AlertType alertType, String windowTitle, String headerText,
String bodyText, boolean showSymbol, Double windowPrefWidth, Double windowPrefHeight) {
Alert alert = new Alert(alertType);
if (!showSymbol) {
alert.setGraphic(null);
}
alert.setTitle(windowTitle);
alert.setHeaderText(headerText);
alert.setResizable(true);
TextArea area = new TextArea(bodyText);
area.setWrapText(true);
area.setEditable(false);
DialogPane dialogPane = alert.getDialogPane();
Image taskbarIcon = getFXImage(ToolingReuseUIActivator.PLUGIN_ID, "icons/af3_icon64.png");
Stage stage = (Stage) dialogPane.getScene().getWindow();
stage.getIcons().add(taskbarIcon);
// use setExpandableContent(area) if the scrollable text should be first hidden
// under "Show details". Then, alert.setContentText() can be used to show a
// short message before
dialogPane.setContent(area);
if (windowPrefWidth != null && windowPrefWidth > 0.0) {
dialogPane.setPrefWidth(windowPrefWidth);
}
if (windowPrefHeight != null && windowPrefHeight > 0.0) {
dialogPane.setPrefHeight(windowPrefHeight);
}
alert.showAndWait();
}
}
......@@ -3,7 +3,7 @@ Automatic-Module-Name: org.fortiss.tooling.ext.reuse
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.fortiss.tooling.ext.reuse;singleton:=true
Bundle-Version: 2.22.0.qualifier
Bundle-Version: 2.23.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
......
ReuseLibraryModelElementFactory.java 4ee3eb7449e212643992a3dec6cfb8f4278efb70 GREEN
ReuseLibraryUtilsBasics.java 9aa543630acf9555721821519d96d4356a07f341 GREEN
ReuseLibraryUtilsBasics.java b651b31f6d94ff98a8f965440d662bfc4655c31b GREEN
ReuseLibraryUtilsManipulation.java 77a646db5a63ba7c61664dbcaf34a9036003fde5 GREEN
......@@ -45,10 +45,10 @@ import org.fortiss.tooling.kernel.model.INamedElement;
public class ReuseLibraryUtilsBasics {
/** Standard internal date format used for reuse (e.g. for hash dates) */
public static DateTimeFormatter internalReuseDateFormatter = ISO_DATE_TIME;
public final static DateTimeFormatter INTERNAL_REUSE_DATE_FORMATTER = ISO_DATE_TIME;
/** Standard date format used for reuse (easier readable) */
public static DateTimeFormatter displayReuseDateFormatter = RFC_1123_DATE_TIME;
public final static DateTimeFormatter DISPLAY_REUSE_DATE_FORMATTER = RFC_1123_DATE_TIME;
/**
* Returns whether the given element can be used as reuse element.
......@@ -343,9 +343,9 @@ public class ReuseLibraryUtilsBasics {
public static String getDateAsString(ZonedDateTime date, boolean forDisplay) {
if (date != null) {
if (forDisplay) {
return displayReuseDateFormatter.format(date);
return DISPLAY_REUSE_DATE_FORMATTER.format(date);
} else {
return internalReuseDateFormatter.format(date);
return INTERNAL_REUSE_DATE_FORMATTER.format(date);
}
}
return "";
......
......@@ -3,7 +3,7 @@ Automatic-Module-Name: org.fortiss.tooling.ext.variability.ui
Bundle-ManifestVersion: 2
Bundle-Name: fortiss AF3 variability UI
Bundle-SymbolicName: org.fortiss.tooling.ext.variability.ui;singleton:=true
Bundle-Version: 2.22.0.qualifier
Bundle-Version: 2.23.0.qualifier
Bundle-Activator: org.fortiss.tooling.ext.variability.ui.VariabilityUIActivator
Require-Bundle: org.fortiss.tooling.ext.variability;visibility:=reexport,
org.fortiss.tooling.base.ui;visibility:=reexport
......
......@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.fortiss.tooling.ext.variability;singleton:=true
Automatic-Module-Name: org.fortiss.tooling.ext.variability
Bundle-Version: 2.22.0.qualifier
Bundle-Version: 2.23.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
......
DependingElementProviderService.java 5c4547e63b0f2ff547e0c3a7253105466e0b94c1 GREEN
IDependingElementProvider.java bd4b7ff7c0a25368fc86d7fb26ecaa8a5234c76b GREEN
IDependingElementProviderService.java 9b59f524a513caf9f5a2b6d16d3523a643b7cc9e GREEN
DependingElementProviderService.java a041f3b5ff00984304ea94e9333555192c990053 GREEN
IDependingElementProvider.java 11b174e8a48f2152a0cc6066335e471cf288893c GREEN
IDependingElementProviderService.java 5bbff0a28f64b01331a6a5424cdb2104c000b57d GREEN