Author: vyemialyanchyk
Date: 2008-06-06 12:50:40 -0400 (Fri, 06 Jun 2008)
New Revision: 8612
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/UIVEditorMessages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/UIVEditorMessages.properties
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ColorConstants.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ColorConstants.properties
Removed:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/Messages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/Messages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/messages.properties
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/command/Messages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/command/messages.properties
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/messages.properties
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/Messages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/messages.properties
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/EditorActionContributor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/ExportImageAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenSourceAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/command/ShapeSetConstraintCommand.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/OrmEditPartFactory.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/OrmShapeEditPart.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ShapeEditPart.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/TreePartFactory.java
Log:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-500
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/UIVEditorMessages.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/UIVEditorMessages.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/UIVEditorMessages.java 2008-06-06
16:50:40 UTC (rev 8612)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * 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;
+
+import org.eclipse.osgi.util.NLS;
+
+public class UIVEditorMessages extends NLS {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.hibernate.ui.veditor.UIVEditorMessages"; //$NON-NLS-1$
+
+ private UIVEditorMessages() {
+ }
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, UIVEditorMessages.class);
+ }
+
+ public static String EditorActionContributor_refresh_visual_mapping;
+ public static String VisualEditor_diagram_for;
+ public static String ExportImageAction_bmp_format;
+ public static String ExportImageAction_error;
+ public static String ExportImageAction_failed_to_export_image;
+ public static String ExportImageAction_jpg_format;
+ public static String ExportImageAction_png_format;
+ public static String OpenMappingAction_canot_find_or_open_mapping_file;
+ public static String OpenMappingAction_open_mapping_file;
+ public static String OpenSourceAction_canot_find_source_file;
+ public static String OpenSourceAction_canot_open_source_file;
+ public static String OpenSourceAction_open_source_file;
+ public static String ShapeSetConstraintCommand_move;
+ public static String PartFactory_canot_create_part_for_model_element;
+ public static String PartFactory_null;
+}
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/UIVEditorMessages.properties
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/UIVEditorMessages.properties
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/UIVEditorMessages.properties 2008-06-06
16:50:40 UTC (rev 8612)
@@ -0,0 +1,15 @@
+EditorActionContributor_refresh_visual_mapping=Refresh Visual Mapping
+VisualEditor_diagram_for=Diagram for
+ExportImageAction_bmp_format=Bitmap format (*.bmp)
+ExportImageAction_error=Error
+ExportImageAction_failed_to_export_image=Failed to export image:
+ExportImageAction_jpg_format=JPEG format (*.jpg)
+ExportImageAction_png_format=PNG format (*.png)
+OpenMappingAction_canot_find_or_open_mapping_file=Can't find or open mapping file.
+OpenMappingAction_open_mapping_file=Open Mapping File
+OpenSourceAction_canot_find_source_file=Can't find source file.
+OpenSourceAction_canot_open_source_file=Can't open source file.
+OpenSourceAction_open_source_file=Open Source File
+ShapeSetConstraintCommand_move=move
+PartFactory_canot_create_part_for_model_element=Can't create part for model element:
+PartFactory_null=null
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/EditorActionContributor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/EditorActionContributor.java 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/EditorActionContributor.java 2008-06-06
16:50:40 UTC (rev 8612)
@@ -16,25 +16,26 @@
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.veditor.UIVEditorMessages;
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);
+ workbenchAction.setToolTipText(UIVEditorMessages.EditorActionContributor_refresh_visual_mapping);
addAction(workbenchAction);
addRetargetAction(new UndoRetargetAction());
addRetargetAction(new RedoRetargetAction());
}
-
+
public void contributeToToolBar(IToolBarManager toolBarManager) {
toolBarManager.add(getAction(ActionFactory.REFRESH.getId()));
toolBarManager.add(getAction(ActionFactory.UNDO.getId()));
toolBarManager.add(getAction(ActionFactory.REDO.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/ui/veditor/editors/Messages.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/Messages.java 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/Messages.java 2008-06-06
16:50:40 UTC (rev 8612)
@@ -1,27 +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"; //$NON-NLS-1$
-
- private Messages() {
- }
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- public static String EditorActionContributor_Refresh_Visual_Mapping;
- public static String VISUALEDITOR_DIAGRAM_FOR;
-}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java 2008-06-06
16:50:40 UTC (rev 8612)
@@ -34,6 +34,7 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.RootClass;
+import org.jboss.tools.hibernate.ui.veditor.UIVEditorMessages;
import org.jboss.tools.hibernate.ui.veditor.editors.actions.AutoLayoutAction;
import org.jboss.tools.hibernate.ui.veditor.editors.actions.ExportImageAction;
import org.jboss.tools.hibernate.ui.veditor.editors.actions.OpenMappingAction;
@@ -49,18 +50,18 @@
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() {
}
@@ -75,13 +76,13 @@
viewer.setContextMenu(provider);
getSite().registerContextMenu("FlowDiagramContextmenu", provider, viewer);
//$NON-NLS-1$
}
-
+
public GraphicalViewer getEditPartViewer() {
return getGraphicalViewer();
}
-
+
protected void createActions() {
-
+
getEditorSite().getActionBars().setGlobalActionHandler(ActionFactory.REFRESH.getId(),new
WorkbenchPartAction(this){
protected boolean calculateEnabled() {
@@ -91,9 +92,9 @@
ormDiagram.refresh();
}
});
-
+
super.createActions();
-
+
getEditorSite().getActionBars().setGlobalActionHandler(ActionFactory.PRINT.getId(),
getActionRegistry().getAction(ActionFactory.PRINT.getId()));
ActionRegistry registry = getActionRegistry();
@@ -110,9 +111,9 @@
action = new AutoLayoutAction(this);
registry.registerAction(action);
-
+
}
-
+
private TransferDropTargetListener createTransferDropTargetListener() {
return new TemplateTransferDropTargetListener(getGraphicalViewer()) {
protected CreationFactory getFactory(Object template) {
@@ -120,23 +121,23 @@
}
};
}
-
+
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;
@@ -144,7 +145,7 @@
Object obj = objectEditorInput.getObject();
if (obj instanceof RootClass) {
RootClass rootClass = (RootClass)obj;
- setPartName(Messages.VISUALEDITOR_DIAGRAM_FOR + rootClass.getEntityName());
+ setPartName(UIVEditorMessages.VisualEditor_diagram_for + rootClass.getEntityName());
ormDiagram = new OrmDiagram(configuration, rootClass,
objectEditorInput.getJavaProject());
}
else if (obj instanceof RootClass[]) {
@@ -153,11 +154,11 @@
for (int i = 1; i < rootClasses.length; i++) {
name += " & " + rootClasses[i].getEntityName(); //$NON-NLS-1$
}
- setPartName(Messages.VISUALEDITOR_DIAGRAM_FOR + name);
+ setPartName(UIVEditorMessages.VisualEditor_diagram_for + name);
ormDiagram = new OrmDiagram(configuration, rootClasses,
objectEditorInput.getJavaProject());
}
}
-
+
public Object getAdapter(Class type) {
if (type == IContentOutlinePage.class) {
DiagramContentOutlinePage outline = new DiagramContentOutlinePage(
@@ -171,7 +172,7 @@
return super.getAdapter(type);
}
-
+
public Set getSelectedElements_old() {
Set ret = new HashSet();
List selectedEditParts = getGraphicalViewer().getSelectedEditParts();
@@ -211,9 +212,9 @@
public OrmDiagram getViewerContents() {
return ormDiagram;
}
-
+
public DefaultEditDomain getDefaultEditDomain() {
return getEditDomain();
}
-
+
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/ExportImageAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/ExportImageAction.java 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/ExportImageAction.java 2008-06-06
16:50:40 UTC (rev 8612)
@@ -19,11 +19,12 @@
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.ImageLoader;
import org.eclipse.swt.widgets.FileDialog;
+import org.jboss.tools.hibernate.ui.veditor.UIVEditorMessages;
import org.jboss.tools.hibernate.ui.veditor.editors.VisualEditor;
public class ExportImageAction extends Action {
- public static final String ACTION_ID = Messages.EXPORTIMAGEACTION_EXPORT_AS_IMAGE;
+ public static final String ACTION_ID = "Export as Image"; //$NON-NLS-1$
private VisualEditor editor;
@@ -41,8 +42,8 @@
this.editor.getSite().getShell(), SWT.SAVE);
saveDialog
.setFilterExtensions(new String[] { "*.png", "*.jpg",
"*.bmp" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- saveDialog.setFilterNames(new String[] { Messages.EXPORTIMAGEACTION_PNG_FORMAT,
- Messages.EXPORTIMAGEACTION_JPG_FORMAT, Messages.EXPORTIMAGEACTION_BMP_FORMAT });
+ saveDialog.setFilterNames(new String[] {
UIVEditorMessages.ExportImageAction_png_format,
+ UIVEditorMessages.ExportImageAction_jpg_format,
UIVEditorMessages.ExportImageAction_bmp_format });
String filePath = saveDialog.open();
if (filePath == null || filePath.trim().length() == 0) {
@@ -67,7 +68,7 @@
outStream.close();
} catch (Throwable e) {
MessageDialog.openInformation(this.editor.getSite().getShell(),
- Messages.EXPORTIMAGEACTION_ERROR, Messages.EXPORTIMAGEACTION_FAILED_TO_EXPORT_IMAGE
+ e.getMessage());
+ UIVEditorMessages.ExportImageAction_error,
UIVEditorMessages.ExportImageAction_failed_to_export_image + e.getMessage());
return;
}
}
Deleted:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/Messages.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/Messages.java 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/Messages.java 2008-06-06
16:50:40 UTC (rev 8612)
@@ -1,25 +0,0 @@
-package org.jboss.tools.hibernate.ui.veditor.editors.actions;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME =
"org.jboss.tools.hibernate.ui.veditor.editors.actions.messages"; //$NON-NLS-1$
- public static String EXPORTIMAGEACTION_BMP_FORMAT;
- public static String EXPORTIMAGEACTION_ERROR;
- public static String EXPORTIMAGEACTION_EXPORT_AS_IMAGE;
- public static String EXPORTIMAGEACTION_FAILED_TO_EXPORT_IMAGE;
- public static String EXPORTIMAGEACTION_JPG_FORMAT;
- public static String EXPORTIMAGEACTION_PNG_FORMAT;
- public static String OPENMAPPINGACTION_CANOT_FIND_OR_OPEN_MAPPING_FILE;
- public static String OPENMAPPINGACTION_OPEN_MAPPING_FILE;
- public static String OPENSOURCEACTION_CANOT_FIND_SOURCE_FILE;
- public static String OPENSOURCEACTION_CANOT_OPEN_SOURCE_FILE;
- public static String OPENSOURCEACTION_OPEN_SOURCE_FILE;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java 2008-06-06
16:50:40 UTC (rev 8612)
@@ -18,6 +18,7 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.mapping.Property;
+import org.jboss.tools.hibernate.ui.veditor.UIVEditorMessages;
import org.jboss.tools.hibernate.ui.veditor.VisualEditorPlugin;
import org.jboss.tools.hibernate.ui.veditor.editors.VisualEditor;
import org.jboss.tools.hibernate.ui.veditor.editors.model.SpecialRootClass;
@@ -33,7 +34,7 @@
public OpenMappingAction(IWorkbenchPart part) {
super(part);
setId(ACTION_ID);
- setText(Messages.OPENMAPPINGACTION_OPEN_MAPPING_FILE);
+ setText(UIVEditorMessages.OpenMappingAction_open_mapping_file);
setImageDescriptor(VisualEditorPlugin.getImageDescriptor("icons/mapping.gif"));
//$NON-NLS-1$
}
@@ -56,7 +57,7 @@
try {
org.hibernate.eclipse.console.actions.OpenMappingAction.run(compositSel,
parentProperty, consoleConfiguration);
} catch (Exception e) {
- HibernateConsolePlugin.getDefault().logErrorMessage(Messages.OPENMAPPINGACTION_CANOT_FIND_OR_OPEN_MAPPING_FILE,
e);
+ HibernateConsolePlugin.getDefault().logErrorMessage(UIVEditorMessages.OpenMappingAction_canot_find_or_open_mapping_file,
e);
}
continue;
}
@@ -66,9 +67,9 @@
try {
org.hibernate.eclipse.console.actions.OpenMappingAction.run(selection,
consoleConfiguration);
} catch (Exception e) {
- HibernateConsolePlugin.getDefault().logErrorMessage(Messages.OPENMAPPINGACTION_OPEN_MAPPING_FILE,
e);
- }
-
+ HibernateConsolePlugin.getDefault().logErrorMessage(UIVEditorMessages.OpenMappingAction_open_mapping_file,
e);
+ }
+
/*IResource resource = null;
Object selectedElement = selection;
if (selectedElement instanceof RootClass) {
@@ -135,13 +136,13 @@
if (selectedElement instanceof PersistentClass
|| (selectedElement instanceof Property
&& ((Property)selectedElement).getPersistentClass() != null)){
- org.hibernate.eclipse.console.actions.OpenMappingAction.applySelectionToEditor(selectedElement,
editorPart);
+ org.hibernate.eclipse.console.actions.OpenMappingAction.applySelectionToEditor(selectedElement,
editorPart);
}
} catch (PartInitException e) {
VisualEditorPlugin.getDefault().logInfo("Can't open mapping file",
e);
}
}*/
- }
+ }
}
protected boolean calculateEnabled() {
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenSourceAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenSourceAction.java 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenSourceAction.java 2008-06-06
16:50:40 UTC (rev 8612)
@@ -14,6 +14,7 @@
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
+import org.jboss.tools.hibernate.ui.veditor.UIVEditorMessages;
import org.jboss.tools.hibernate.ui.veditor.VisualEditorPlugin;
import org.jboss.tools.hibernate.ui.veditor.editors.VisualEditor;
import org.jboss.tools.hibernate.ui.view.views.ObjectEditorInput;
@@ -28,7 +29,7 @@
public OpenSourceAction(IWorkbenchPart part) {
super(part);
setId(ACTION_ID);
- setText(Messages.OPENSOURCEACTION_OPEN_SOURCE_FILE);
+ setText(UIVEditorMessages.OpenSourceAction_open_source_file);
setImageDescriptor(VisualEditorPlugin.getImageDescriptor("icons/java.gif"));
//$NON-NLS-1$
}
@@ -46,11 +47,11 @@
Object selection = iterator.next();
PersistentClass rootClass = null;
if (selection instanceof PersistentClass) {
- rootClass = (PersistentClass) selection;
+ rootClass = (PersistentClass) selection;
} else if (selection instanceof Property) {
- rootClass = ((Property) selection).getPersistentClass();
+ rootClass = ((Property) selection).getPersistentClass();
} else continue;
-
+
IResource resource = null;
String fullyQualifiedName =
rootClass.getClassName();//HibernateUtils.getPersistentClassName(rootClass);
/*if (fullyQualifiedName.indexOf("$") > 0) {
@@ -59,11 +60,11 @@
try {
new org.hibernate.eclipse.console.actions.OpenSourceAction().run(selection, proj,
fullyQualifiedName);
} catch (PartInitException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage(Messages.OPENSOURCEACTION_CANOT_OPEN_SOURCE_FILE,
e);
+ HibernateConsolePlugin.getDefault().logErrorMessage(UIVEditorMessages.OpenSourceAction_canot_open_source_file,
e);
} catch (JavaModelException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage(Messages.OPENSOURCEACTION_CANOT_FIND_SOURCE_FILE,
e);
+ HibernateConsolePlugin.getDefault().logErrorMessage(UIVEditorMessages.OpenSourceAction_canot_find_source_file,
e);
} catch (FileNotFoundException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage(Messages.OPENSOURCEACTION_CANOT_FIND_SOURCE_FILE,
e);
+ HibernateConsolePlugin.getDefault().logErrorMessage(UIVEditorMessages.OpenSourceAction_canot_find_source_file,
e);
}
}
}
@@ -75,7 +76,7 @@
while (iterator.hasNext()) {
Object elem = iterator.next();
if (elem instanceof PersistentClass
- || elem instanceof Property) return true;
+ || elem instanceof Property) return true;
}
return false;
}
Deleted:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/messages.properties
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/messages.properties 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/messages.properties 2008-06-06
16:50:40 UTC (rev 8612)
@@ -1,11 +0,0 @@
-EXPORTIMAGEACTION_BMP_FORMAT=Bitmap format (*.bmp)
-EXPORTIMAGEACTION_ERROR=Error
-EXPORTIMAGEACTION_EXPORT_AS_IMAGE=Export as Image
-EXPORTIMAGEACTION_FAILED_TO_EXPORT_IMAGE=Failed to export image:
-EXPORTIMAGEACTION_JPG_FORMAT=JPEG format (*.jpg)
-EXPORTIMAGEACTION_PNG_FORMAT=PNG format (*.png)
-OPENMAPPINGACTION_CANOT_FIND_OR_OPEN_MAPPING_FILE=Can't find or open mapping file.
-OPENMAPPINGACTION_OPEN_MAPPING_FILE=Open Mapping File
-OPENSOURCEACTION_CANOT_FIND_SOURCE_FILE=Can't find source file.
-OPENSOURCEACTION_CANOT_OPEN_SOURCE_FILE=Can't open source file.
-OPENSOURCEACTION_OPEN_SOURCE_FILE=Open Source File
Deleted:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/command/Messages.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/command/Messages.java 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/command/Messages.java 2008-06-06
16:50:40 UTC (rev 8612)
@@ -1,15 +0,0 @@
-package org.jboss.tools.hibernate.ui.veditor.editors.command;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME =
"org.jboss.tools.hibernate.ui.veditor.editors.command.messages"; //$NON-NLS-1$
- public static String SHAPESETCONSTRAINTCOMMAND_MOVE;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/command/ShapeSetConstraintCommand.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/command/ShapeSetConstraintCommand.java 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/command/ShapeSetConstraintCommand.java 2008-06-06
16:50:40 UTC (rev 8612)
@@ -15,6 +15,7 @@
import org.eclipse.gef.RequestConstants;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.jboss.tools.hibernate.ui.veditor.UIVEditorMessages;
import org.jboss.tools.hibernate.ui.veditor.editors.model.OrmShape;
@@ -22,10 +23,10 @@
private final Point newLocation;
private Point oldLocation;
private final ChangeBoundsRequest request;
-
+
private final OrmShape shape;
-
- public ShapeSetConstraintCommand(OrmShape shape, ChangeBoundsRequest req,
+
+ public ShapeSetConstraintCommand(OrmShape shape, ChangeBoundsRequest req,
Point newLocation) {
if (shape == null || req == null || newLocation == null) {
throw new IllegalArgumentException();
@@ -33,24 +34,24 @@
this.shape = shape;
this.request = req;
this.newLocation = newLocation.getCopy();
- setLabel(Messages.SHAPESETCONSTRAINTCOMMAND_MOVE);
+ setLabel(UIVEditorMessages.ShapeSetConstraintCommand_move);
}
-
+
public boolean canExecute() {
Object type = request.getType();
return (RequestConstants.REQ_MOVE.equals(type)
- || RequestConstants.REQ_MOVE_CHILDREN.equals(type));
+ || RequestConstants.REQ_MOVE_CHILDREN.equals(type));
}
-
+
public void execute() {
oldLocation = shape.getLocation();
redo();
}
-
+
public void redo() {
shape.setLocation(newLocation);
}
-
+
public void undo() {
shape.setLocation(oldLocation);
}
Deleted:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/command/messages.properties
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/command/messages.properties 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/command/messages.properties 2008-06-06
16:50:40 UTC (rev 8612)
@@ -1 +0,0 @@
-SHAPESETCONSTRAINTCOMMAND_MOVE=move
Deleted:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/messages.properties
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/messages.properties 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/messages.properties 2008-06-06
16:50:40 UTC (rev 8612)
@@ -1,2 +0,0 @@
-EditorActionContributor_Refresh_Visual_Mapping=Refresh Visual Mapping
-VISUALEDITOR_DIAGRAM_FOR=Diagram for
Copied:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ColorConstants.java
(from rev 8541,
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/Messages.java)
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ColorConstants.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ColorConstants.java 2008-06-06
16:50:40 UTC (rev 8612)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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.parts;
+
+import org.eclipse.osgi.util.NLS;
+
+public class ColorConstants extends NLS {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.hibernate.ui.veditor.editors.parts.ColorConstants";
//$NON-NLS-1$
+
+ private ColorConstants() {
+ }
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, ColorConstants.class);
+ }
+
+ public static String Colors_PersistentClassR;
+ public static String Colors_PersistentClassG;
+ public static String Colors_PersistentClassB;
+ public static String Colors_PersistentFieldR;
+ public static String Colors_PersistentFieldG;
+ public static String Colors_PersistentFieldB;
+ public static String Colors_DatabaseTableR;
+ public static String Colors_DatabaseTableG;
+ public static String Colors_DatabaseTableB;
+ public static String Colors_DatabaseColumnR;
+ public static String Colors_DatabaseColumnG;
+ public static String Colors_DatabaseColumnB;
+
+}
Copied:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ColorConstants.properties
(from rev 8541,
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/messages.properties)
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ColorConstants.properties
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ColorConstants.properties 2008-06-06
16:50:40 UTC (rev 8612)
@@ -0,0 +1,12 @@
+Colors_PersistentClassR=255
+Colors_PersistentClassG=247
+Colors_PersistentClassB=206
+Colors_PersistentFieldR=255
+Colors_PersistentFieldG=255
+Colors_PersistentFieldB=239
+Colors_DatabaseTableR=222
+Colors_DatabaseTableG=231
+Colors_DatabaseTableB=239
+Colors_DatabaseColumnR=239
+Colors_DatabaseColumnG=247
+Colors_DatabaseColumnB=255
Deleted:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/Messages.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/Messages.java 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/Messages.java 2008-06-06
16:50:40 UTC (rev 8612)
@@ -1,58 +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.parts;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME =
"org.jboss.tools.hibernate.ui.veditor.editors.parts.messages"; //$NON-NLS-1$
-
- private Messages() {
- }
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- public static String Colors_PersistentClassR;
-
- public static String Colors_PersistentClassG;
-
- public static String Colors_PersistentClassB;
-
- public static String Colors_PersistentFieldR;
-
- public static String Colors_PersistentFieldG;
-
- public static String Colors_PersistentFieldB;
-
- public static String Colors_DatabaseTableR;
-
- public static String Colors_DatabaseTableG;
-
- public static String Colors_DatabaseTableB;
-
- public static String Colors_DatabaseColumnR;
-
- public static String Colors_DatabaseColumnG;
-
- public static String Colors_DatabaseColumnB;
-
- public static String ORMEDITPARTFACTORY_CANOT_CREATE_PART_FOR_MODEL_ELEMENT;
-
- public static String ORMEDITPARTFACTORY_NULL;
-
- public static String TREEPARTFACTORY_CANOT_CREATE_PART_FOR_MODEL_ELEMENT;
-
- public static String TREEPARTFACTORY_NULL;
-
-}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/OrmEditPartFactory.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/OrmEditPartFactory.java 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/OrmEditPartFactory.java 2008-06-06
16:50:40 UTC (rev 8612)
@@ -12,6 +12,7 @@
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
+import org.jboss.tools.hibernate.ui.veditor.UIVEditorMessages;
import org.jboss.tools.hibernate.ui.veditor.editors.model.ComponentShape;
import org.jboss.tools.hibernate.ui.veditor.editors.model.Connection;
import org.jboss.tools.hibernate.ui.veditor.editors.model.ExpandeableShape;
@@ -21,14 +22,14 @@
public class OrmEditPartFactory implements EditPartFactory {
-
-
+
+
public EditPart createEditPart(EditPart context, Object modelElement) {
EditPart part = getPartForElement(modelElement);
part.setModel(modelElement);
return part;
}
-
+
private EditPart getPartForElement(Object modelElement) {
if (modelElement instanceof OrmDiagram) {
return new DiagramEditPart();
@@ -49,8 +50,8 @@
return new ConnectionEditPart();
}
throw new RuntimeException(
- Messages.ORMEDITPARTFACTORY_CANOT_CREATE_PART_FOR_MODEL_ELEMENT
- + ((modelElement != null) ? modelElement.getClass().getName() :
Messages.ORMEDITPARTFACTORY_NULL));
+ UIVEditorMessages.PartFactory_canot_create_part_for_model_element
+ + ((modelElement != null) ? modelElement.getClass().getName() :
UIVEditorMessages.PartFactory_null));
}
-
+
}
\ No newline at end of file
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/OrmShapeEditPart.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/OrmShapeEditPart.java 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/OrmShapeEditPart.java 2008-06-06
16:50:40 UTC (rev 8612)
@@ -86,14 +86,14 @@
} else {
throw new IllegalArgumentException();
}
- }
-
+ }
+
public void performRequest(Request req) {
if(RequestConstants.REQ_OPEN.equals(req.getType()) && getModel() instanceof
OrmShape) {
((OrmShape)getModel()).refreshHiden();
}
}
-
+
public void propertyChange(PropertyChangeEvent evt) {
String prop = evt.getPropertyName();
if (OrmShape.LOCATION_PROP.equals(prop)) {
@@ -121,16 +121,16 @@
}
if (bounds != null) ((GraphicalEditPart) getParent()).setLayoutConstraint(this,
getFigure(), bounds);
}
-
+
protected Color getBackgroundColor() {
Object element = getCastedModel().getOrmElement();
- if (element instanceof PersistentClass || element instanceof Component)
+ if (element instanceof PersistentClass || element instanceof Component)
return ResourceManager.getInstance().getColor(new RGB(0,0,0));
else if (element instanceof Table || element instanceof Property)
return ResourceManager.getInstance().getColor(new RGB(
- Integer.parseInt(Messages.Colors_DatabaseColumnR),
- Integer.parseInt(Messages.Colors_DatabaseColumnG),
- Integer.parseInt(Messages.Colors_DatabaseColumnB)));
+ Integer.parseInt(ColorConstants.Colors_DatabaseColumnR),
+ Integer.parseInt(ColorConstants.Colors_DatabaseColumnG),
+ Integer.parseInt(ColorConstants.Colors_DatabaseColumnB)));
else
throw new IllegalArgumentException();
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ShapeEditPart.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ShapeEditPart.java 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ShapeEditPart.java 2008-06-06
16:50:40 UTC (rev 8612)
@@ -57,14 +57,14 @@
public class ShapeEditPart extends
OrmEditPart implements PropertyChangeListener, NodeEditPart {
- static protected OrmLabelProvider ormLabelProvider =
+ static protected OrmLabelProvider ormLabelProvider =
new OrmLabelProvider(new OrmModelImageVisitor(), new OrmModelNameVisitor());
-
+
protected void createEditPolicies() {
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new
ShapesSelectionEditPolicy());
}
-
+
protected IFigure createFigure() {
if (getModel() instanceof Shape) {
Label label = new Label();
@@ -76,7 +76,7 @@
if (model instanceof OrmDiagram) {
cfg = ((OrmDiagram) model).getConsoleConfiguration();
}
- label.setText(ormLabelProvider.getText(getElement(), cfg));
+ label.setText(ormLabelProvider.getText(getElement(), cfg));
label.setBackgroundColor(getColor());
label.setIcon(ormLabelProvider.getImage(getElement()));
label.setLabelAlignment(PositionConstants.LEFT);
@@ -93,11 +93,11 @@
public void propertyChange(PropertyChangeEvent evt) {
String prop = evt.getPropertyName();
if (Shape.SHOW_SELECTION.equals(prop)) {
- getFigure().setBackgroundColor(getSelectionColor());
- getFigure().setForegroundColor(ResourceManager.getInstance().getColor(new
RGB(255,255,255)));
+ getFigure().setBackgroundColor(getSelectionColor());
+ getFigure().setForegroundColor(ResourceManager.getInstance().getColor(new
RGB(255,255,255)));
} else if (Shape.HIDE_SELECTION.equals(prop)) {
- getFigure().setBackgroundColor(getColor());
- getFigure().setForegroundColor(ResourceManager.getInstance().getColor(new
RGB(0,0,0)));
+ getFigure().setBackgroundColor(getColor());
+ getFigure().setForegroundColor(ResourceManager.getInstance().getColor(new
RGB(0,0,0)));
} else if (Shape.SET_FOCUS.equals(prop)) {
getViewer().select(this);
getViewer().reveal(this);
@@ -123,14 +123,14 @@
((ModelElement) getModel()).addPropertyChangeListener(this);
}
}
-
+
public void deactivate() {
if (isActive()) {
super.deactivate();
((ModelElement) getModel()).removePropertyChangeListener(this);
}
}
-
+
protected Shape getCastedModel() {
return (Shape) getModel();
}
@@ -138,7 +138,7 @@
protected List getModelSourceConnections() {
return getCastedModel().getSourceConnections();
}
-
+
protected List getModelTargetConnections() {
return getCastedModel().getTargetConnections();
}
@@ -146,19 +146,19 @@
public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connection) {
return getConnectionAnchor();
}
-
+
public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connection) {
return getConnectionAnchor();
}
-
+
public ConnectionAnchor getSourceConnectionAnchor(Request request) {
return getConnectionAnchor();
}
-
+
public ConnectionAnchor getTargetConnectionAnchor(Request request) {
return getConnectionAnchor();
}
-
+
protected ConnectionAnchor getConnectionAnchor() {
ChopboxAnchor anchor = new ChopboxAnchor(getFigure()){
public Point getLocation(Point reference) {
@@ -170,16 +170,16 @@
}
OrmShapeEditPart part = getOrmShapeEditPart();
Point p = r.getCenter();
- if (reference.x < p.x)
+ if (reference.x < p.x)
p.x-=part.getFigure().getBounds().width/2;
- else
- p.x+=part.getFigure().getBounds().width/2;
+ else
+ p.x+=part.getFigure().getBounds().width/2;
return p;
}
};
return anchor;
}
-
+
protected OrmShapeEditPart getOrmShapeEditPart() {
int i = 0;
EditPart part = this;
@@ -193,81 +193,81 @@
protected Color getColor() {
Object element = getCastedModel().getOrmElement();
- if (element instanceof PersistentClass || element instanceof Component)
+ if (element instanceof PersistentClass || element instanceof Component)
return ResourceManager.getInstance().getColor(new RGB(
- Integer.parseInt(Messages.Colors_PersistentClassR),
- Integer.parseInt(Messages.Colors_PersistentClassG),
- Integer.parseInt(Messages.Colors_PersistentClassB)));
- else if (element instanceof Property || element instanceof SimpleValue)
+ Integer.parseInt(ColorConstants.Colors_PersistentClassR),
+ Integer.parseInt(ColorConstants.Colors_PersistentClassG),
+ Integer.parseInt(ColorConstants.Colors_PersistentClassB)));
+ else if (element instanceof Property || element instanceof SimpleValue)
return ResourceManager.getInstance().getColor(new RGB(
- Integer.parseInt(Messages.Colors_PersistentFieldR),
- Integer.parseInt(Messages.Colors_PersistentFieldG),
- Integer.parseInt(Messages.Colors_PersistentFieldB)));
- else if (element instanceof Column)
+ Integer.parseInt(ColorConstants.Colors_PersistentFieldR),
+ Integer.parseInt(ColorConstants.Colors_PersistentFieldG),
+ Integer.parseInt(ColorConstants.Colors_PersistentFieldB)));
+ else if (element instanceof Column)
return ResourceManager.getInstance().getColor(new RGB(
- Integer.parseInt(Messages.Colors_DatabaseColumnR),
- Integer.parseInt(Messages.Colors_DatabaseColumnG),
- Integer.parseInt(Messages.Colors_DatabaseColumnB)));
- else if (element instanceof Table)
+ Integer.parseInt(ColorConstants.Colors_DatabaseColumnR),
+ Integer.parseInt(ColorConstants.Colors_DatabaseColumnG),
+ Integer.parseInt(ColorConstants.Colors_DatabaseColumnB)));
+ else if (element instanceof Table)
return ResourceManager.getInstance().getColor(new RGB(
- Integer.parseInt(Messages.Colors_DatabaseTableR),
- Integer.parseInt(Messages.Colors_DatabaseTableG),
- Integer.parseInt(Messages.Colors_DatabaseTableB)));
- else if (element instanceof DependantValue)
+ Integer.parseInt(ColorConstants.Colors_DatabaseTableR),
+ Integer.parseInt(ColorConstants.Colors_DatabaseTableG),
+ Integer.parseInt(ColorConstants.Colors_DatabaseTableB)));
+ else if (element instanceof DependantValue)
return ResourceManager.getInstance().getColor(new RGB(
- Integer.parseInt(Messages.Colors_DatabaseTableR),
- Integer.parseInt(Messages.Colors_DatabaseTableG),
- Integer.parseInt(Messages.Colors_DatabaseTableB)));
- else if (element instanceof OneToMany)
+ Integer.parseInt(ColorConstants.Colors_DatabaseTableR),
+ Integer.parseInt(ColorConstants.Colors_DatabaseTableG),
+ Integer.parseInt(ColorConstants.Colors_DatabaseTableB)));
+ else if (element instanceof OneToMany)
return ResourceManager.getInstance().getColor(new RGB(
- Integer.parseInt(Messages.Colors_PersistentFieldR),
- Integer.parseInt(Messages.Colors_PersistentFieldG),
- Integer.parseInt(Messages.Colors_PersistentFieldB)));
+ Integer.parseInt(ColorConstants.Colors_PersistentFieldR),
+ Integer.parseInt(ColorConstants.Colors_PersistentFieldG),
+ Integer.parseInt(ColorConstants.Colors_PersistentFieldB)));
else
return ResourceManager.getInstance().getColor(new RGB(255, 0, 0));
}
protected Color getSelectionColor() {
- if (getCastedModel().getOrmElement() instanceof PersistentClass ||
- getCastedModel().getOrmElement() instanceof Property ||
+ if (getCastedModel().getOrmElement() instanceof PersistentClass ||
+ getCastedModel().getOrmElement() instanceof Property ||
getCastedModel().getOrmElement() instanceof SimpleValue ||
- getCastedModel().getOrmElement() instanceof OneToMany)
+ getCastedModel().getOrmElement() instanceof OneToMany)
return ResourceManager.getInstance().getColor(new RGB(112,161,99));
- else if (getCastedModel().getOrmElement() instanceof Table ||
getCastedModel().getOrmElement() instanceof Column)
+ else if (getCastedModel().getOrmElement() instanceof Table ||
getCastedModel().getOrmElement() instanceof Column)
return ResourceManager.getInstance().getColor(new RGB(66,173,247));
return ResourceManager.getInstance().getColor(new RGB(255,0,0));
}
-
+
private class ShapesSelectionEditPolicy extends SelectionEditPolicy {
protected void hideSelection() {
getCastedModel().hideSelection();
- Iterator iter = getCastedModel().getSourceConnections().iterator();
+ Iterator iter = getCastedModel().getSourceConnections().iterator();
while (iter.hasNext()) {
Connection element = (Connection) iter.next();
- element.hideSelection();
+ element.hideSelection();
}
- iter = getCastedModel().getTargetConnections().iterator();
+ iter = getCastedModel().getTargetConnections().iterator();
while (iter.hasNext()) {
Connection element = (Connection) iter.next();
- element.hideSelection();
+ element.hideSelection();
}
}
protected void showSelection() {
getCastedModel().showSelection();
- Iterator iter = getCastedModel().getSourceConnections().iterator();
+ Iterator iter = getCastedModel().getSourceConnections().iterator();
while (iter.hasNext()) {
Connection element = (Connection) iter.next();
- element.showSelection();
+ element.showSelection();
}
- iter = getCastedModel().getTargetConnections().iterator();
+ iter = getCastedModel().getTargetConnections().iterator();
while (iter.hasNext()) {
Connection element = (Connection) iter.next();
- element.showSelection();
+ element.showSelection();
}
}
-
+
}
protected Object getElement() {
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/TreePartFactory.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/TreePartFactory.java 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/TreePartFactory.java 2008-06-06
16:50:40 UTC (rev 8612)
@@ -2,6 +2,7 @@
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
+import org.jboss.tools.hibernate.ui.veditor.UIVEditorMessages;
import org.jboss.tools.hibernate.ui.veditor.editors.model.ExpandeableShape;
import org.jboss.tools.hibernate.ui.veditor.editors.model.OrmDiagram;
import org.jboss.tools.hibernate.ui.veditor.editors.model.Shape;
@@ -18,9 +19,9 @@
if (modelElement instanceof Shape) {
return new ShapeTreeEditPart(modelElement);
}
- throw new
RuntimeException(Messages.TREEPARTFACTORY_CANOT_CREATE_PART_FOR_MODEL_ELEMENT
+ throw new
RuntimeException(UIVEditorMessages.PartFactory_canot_create_part_for_model_element
+ ((modelElement != null) ? modelElement.getClass().getName()
- : Messages.TREEPARTFACTORY_NULL));
+ : UIVEditorMessages.PartFactory_null));
}
}
Deleted:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/messages.properties
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/messages.properties 2008-06-06
16:40:25 UTC (rev 8611)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/messages.properties 2008-06-06
16:50:40 UTC (rev 8612)
@@ -1,16 +0,0 @@
-Colors_PersistentClassR=255
-Colors_PersistentClassG=247
-Colors_PersistentClassB=206
-Colors_PersistentFieldR=255
-Colors_PersistentFieldG=255
-Colors_PersistentFieldB=239
-Colors_DatabaseTableR=222
-Colors_DatabaseTableG=231
-Colors_DatabaseTableB=239
-Colors_DatabaseColumnR=239
-Colors_DatabaseColumnG=247
-Colors_DatabaseColumnB=255
-ORMEDITPARTFACTORY_CANOT_CREATE_PART_FOR_MODEL_ELEMENT=Can't create part for model
element:
-ORMEDITPARTFACTORY_NULL=null
-TREEPARTFACTORY_CANOT_CREATE_PART_FOR_MODEL_ELEMENT=Can't create part for model
element:
-TREEPARTFACTORY_NULL=null