use of org.jkiss.dbeaver.erd.ui.action.DiagramLayoutAction in project dbeaver by serge-rider.
the class ERDEditorPart method fillDefaultEditorContributions.
protected void fillDefaultEditorContributions(IContributionManager toolBarManager) {
ZoomManager zoomManager = rootPart.getZoomManager();
String[] zoomStrings = new String[] { ZoomManager.FIT_ALL, ZoomManager.FIT_HEIGHT, ZoomManager.FIT_WIDTH };
// Init zoom combo with dummy part service
// to prevent zoom disable on part change - as it is standalone zoom control, not global one
zoomCombo = new ZoomComboContributionItem(new IPartService() {
@Override
public void addPartListener(IPartListener listener) {
}
@Override
public void addPartListener(IPartListener2 listener) {
}
@Override
public IWorkbenchPart getActivePart() {
return ERDEditorPart.this;
}
@Override
public IWorkbenchPartReference getActivePartReference() {
return null;
}
@Override
public void removePartListener(IPartListener listener) {
}
@Override
public void removePartListener(IPartListener2 listener) {
}
}, zoomStrings);
zoomCombo.setZoomManager(zoomManager);
toolBarManager.add(zoomCombo);
// toolBarManager.add(new UndoAction(ERDEditorPart.this));
// toolBarManager.add(new RedoAction(ERDEditorPart.this));
// toolBarManager.add(new PrintAction(ERDEditorPart.this));
ZoomInAction zoomInAction = new ZoomInAction(zoomManager);
zoomInAction.setImageDescriptor(DBeaverIcons.getImageDescriptor(UIIcon.ZOOM_IN));
ZoomOutAction zoomOutAction = new ZoomOutAction(zoomManager);
zoomOutAction.setImageDescriptor(DBeaverIcons.getImageDescriptor(UIIcon.ZOOM_OUT));
toolBarManager.add(zoomInAction);
toolBarManager.add(zoomOutAction);
toolBarManager.add(new Separator());
// toolBarManager.add(createAttributeVisibilityMenu());
toolBarManager.add(new DiagramLayoutAction(ERDEditorPart.this));
toolBarManager.add(new DiagramToggleGridAction());
toolBarManager.add(new DiagramRefreshAction(ERDEditorPart.this));
toolBarManager.add(new Separator());
{
toolBarManager.add(ActionUtils.makeCommandContribution(getSite(), IWorkbenchCommandConstants.FILE_PRINT, ERDUIMessages.erd_editor_control_action_print_diagram, UIIcon.PRINT));
toolBarManager.add(ActionUtils.makeCommandContribution(getSite(), IWorkbenchCommandConstants.FILE_SAVE_AS, ERDUIMessages.erd_editor_control_action_save_external_format, UIIcon.PICTURE_SAVE));
toolBarManager.add(ActionUtils.makeCommandContribution(getSite(), IWorkbenchCommandConstants.FILE_SAVE, null, UIIcon.SAVE));
}
toolBarManager.add(new Separator());
{
Action configAction = new Action(ERDUIMessages.erd_editor_control_action_configuration) {
@Override
public void run() {
UIUtils.showPreferencesFor(getSite().getShell(), ERDEditorPart.this, ERDPreferencePage.PAGE_ID);
}
};
configAction.setImageDescriptor(DBeaverIcons.getImageDescriptor(UIIcon.CONFIGURATION));
toolBarManager.add(configAction);
}
}
use of org.jkiss.dbeaver.erd.ui.action.DiagramLayoutAction in project dbeaver by serge-rider.
the class ERDEditorContextMenuProvider method buildContextMenu.
/**
* @see ContextMenuProvider#buildContextMenu(org.eclipse.jface.action.IMenuManager)
*/
@Override
public void buildContextMenu(IMenuManager menu) {
if (editor.isLoaded()) {
ISelection selection = editor.getGraphicalViewer().getSelection();
if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
editor.fillPartContextMenu(menu, (IStructuredSelection) selection);
}
menu.add(new Separator());
editor.fillAttributeVisibilityMenu(menu);
menu.add(new DiagramLayoutAction(editor));
menu.add(new Separator());
menu.add(new Separator(GEFActionConstants.GROUP_UNDO));
menu.add(new Separator(GEFActionConstants.GROUP_COPY));
// menu.add(ActionUtils.makeCommandContribution(editor.getSite(), IWorkbenchCommandConstants.EDIT_COPY));
menu.add(new Separator(GEFActionConstants.GROUP_PRINT));
menu.add(new Separator(GEFActionConstants.GROUP_EDIT));
menu.add(new Separator(GEFActionConstants.GROUP_VIEW));
menu.add(new Separator(GEFActionConstants.GROUP_FIND));
menu.add(new Separator(GEFActionConstants.GROUP_REST));
menu.add(new Separator(GEFActionConstants.GROUP_SAVE));
menu.add(new Separator());
menu.add(new GroupMarker(NavigatorCommands.GROUP_TOOLS));
menu.add(new GroupMarker(NavigatorCommands.GROUP_NAVIGATOR_ADDITIONS));
menu.add(new GroupMarker(NavigatorCommands.GROUP_NAVIGATOR_ADDITIONS_END));
menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(new GroupMarker(IActionConstants.MB_ADDITIONS_END));
}
}
use of org.jkiss.dbeaver.erd.ui.action.DiagramLayoutAction in project dbeaver by dbeaver.
the class ERDEditorContextMenuProvider method buildContextMenu.
/**
* @see ContextMenuProvider#buildContextMenu(org.eclipse.jface.action.IMenuManager)
*/
@Override
public void buildContextMenu(IMenuManager menu) {
if (editor.isLoaded()) {
ISelection selection = editor.getGraphicalViewer().getSelection();
if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
editor.fillPartContextMenu(menu, (IStructuredSelection) selection);
}
menu.add(new Separator());
editor.fillAttributeVisibilityMenu(menu);
menu.add(new DiagramLayoutAction(editor));
menu.add(new Separator());
menu.add(new Separator(GEFActionConstants.GROUP_UNDO));
menu.add(new Separator(GEFActionConstants.GROUP_COPY));
// menu.add(ActionUtils.makeCommandContribution(editor.getSite(), IWorkbenchCommandConstants.EDIT_COPY));
menu.add(new Separator(GEFActionConstants.GROUP_PRINT));
menu.add(new Separator(GEFActionConstants.GROUP_EDIT));
menu.add(new Separator(GEFActionConstants.GROUP_VIEW));
menu.add(new Separator(GEFActionConstants.GROUP_FIND));
menu.add(new Separator(GEFActionConstants.GROUP_REST));
menu.add(new Separator(GEFActionConstants.GROUP_SAVE));
menu.add(new Separator());
menu.add(new GroupMarker(NavigatorCommands.GROUP_TOOLS));
menu.add(new GroupMarker(NavigatorCommands.GROUP_NAVIGATOR_ADDITIONS));
menu.add(new GroupMarker(NavigatorCommands.GROUP_NAVIGATOR_ADDITIONS_END));
menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(new GroupMarker(IActionConstants.MB_ADDITIONS_END));
}
}
use of org.jkiss.dbeaver.erd.ui.action.DiagramLayoutAction in project dbeaver by dbeaver.
the class ERDEditorPart method fillDefaultEditorContributions.
protected void fillDefaultEditorContributions(IContributionManager toolBarManager) {
ZoomManager zoomManager = rootPart.getZoomManager();
String[] zoomStrings = new String[] { ZoomManager.FIT_ALL, ZoomManager.FIT_HEIGHT, ZoomManager.FIT_WIDTH };
// Init zoom combo with dummy part service
// to prevent zoom disable on part change - as it is standalone zoom control, not global one
zoomCombo = new ZoomComboContributionItem(new IPartService() {
@Override
public void addPartListener(IPartListener listener) {
}
@Override
public void addPartListener(IPartListener2 listener) {
}
@Override
public IWorkbenchPart getActivePart() {
return ERDEditorPart.this;
}
@Override
public IWorkbenchPartReference getActivePartReference() {
return null;
}
@Override
public void removePartListener(IPartListener listener) {
}
@Override
public void removePartListener(IPartListener2 listener) {
}
}, zoomStrings);
zoomCombo.setZoomManager(zoomManager);
toolBarManager.add(zoomCombo);
// toolBarManager.add(new UndoAction(ERDEditorPart.this));
// toolBarManager.add(new RedoAction(ERDEditorPart.this));
// toolBarManager.add(new PrintAction(ERDEditorPart.this));
ZoomInAction zoomInAction = new ZoomInAction(zoomManager);
zoomInAction.setImageDescriptor(DBeaverIcons.getImageDescriptor(UIIcon.ZOOM_IN));
ZoomOutAction zoomOutAction = new ZoomOutAction(zoomManager);
zoomOutAction.setImageDescriptor(DBeaverIcons.getImageDescriptor(UIIcon.ZOOM_OUT));
toolBarManager.add(zoomInAction);
toolBarManager.add(zoomOutAction);
toolBarManager.add(new Separator());
// toolBarManager.add(createAttributeVisibilityMenu());
toolBarManager.add(new DiagramLayoutAction(ERDEditorPart.this));
toolBarManager.add(new DiagramToggleGridAction());
toolBarManager.add(new DiagramRefreshAction(ERDEditorPart.this));
toolBarManager.add(new Separator());
{
toolBarManager.add(ActionUtils.makeCommandContribution(getSite(), IWorkbenchCommandConstants.FILE_PRINT, ERDUIMessages.erd_editor_control_action_print_diagram, UIIcon.PRINT));
toolBarManager.add(ActionUtils.makeCommandContribution(getSite(), IWorkbenchCommandConstants.FILE_SAVE_AS, ERDUIMessages.erd_editor_control_action_save_external_format, UIIcon.PICTURE_SAVE));
toolBarManager.add(ActionUtils.makeCommandContribution(getSite(), IWorkbenchCommandConstants.FILE_SAVE, null, UIIcon.SAVE));
}
toolBarManager.add(new Separator());
{
Action configAction = new Action(ERDUIMessages.erd_editor_control_action_configuration) {
@Override
public void run() {
UIUtils.showPreferencesFor(getSite().getShell(), ERDEditorPart.this, ERDPreferencePage.PAGE_ID);
}
};
configAction.setImageDescriptor(DBeaverIcons.getImageDescriptor(UIIcon.CONFIGURATION));
toolBarManager.add(configAction);
}
}
Aggregations