Skip to content

Commit

Permalink
Fixed missing elements from Designer Palette Context Menu (#337)
Browse files Browse the repository at this point in the history
Fixed missing elements from Designer Palette Context Menu by adding in
old code that was removed during commit of new feature
  • Loading branch information
MarcelduPreez authored Oct 23, 2022
1 parent b6546b8 commit 0266cab
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
package org.eclipse.wb.internal.core.editor.palette;

import org.eclipse.wb.core.controls.palette.IPalette;
import org.eclipse.wb.core.editor.constants.IEditorPreferenceConstants;
import org.eclipse.wb.core.editor.palette.model.CategoryInfo;
import org.eclipse.wb.core.editor.palette.model.EntryInfo;
import org.eclipse.wb.core.editor.palette.model.entry.ComponentEntryInfo;
Expand All @@ -23,6 +24,7 @@
import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils;
import org.eclipse.wb.internal.core.utils.execution.RunnableEx;

import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
Expand All @@ -34,6 +36,8 @@
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Shell;

import org.osgi.service.prefs.Preferences;

import java.text.MessageFormat;

/**
Expand Down Expand Up @@ -102,6 +106,15 @@ public void run() {
}

private void addPopupActions_edit(IMenuManager menuManager, Object target, int type) {

Preferences preferences = InstanceScope.INSTANCE
.getNode(IEditorPreferenceConstants.WB_BASIC_UI_PREFERENCE_NODE);
boolean windowbuilderBasic = preferences.getBoolean(IEditorPreferenceConstants.WB_BASIC_UI, false);

if (!windowbuilderBasic) {
addPopupActions_edit_unUsed(menuManager, target);
menuManager.add(new Separator());
}
// add layout action
{
IMenuManager layoutMenuManager = new MenuManager("Layout");
Expand Down

0 comments on commit 0266cab

Please sign in to comment.