Commit f68af2ce authored by Alexander Diewald's avatar Alexander Diewald
Browse files

Revert "Navigator: Align with JFX Context Menu Changes"

This reverts commit 1d395bc7.
parent 1d395bc7
AF3Application.java 9bd897f7c02bfffc9be41c4fcb9ceca088a574b4 GREEN
AF3ApplicationActivator.java cf948c7116dae2311d06e2fa54f51fd05aa3f2e8 GREEN
NewProjectContextMenu.java 41211702d344db4639d43c64026d82f454fbda40 YELLOW
NewProjectContextMenu.java cda28ae7d66ca140f24d13ec2e205c02068c3dc1 GREEN
......@@ -24,14 +24,11 @@ import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.ui.internal.actions.CommandAction;
import org.fortiss.tooling.kernel.ui.extension.IContextMenuContributor;
import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider;
import org.fortiss.tooling.kernel.ui.service.IContextMenuService;
import org.fortiss.tooling.kernel.ui.service.INavigatorService;
import javafx.scene.control.MenuItem;
/**
* Context menu contributions to include new project action.
*
......@@ -39,31 +36,6 @@ import javafx.scene.control.MenuItem;
*/
public class NewProjectContextMenu implements IContextMenuContributor {
/** {@inheritDoc} */
@Override
public List<MenuItem> getContributedMenuItems(EObject selection,
ContextMenuContextProvider contextProvider) {
// if the user right-clicks in an empty area (no selection)
if(selection == null && INavigatorService.getInstance().isNavigatorView(contextProvider) &&
getNewAF3ProjectAction() != null && getNewAF3LibraryAction() != null) {
// add possibility to create new projects to context menu
List<MenuItem> contributionItems = new ArrayList<>();
CommandAction newPrj = getNewAF3ProjectAction();
MenuItem newPrjItem = new MenuItem(newPrj.getText());
newPrjItem.setOnAction(dv -> newPrj.run());
contributionItems.add(newPrjItem);
CommandAction newAf3Library = getNewAF3LibraryAction();
MenuItem newAf3LibraryItem = new MenuItem(newAf3Library.getText());
newAf3LibraryItem.setOnAction(dv -> newAf3Library.run());
contributionItems.add(newAf3LibraryItem);
return contributionItems;
}
return null;
}
/** {@inheritDoc} */
@Override
public List<IContributionItem> getContributedItems(EObject selection,
......
Markdown is supported
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