use of org.eclipse.jface.action.IAction in project cubrid-manager by CUBRID.
the class SchemaContextMenuProvider method buildTableMenuItems.
/**
* Add menu items for table
*
* @param menu
*/
private void buildTableMenuItems(IMenuManager menu) {
IAction action;
action = getActionRegistry().getAction(EditTableAction.ID);
menu.appendToGroup(AbstractSelectionAction.MANAGE_GROUP_ID, action);
action = getActionRegistry().getAction(AddColumnAction.ID);
menu.appendToGroup(AbstractSelectionAction.MANAGE_GROUP_ID, action);
action = getActionRegistry().getAction(ModifyTableNameAction.ID);
menu.appendToGroup(AbstractSelectionAction.MANAGE_GROUP_ID, action);
action = getActionRegistry().getAction(DeleteAction.ID);
action.setText(Messages.actionDeleteTable);
// action.setImageDescriptor(CommonUIPlugin.getImageDescriptor("icons/action/schema_table_delete.png"));
menu.appendToGroup(AbstractSelectionAction.MANAGE_GROUP_ID, action);
}
use of org.eclipse.jface.action.IAction in project cubrid-manager by CUBRID.
the class UndoAction method run.
/**
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
Control control = getFocusProvider();
if (!(control instanceof StyledText)) {
return;
}
StyledText stext = (StyledText) control;
Object obj = stext.getData(SQLEditorComposite.SQL_EDITOR_FLAG);
if (obj instanceof TextViewer) {
TextViewer viewer = (TextViewer) obj;
if (viewer.getUndoManager() != null) {
viewer.getUndoManager().undo();
}
IAction redoAction = ActionManager.getInstance().getAction(RedoAction.ID);
FocusAction.changeActionStatus(redoAction, stext);
FocusAction.changeActionStatus(this, stext);
}
}
use of org.eclipse.jface.action.IAction in project cubrid-manager by CUBRID.
the class RedoAction method run.
/**
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
Control control = getFocusProvider();
if (!(control instanceof StyledText)) {
return;
}
StyledText stext = (StyledText) control;
Object obj = stext.getData(SQLEditorComposite.SQL_EDITOR_FLAG);
if (obj instanceof TextViewer) {
TextViewer viewer = (TextViewer) obj;
if (viewer.getUndoManager() != null) {
viewer.getUndoManager().redo();
}
IAction undoAction = ActionManager.getInstance().getAction(UndoAction.ID);
FocusAction.changeActionStatus(undoAction, stext);
IAction copyAction = ActionManager.getInstance().getAction(CopyAction.ID);
FocusAction.changeActionStatus(copyAction, stext);
FocusAction.changeActionStatus(this, stext);
}
}
use of org.eclipse.jface.action.IAction in project cubrid-manager by CUBRID.
the class QueryEditorPart method hookRetragetActions.
protected void hookRetragetActions() {
ActionManager actionManager = ActionManager.getInstance();
IActionBars bar = this.getEditorSite().getActionBars();
bar.setGlobalActionHandler(UndoAction.ID, actionManager.getAction(UndoAction.ID));
bar.setGlobalActionHandler(RedoAction.ID, actionManager.getAction(RedoAction.ID));
IAction action = actionManager.getAction(CutAction.ID);
action.setEnabled(true);
bar.setGlobalActionHandler(CutAction.ID, action);
IAction copyAction = actionManager.getAction(CopyAction.ID);
bar.setGlobalActionHandler(CopyAction.ID, copyAction);
copyAction.setEnabled(true);
IAction pasteAction = actionManager.getAction(PasteAction.ID);
bar.setGlobalActionHandler(PasteAction.ID, pasteAction);
pasteAction.setEnabled(true);
bar.setGlobalActionHandler(FindReplaceAction.ID, actionManager.getAction(FindReplaceAction.ID));
bar.setGlobalActionHandler(QueryOpenAction.ID, actionManager.getAction(QueryOpenAction.ID));
bar.updateActionBars();
}
use of org.eclipse.jface.action.IAction in project cubrid-manager by CUBRID.
the class ApplicationActionBarAdvisor method createItem.
/**
* Create action contribution item for action for show text and icon
*
* @param id action ID
* @return ActionContributionItem
*/
private ActionContributionItem createItem(String id) {
ActionManager manager = ActionManager.getInstance();
IAction action = manager.getAction(id);
if (action == null) {
return null;
}
ActionContributionItem item = new ActionContributionItem(action);
item.setMode(ActionContributionItem.MODE_FORCE_TEXT);
return item;
}
Aggregations