Author: mdryakhlenkov
Date: 2007-07-05 07:19:58 -0400 (Thu, 05 Jul 2007)
New Revision: 2301
Removed:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/EditorActionContributor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/Messages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/VisualEditor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/VizualEditor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/messages.properties
Log:
JBIDE-559: Hibernate diagram editor cleanup
Deleted:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/EditorActionContributor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/EditorActionContributor.java 2007-07-05
11:19:41 UTC (rev 2300)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/EditorActionContributor.java 2007-07-05
11:19:58 UTC (rev 2301)
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.hibernate.ui.veditor.editors;
-
-import org.eclipse.gef.ui.actions.ActionBarContributor;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
-import org.jboss.tools.hibernate.ui.view.ViewPlugin;
-
-public class EditorActionContributor extends ActionBarContributor {
-
- protected void buildActions() {
- IWorkbenchAction workbenchAction =
ActionFactory.REFRESH.create(getPage().getWorkbenchWindow());
- workbenchAction.setImageDescriptor(ViewPlugin.getImageDescriptor(ViewPlugin.BUNDLE_IMAGE.getString("Explorer.refreshOrmGef")));
//$NON-NLS-1$
- workbenchAction.setToolTipText(Messages.EditorActionContributor_Refresh_Visual_Mapping);
- addAction(workbenchAction);
- }
-
- public void contributeToToolBar(IToolBarManager toolBarManager) {
- toolBarManager.add(getAction(ActionFactory.REFRESH.getId()));
- }
-
- protected void declareGlobalActionKeys() {
- }
-}
\ No newline at end of file
Deleted:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/Messages.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/Messages.java 2007-07-05
11:19:41 UTC (rev 2300)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/Messages.java 2007-07-05
11:19:58 UTC (rev 2301)
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.hibernate.ui.veditor.editors;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME =
"org.jboss.tools.hibernate.ui.veditor.editors.messages";
-
- private Messages() {
- }
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- public static String EditorActionContributor_Refresh_Visual_Mapping;
-}
Deleted:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/VisualEditor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/VisualEditor.java 2007-07-05
11:19:41 UTC (rev 2300)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/VisualEditor.java 2007-07-05
11:19:58 UTC (rev 2301)
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.hibernate.ui.veditor.editors;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gef.DefaultEditDomain;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.dnd.TemplateTransferDropTargetListener;
-import org.eclipse.gef.editparts.ScalableFreeformRootEditPart;
-import org.eclipse.gef.requests.CreationFactory;
-import org.eclipse.gef.requests.SimpleFactory;
-import org.eclipse.gef.ui.actions.WorkbenchPartAction;
-import org.eclipse.gef.ui.parts.GraphicalEditor;
-import org.eclipse.jface.util.TransferDropTargetListener;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.actions.ActionFactory;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.mapping.RootClass;
-import org.jboss.tools.hibernate.ui.veditor.editors.model.OrmDiagram;
-import org.jboss.tools.hibernate.ui.veditor.editors.parts.OrmEditPartFactory;
-import org.jboss.tools.hibernate.ui.view.views.ObjectEditorInput;
-
-public class VisualEditor extends GraphicalEditor {
-
- private OrmDiagram ormDiagram = null;
-
- public VisualEditor() {
- setEditDomain(new DefaultEditDomain(this));
- }
-
- public void doSave(IProgressMonitor monitor) {
- ormDiagram.save();
- ormDiagram.setDirty(false);
- }
-
- public void doSaveAs() {
- }
-
- protected void initializeGraphicalViewer() {
- final GraphicalViewer viewer = getGraphicalViewer();
- viewer.setEditPartFactory(new OrmEditPartFactory());
- viewer.setRootEditPart(new ScalableFreeformRootEditPart());
- viewer.addDropTargetListener(createTransferDropTargetListener());
- viewer.setContents(ormDiagram);
- }
-
- protected void createActions() {
- getEditorSite().getActionBars().setGlobalActionHandler(ActionFactory.REFRESH.getId(),new
WorkbenchPartAction(this){
-
- protected boolean calculateEnabled() {
- return true;
- }
- public void run() {
- ormDiagram.refresh();
- }
- });
- super.createActions();
- }
-
- private TransferDropTargetListener createTransferDropTargetListener() {
- return new TemplateTransferDropTargetListener(getGraphicalViewer()) {
- protected CreationFactory getFactory(Object template) {
- return new SimpleFactory((Class) template);
- }
- };
- }
-
- public boolean isSaveAsAllowed() {
- return false;
- }
-
- public boolean isSaveOnCloseNeeded() {
- return true;
- }
-
- public void refreshDirty() {
- firePropertyChange(IEditorPart.PROP_DIRTY);
- }
-
- public boolean isDirty() {
- return ormDiagram.isDirty();
- }
-
- protected void setInput(IEditorInput input) {
- super.setInput(input);
- ObjectEditorInput objectEditorInput = (ObjectEditorInput)input;
- Configuration configuration = objectEditorInput.getConfiguration();
- RootClass rootClass = (RootClass)(objectEditorInput).getObject();
- setPartName("Diagram for " + rootClass.getClassName());
- ormDiagram = new OrmDiagram(configuration, rootClass);
- }
-}
Deleted:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/VizualEditor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/VizualEditor.java 2007-07-05
11:19:41 UTC (rev 2300)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/VizualEditor.java 2007-07-05
11:19:58 UTC (rev 2301)
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.hibernate.veditor.editors;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gef.DefaultEditDomain;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.dnd.TemplateTransferDropTargetListener;
-import org.eclipse.gef.editparts.ScalableFreeformRootEditPart;
-import org.eclipse.gef.requests.CreationFactory;
-import org.eclipse.gef.requests.SimpleFactory;
-import org.eclipse.gef.ui.actions.WorkbenchPartAction;
-import org.eclipse.gef.ui.parts.GraphicalEditor;
-import org.eclipse.jface.util.TransferDropTargetListener;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.actions.ActionFactory;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.mapping.RootClass;
-import org.jboss.tools.hibernate.veditor.editors.model.OrmDiagram;
-import org.jboss.tools.hibernate.veditor.editors.parts.OrmEditPartFactory;
-import org.jboss.tools.hibernate.view.views.ObjectEditorInput;
-
-
-/**
- * @author Konstantin Mishin
- *
- */
-public class VizualEditor extends GraphicalEditor {
-
- private OrmDiagram ormDiagram = null;
-
- public VizualEditor() {
- setEditDomain(new DefaultEditDomain(this));
- }
-
- public void doSave(IProgressMonitor monitor) {
- ormDiagram.save();
- ormDiagram.setDirty(false);
- }
-
- public void doSaveAs() {
- }
-
- protected void initializeGraphicalViewer() {
- final GraphicalViewer viewer = getGraphicalViewer();
- viewer.setEditPartFactory(new OrmEditPartFactory());
- viewer.setRootEditPart(new ScalableFreeformRootEditPart());
- viewer.addDropTargetListener(createTransferDropTargetListener());
- viewer.setContents(ormDiagram);
- }
-
- protected void createActions() {
- getEditorSite().getActionBars().setGlobalActionHandler(ActionFactory.REFRESH.getId(),new
WorkbenchPartAction(this){
-
- protected boolean calculateEnabled() {
- return true;
- }
- public void run() {
- ormDiagram.refresh();
- }
- });
- super.createActions();
- }
-
- private TransferDropTargetListener createTransferDropTargetListener() {
- return new TemplateTransferDropTargetListener(getGraphicalViewer()) {
- protected CreationFactory getFactory(Object template) {
- return new SimpleFactory((Class) template);
- }
- };
- }
-
- public boolean isSaveAsAllowed() {
- return false;
- }
-
- public boolean isSaveOnCloseNeeded() {
- return true;
- }
-
- public void refreshDirty() {
- firePropertyChange(IEditorPart.PROP_DIRTY);
- }
-
- public boolean isDirty() {
- return ormDiagram.isDirty();
- }
-
- protected void setInput(IEditorInput input) {
- super.setInput(input);
- ObjectEditorInput objectEditorInput = (ObjectEditorInput)input;
- Configuration configuration = objectEditorInput.getConfiguration();
- RootClass rootClass = (RootClass)(objectEditorInput).getObject();
- setPartName("Diagram for " + rootClass.getClassName());
- ormDiagram = new OrmDiagram(configuration, rootClass);
- }
-}
Deleted:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/messages.properties
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/messages.properties 2007-07-05
11:19:41 UTC (rev 2300)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/messages.properties 2007-07-05
11:19:58 UTC (rev 2301)
@@ -1 +0,0 @@
-EditorActionContributor_Refresh_Visual_Mapping=Refresh Visual Mapping