/* 2016-07-19 Hyeongseok Heo <harry.heo@samsung.com>
* Modifications by S-Core Co., Ltd.
* 1. Remove project context menu
+ *
+ * 2016-11-22 Hyeongseok Heo <harry.heo@samsung.com>
+ * 2. Restore below menus
+ * - Refresh / Open / Close
*/
package org.eclipse.ui.internal.navigator.resources.actions;
}
}
*/
+ if (!hasClosedProjects) {
+ refreshAction.selectionChanged(selection);
+ menu.appendToGroup(ICommonMenuConstants.GROUP_REORGANIZE, refreshAction);
+ }
+ if (isProjectSelection) {
+ if (hasClosedProjects) {
+ openProjectAction.selectionChanged(selection);
+ menu.appendToGroup(ICommonMenuConstants.GROUP_REORGANIZE, openProjectAction);
+ }
+ if (hasOpenProjects) {
+ closeProjectAction.selectionChanged(selection);
+ menu.appendToGroup(ICommonMenuConstants.GROUP_REORGANIZE, closeProjectAction);
+ }
+ }
/* ===== */
}
* Export<br>
* Copy<br>
* Paste<br>
- * Delete<br>
* Restore from Local History<br>
- * Team<br>
* Compare With<br>
* Replace With<br>
* </ol>
* </ol>
- *
+ * @see {@linkplain org.eclipse.ui.internal.navigator.resources.actions.ResourceMgmtActionProvider}
* @since 3.6
- *
*/
+@SuppressWarnings("javadoc")
public class TizenMenuManager extends MenuManager {
/**
*/
@Override
public void appendToGroup(String groupName, IAction action) {
- /* FIXME Remove below System.out log
- * @author Hyeongseok Heo <harry.heo@samsung.com>
- * @since 2016-08-05
- */
- // System.out.printf("###TizenMenuManager appendToGroup1 groupName:%s\tactionId:%s\tdefId:%s\ttext:%s\n", //$NON-NLS-1$
- // groupName, action.getId(), action.getActionDefinitionId(), action.getText());
-
// Hide Copy Quilified Name
if (ICommonMenuConstants.GROUP_EDIT.equals(groupName)
&& "org.eclipse.wst.jsdt.ui.edit.text.java.copy.qualified.name" //$NON-NLS-1$
|| "export".equals(action.getId()))) { //$NON-NLS-1$
return;
}
- // Hide Edit menus (Copy, Paste, Delete)
+ /* Hide Edit menus (Copy, Paste, Delete)
+ * => Restore Delete
+ * @author Hyeongseok Heo <harry.heo@samsung.com>
+ * @since 2016-11-21
+ */
if (ICommonMenuConstants.GROUP_EDIT.equals(groupName)) {
+ if ("org.eclipse.ui.edit.delete".equals(action.getActionDefinitionId())) { //$NON-NLS-1$
+ super.appendToGroup("group.reorganize", action); //$NON-NLS-1$
+ return;
+ }
return;
}
*/
@Override
public void insert(int index, IContributionItem item) {
- /* FIXME Remove below System.out log
- * @author Hyeongseok Heo <harry.heo@samsung.com>
- * @since 2016-08-05
- */
- // System.out.println("=TizenMenuManager insert: index:" + index + "\titem:" + item.getId()); //$NON-NLS-1$//$NON-NLS-2$
if (isRegrouping(item)) {
return;
}
super.insert(index, item);
}
- /**
+ /*
+ * Check if parameter item should be regrouping as Tizen rule.
+ * If item id equals to reserved id, change the group of the item and return true
+ *
* @param item
- * @return
+ * @return true if item id is equal to reserved id.
*/
private boolean isRegrouping(IContributionItem item) {
// Regrouping Native SA menus
*/
@Override
public void insertAfter(String ID, IContributionItem item) {
- /* FIXME Remove below System.out log
- * @author Hyeongseok Heo <harry.heo@samsung.com>
- * @since 2016-08-05
- */
- // System.out.printf("=TizenMenuManager insertAfter ID:%s\titemId:%s\tisGroup:%s\n", ID, item.getId(), //$NON-NLS-1$
- // item.isGroupMarker());
if (isHideItem(ID, item)) {
return;
}
/**
* Regrouping menus as Tizen rule
- *
* @param iD
* @param item
* @return
/**
* Check and hide menu by Tizen rule
- *
* @param item
* @param id
* @return