Author: mdryakhlenkov
Date: 2007-07-05 08:46:15 -0400 (Thu, 05 Jul 2007)
New Revision: 2323
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ActionOrmTree.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ContentProviderVisitor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmContentProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ViewsAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/views.properties
Log:
JBIDE-559: Hibernate diagram editor cleanup
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ActionOrmTree.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ActionOrmTree.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ActionOrmTree.java 2007-07-05
12:46:15 UTC (rev 2323)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * 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.view.views;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.TreeViewer;
+
+// tau 22.11.2005
+// edit tau 27.01.2006
+
+public abstract class ActionOrmTree extends Action {
+
+ private TreeViewer viewer;
+
+ public ActionOrmTree() {
+ super();
+ }
+
+ public void run(TreeViewer viewer) {
+ this.viewer = viewer;
+ run();
+ }
+
+ public void run() {
+ try {
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW ) ExceptionHandler.logInfo("!TRY
ActionOrmTree.run() lock(=" + OrmCore.lock + ").acquire(), Depth=" +
OrmCore.lock.getDepth());
+// ((OrmContentProvider)viewer.getContentProvider()).lockMenu = true; // add tau
06.12.2005
+// OrmCore.lock.acquire(); // add tau 05.12.2005
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW ) ExceptionHandler.logInfo("!RUN
ActionOrmTree.run() lock(=" + OrmCore.lock + ").acquire(), Depth=" +
OrmCore.lock.getDepth());
+//
+// OrmCore.getDefault().setLockResourceChangeListener(true);
+
+ this.rush();
+
+ } finally {
+// OrmCore.lock.release();
+// ((OrmContentProvider)viewer.getContentProvider()).lockMenu = false; // add tau
06.12.2005
+//
+// // add tau 27.01.2006
+// OrmCore.getDefault().setLockResourceChangeListener(false);
+
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW )
ExceptionHandler.logInfo("!Finally ActionOrmTree.run() lock(=" + OrmCore.lock +
").acquire(), Depth=" + OrmCore.lock.getDepth());
+ }
+
+ }
+
+ protected abstract void rush();
+
+ public TreeViewer getViewer() {
+ return viewer;
+ }
+
+ public ActionOrmTree setViewer(TreeViewer viewer) {
+ this.viewer = viewer;
+ return this;
+ }
+
+}
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ContentProviderVisitor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ContentProviderVisitor.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ContentProviderVisitor.java 2007-07-05
12:46:15 UTC (rev 2323)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * 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.view.views;
+
+import java.util.ResourceBundle;
+
+import org.hibernate.mapping.Column;
+
+
+public class ContentProviderVisitor {
+
+ private static final Object[] nullChildren = new Object[0];
+
+ private ResourceBundle BUNDLE =
ResourceBundle.getBundle(ContentProviderVisitor.class.getPackage().getName() +
".views");
+
+ public Object visitDatabaseColumn(Column column, Object argument) {
+ return null;
+ }
+
+}
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java 2007-07-05
12:46:15 UTC (rev 2323)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * 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.view.views;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.hibernate.cfg.Configuration;
+
+
+public class ObjectEditorInput implements IEditorInput{
+
+ protected Object fObject;
+ protected Configuration configuration;
+
+ public ObjectEditorInput(Object object) {
+ fObject = object;
+ }
+
+ public ObjectEditorInput(Configuration configuration, Object object) {
+ fObject = object;
+ this.configuration = configuration;
+ }
+
+ public Object getObject() {
+ return fObject;
+ }
+
+
+ public boolean exists() {
+ return false;
+ }
+
+
+ public ImageDescriptor getImageDescriptor() {
+ return ImageDescriptor.getMissingImageDescriptor();
+ }
+
+
+ public String getName() {
+ return "";
+ }
+
+
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+
+ public String getToolTipText() {
+ return "";
+ }
+
+
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ public Configuration getConfiguration() {
+ return configuration;
+ }
+
+}
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java 2007-07-05
12:46:15 UTC (rev 2323)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * 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.view.views;
+
+import java.util.HashMap;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.internal.ObjectPluginAction;
+import org.hibernate.cfg.Configuration;
+import org.jboss.tools.hibernate.ui.view.ViewPlugin;
+
+public class OpenDiagramActionDelegate implements IObjectActionDelegate {
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ }
+
+ public void run(IAction action) {
+ HashMap hashMap = new HashMap();
+ ObjectPluginAction objectPluginAction = (ObjectPluginAction)action;
+ Object rootClass =
((TreeSelection)objectPluginAction.getSelection()).getFirstElement();
+ ObjectEditorInput input = (ObjectEditorInput)hashMap.get(rootClass);
+ Configuration configuration =
(Configuration)(((TreeSelection)objectPluginAction.getSelection()).getPaths()[0]).getSegment(1);
+ if(input == null) {
+ input = new ObjectEditorInput(configuration, rootClass);
+ hashMap.put(rootClass, input);
+ }
+ try {
+ IDE.openEditor(ViewPlugin.getPage(),input
,"org.jboss.tools.hibernate.ui.veditor.editors.visualeditor");
+ } catch (PartInitException e) {
+// ExceptionHandler.logThrowableError(e,"OpenEditor");
+ }
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+}
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmContentProvider.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmContentProvider.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmContentProvider.java 2007-07-05
12:46:15 UTC (rev 2323)
@@ -0,0 +1,460 @@
+/*******************************************************************************
+ * 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.view.views;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.TreeItem;
+
+
+public class OrmContentProvider implements ITreeContentProvider/*, IOrmModelListener,
IOrmProjectChangedListener*/ {
+
+ protected static final int PACKAGE_CLASS_FIELD_CONTENT_PROVIDER = 1;
+ protected static final int CLASS_FIELD_CONTENT_PROVIDER = 2;
+ protected static final int STORAGE_CLASS_FIELD_CONTENT_PROVIDER = 3;
+
+ protected static final int SCHEMA_TABLE_COLUMN_CONTENT_PROVIDER = 4;
+ protected static final int TABLE_COLUMN_CONTENT_PROVIDER = 5;
+
+ protected TreeViewer viewer;
+
+ private static final ContentProviderVisitor contentProviderVisitor = new
ContentProviderVisitor();
+ private static final Object[] nullChildren = new Object[0];
+ private static Object[] children = new Object[0];
+ private int tip;
+ private boolean sorting;
+
+ private Object[] expandedElements = null;
+ private ISelection selectionElements = null;
+
+ private String[] beforeChangeElements = null;
+ private String beforeChangeSelectionElementQualifiedName = null;
+
+ public boolean lockMenu = false;
+
+
+ public OrmContentProvider(int tip){
+ this.tip = tip;
+ sorting = true; // default - sort
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ if (children == null)
+ children = nullChildren;
+
+ if (!sorting){
+ sorting = true; // default - sort
+ } else {
+// Arrays.sort(children, comparator);
+ }
+ return children;
+ }
+
+ public Object getParent(Object element) {
+
+ //if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW ) ExceptionHandler.logInfo("!!!
OrmContentProvider.getParent(Object element):" + element + ", tip="+tip);
+
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ //TODO EXP 3d
+ //return getChildren(element).length > 0;
+// if (element instanceof IDatabaseColumn ||
+// element instanceof IDatabaseConstraint ||
+// element instanceof INamedQueryMapping ||
+// element instanceof String) {
+// return false;
+// } else
+ return true;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ public void dispose() {
+
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW
) ExceptionHandler.logInfo("OrmContentProvider.inputChanged():"+",
tip="+tip+", this= " + this);
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW
) ExceptionHandler.logInfo("OrmContentProvider.inputChanged(): OLD_INPUT= " +
oldInput + ", tip="+tip);
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW
) ExceptionHandler.logInfo("OrmContentProvider.inputChanged(): NEW_INPUT= " +
newInput + ", tip="+tip);
+//
+// this.viewer = (TreeViewer) viewer;
+//
+// if (oldInput != null) {
+// removeListenerFrom((IOrmModel) oldInput);
+// }
+//
+// if (newInput != null) {
+// addListenerTo((IOrmModel) newInput);
+// }
+ }
+
+// protected void removeListenerFrom(IOrmModel model) {
+// model.removeListener(this);
+// IOrmProject[] projects = model.getOrmProjects();
+// for (int i = 0; i < projects.length; i++) {
+// IOrmProject project = projects[i];
+// project.removeChangedListener(this);
+// // add tau 12.09.2005
+// //project.removeBeforeChangeListener(this);
+// }
+// }
+
+// protected void addListenerTo(IOrmModel model) {
+// model.addListener(this);
+// IOrmProject[] projects = model.getOrmProjects();
+// for (int i = 0; i < projects.length; i++) {
+// IOrmProject project = projects[i];
+// project.addChangedListener(this);
+// // add tau 12.09.2005
+// //project.addBeforeChangeListener(this);
+// }
+// }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.jboss.tools.hibernate.core.IOrmModelListener#projectsChanged(org.jboss.tools.hibernate.core.OrmModelEvent)
+ */
+// public void modelChanged(OrmModelEvent event) {
+//
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW )
+// ExceptionHandler.logInfo("OrmContentProvider.modelChanged(OrmModelEvent)"
+ ",tip="+tip);
+//
+// // Add tau 21.06.2005
+// int type = event.getType();
+// if (type == OrmModelEvent.AddProject){
+// ((IOrmProject) event.getProject()).addChangedListener(this);
+// // add tau 28.11.2005
+// //((IOrmProject) event.getProject()).addBeforeChangeListener(this);
+// }
+//
+//
+// // Update tau 18.05.2005
+// final IOrmModel model = event.getOrmModel();
+// viewerRefreshUpdate(model, false);
+//
+// /*
+// Control control = viewer.getControl();
+// if (control == null || control.isDisposed())
+// return;
+//
+// control.getDisplay().syncExec(new Runnable() {
+// public void run() {
+// if (!viewer.getControl().isDisposed()){
+// viewer.getTree().setRedraw(false);
+// viewer.refresh(model, true);
+// viewer.getTree().setRedraw(true);
+// // add 04.04.2005
+// //viewer.getControl().setFocus();
+// }
+// }
+// });
+// */
+//
+// }
+
+ /*
+ * edit 05.12.2005
+ *
+ * @see
org.jboss.tools.hibernate.core.IOrmProjectListener#modelChanged(org.jboss.tools.hibernate.core.OrmProjectEvent)
+ */
+// public void projectChanged(OrmProjectEvent event, boolean flagUpdate) {
+//
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW )
ExceptionHandler.logInfo("OrmContentProvider.projectChanged((eventSource=," +
event.getSource()+ "), tip="+tip);
+//
+// final IOrmProject project = event.getProject();
+//
+// viewerRefreshUpdate(project, flagUpdate);
+//
+// /* del tau 05.2005
+// //!!! event from OrmBuilder == IOrmProject - edit tau 05.12.2005
+// if (event.getSource() instanceof IOrmProject || !(isBuilder(project.getProject()))){
+// viewerRefresh(project);
+// }
+// */
+// }
+
+ /*
+ public void projectBeforeChange(OrmProjectEvent event) {
+
+ Control control = viewer.getControl();
+ if (control == null || control.isDisposed()) {
+ if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW ) ExceptionHandler.logInfo("->NO
REFRESH, control="+ control + ",tip="+tip);
+ return;
+ }
+
+ // add tau 17.11.2005
+ if (beforeChangeElements != null){
+ if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW )
ExceptionHandler.logInfo("->projectBeforeChange("+event.getSource()+")beforeChangeElements
!= null"+",tip="+tip);
+ return;
+ }
+
+ // TODO (!tau->tau) asyncExec???
+ //control.getDisplay().asyncExec(new Runnable() {
+ control.getDisplay().syncExec(new Runnable() {
+ public void run() {
+ // edit tau 24.11.2005 +OrmCore.lock.acquire();
+ try {
+ if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW ) ExceptionHandler.logInfo("->
TRY projectBeforeChange(...) lock(=" + OrmCore.lock + ").acquire(), Depth="
+ OrmCore.lock.getDepth() + ", tip="+tip);
+ OrmCore.lock.acquire();
+ lockMenu = true; // add tau 05.12.2005
+ if (!viewer.getControl().isDisposed()) {
+ beforeChangeElements = saveElements();
+ beforeChangeSelectionElementQualifiedName = saveSelection();
+ }
+ } finally {
+ OrmCore.lock.release();
+ lockMenu = false; // add tau 05.12.2005
+ if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW )
ExceptionHandler.logInfo("-> END projectBeforeChange(...)=lock(=" +
OrmCore.lock.toString() + ").release(), Depth=" + OrmCore.lock.getDepth() +
", tip="+tip);
+ }
+ }
+ });
+ }
+ */
+
+
+ public int getTip() {
+ return tip;
+ }
+
+ public void setSorting(boolean sorting) {
+ this.sorting = sorting;
+ }
+
+ /*
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
+ }
+ */
+
+ public Object[] getExpandedElements() {
+ return expandedElements;
+ }
+
+ public void setExpandedElements(Object[] expandedElements) {
+ this.expandedElements = expandedElements;
+ }
+
+ public ISelection getSelectionElements() {
+ return selectionElements;
+ }
+
+ public void setSelectionElements(ISelection selectionElements) {
+ this.selectionElements = selectionElements;
+ }
+
+ public void viewerRefreshUpdate(final Object element, final boolean flagUpdate) {
+
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW )
ExceptionHandler.logInfo("OrmContentProvider.viewerRefresh(...)1= " + element +
" ,flagUpdate = "+ flagUpdate);
+
+ Control control = viewer.getControl();
+
+ if (control == null || control.isDisposed()) {
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW ) ExceptionHandler.logInfo("->
NO REFRESH, control="+ control + ",tip="+tip);
+ return;
+ }
+
+ Display display = control.getDisplay();
+
+ /*
+ Thread tc = display.getSyncThread();
+ boolean dd = display.isDisposed();
+ boolean dd2 = display.isDisposed();
+ Thread tt = display.getThread();
+
+ // add tau 24.01.2006
+ display.wake();
+
+ if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW )
ExceptionHandler.logInfo("OrmContentProvider.viewerRefresh(...)4= " + tc + tt +
dd + dd2);
+ */
+
+ // edit tau 30.01.2006
+ //display.syncExec(new Runnable() {
+ display.asyncExec(new Runnable() {
+
+ public void run() {
+ // add try and OrmCore.lock.acquire(); - tau 01.12.2005
+ try {
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW )
ExceptionHandler.logInfo("-> TRY REFRESH lock(=" + OrmCore.lock +
").acquire(), Depth=" + OrmCore.lock.getDepth() + ",
viewerRefresh("+element+"),tip="+tip);
+// OrmCore.lock.acquire();
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW )
ExceptionHandler.logInfo("-> RUN REFRESH, viewerRefresh("+element+"),
isDisposed()="+ viewer.getControl().isDisposed() + ",tip="+tip);
+
+ if (!viewer.getControl().isDisposed()) {
+
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW )
ExceptionHandler.logInfo("-> REFRESHing,
viewerRefresh("+element+"),tip="+tip);
+
+ viewer.getTree().setRedraw(false);
+
+ // add tau 02.12.2005 SAVE
+ if (beforeChangeElements == null){
+ beforeChangeElements = saveElements();
+ beforeChangeSelectionElementQualifiedName = saveSelection();
+ }
+
+ if (flagUpdate) {
+ // Update
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW )
ExceptionHandler.logInfo("viewerRefresh("+element+") ->
viewer.update(element, null), tip = "+tip);
+ viewer.update(element, null);
+ } else {
+ // REFRESH
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW )
ExceptionHandler.logInfo("viewerRefresh("+element+") ->
viewer.refresh(element, true), tip = "+tip);
+ viewer.refresh(element, true);
+ }
+
+ // LOAD
+ if (beforeChangeElements != null){
+ restoreElements(beforeChangeElements,
beforeChangeSelectionElementQualifiedName);
+ beforeChangeElements = null;
+ }
+
+ viewer.getTree().setRedraw(true);
+ }
+ } finally {
+// OrmCore.lock.release();
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW )
ExceptionHandler.logInfo("-> END REFRESH=lock(=" + OrmCore.lock.toString() +
").release(), Depth=" + OrmCore.lock.getDepth() + ",
viewerRefresh("+element+"),tip="+tip);
+ }
+ }
+ });
+ }
+
+
+ // tau 08.11.2005
+ private String[] saveElements() {
+ // add tau 15.11.2005
+ String [] expandedElements = null;
+ int length = viewer.getExpandedElements().length;
+ if (length != 0) {
+ expandedElements = new String [length];
+ }
+ //
+
+ int j = 0;
+ TreeItem[] items = viewer.getTree().getItems();
+ for (int i = 0; i < items.length; i++) {
+ TreeItem item = items[i];
+ j = saveItem(item, expandedElements, j);
+ }
+// if (ViewPlugin.TRACE ||
ViewPlugin.TRACE_VIEW) ExceptionHandler.logInfo(".saveElements()= " + length +
",tip="+tip);
+ return expandedElements;
+ }
+
+ // tau 08.11.2005
+ private int saveItem(TreeItem treeItem, String [] expandedElements, int j) {
+// if (treeItem.getExpanded()) {
+// if (treeItem.getData() instanceof IOrmElement ){
+// expandedElements[j++] =
((IOrmElement)treeItem.getData()).getQualifiedName(treeItem);
+// TreeItem[] items = treeItem.getItems();
+// for (int i = 0; i < items.length; i++) {
+// j = saveItem(items[i], expandedElements, j);
+// }
+// } else {
+// return j;
+// }
+//
+// }
+ return j;
+ }
+
+ private String saveSelection() {
+ String selectionElementQualifiedName = ""; // default
+ ISelection selection = viewer.getSelection();
+ if (!selection.isEmpty()) {
+ TreeItem[] selectionTreeItems = viewer.getTree().getSelection();
+ if (selectionTreeItems.length != 0) {
+ TreeItem selectionItem = selectionTreeItems[0];
+ if (selection instanceof StructuredSelection) {
+ // edit tau 05.04.2006 for /ESORM-562
+ //IOrmElement selectionElement = (IOrmElement) ((StructuredSelection)
selection).getFirstElement();
+ Object selectionElement = ((StructuredSelection) selection).getFirstElement();
+// if (selectionElement instanceof IOrmElement) {
+// IOrmElement selectionOrmElement = (IOrmElement) selectionElement;
+// selectionElementQualifiedName =
selectionOrmElement.getQualifiedName(selectionItem);
+// }
+ }
+ }
+ }
+// if (ViewPlugin.TRACE ||
ViewPlugin.TRACE_VIEW) ExceptionHandler.logInfo(".saveSelection()= " +
selectionElementQualifiedName + ",tip="+tip);
+ return selectionElementQualifiedName;
+ }
+
+ private void restoreElements(String[] expandedElements, String
selectionElementQualifiedName) {
+ //viewer.getTree().setRedraw(false);
+ checkItem(viewer.getTree().getItems(), expandedElements,
selectionElementQualifiedName);
+ //viewer.getTree().setRedraw(true);
+ //if (ViewPlugin.TRACE ||
ViewPlugin.TRACE_VIEW) ExceptionHandler.logInfo(".restoreElements()=" +
expandedElements.length + ", tip="+tip);
+ }
+
+ // #changed# by Konstantin Mishin on 03.09.2005 fixed for ORMIISTUD-699
+ private void checkItem(TreeItem[] items, String[] expandedElements, String
selectionElementQualifiedName) {
+ for (int j = 0; j < items.length; j++) {
+ TreeItem item = items[j];
+
+ // add tau 07.03.2006
+// if (!(item.getData() instanceof IOrmElement)){
+// continue;
+// }
+
+// IOrmElement itemElement = (IOrmElement) item.getData();
+// String itemElementQualifiedName = itemElement.getQualifiedName(item);
+// if (itemElementQualifiedName.equals("")) continue;
+//
+// if (selectionElementQualifiedName != null &&
selectionElementQualifiedName.equals(itemElementQualifiedName)) {
+// viewer.setSelection(new StructuredSelection(itemElement), true);
+// // add tau 28.11.2005
+// viewer.reveal(itemElement);
+// }
+//
+// for (int i = 0; i < expandedElements.length; i++) {
+// if (itemElementQualifiedName.equals(expandedElements[i])) {
+// viewer.setExpandedState(itemElement, true);
+// TreeItem[] childrenItems = item.getItems();
+// checkItem(childrenItems, expandedElements, selectionElementQualifiedName);
+// }
+// }
+ }
+ }
+
+ private boolean isBuilder(IProject project){
+ boolean flag = false;
+ if (project.getWorkspace().isAutoBuilding()) {
+ IProjectDescription description;
+// try {
+// description = project.getProject().getDescription();
+// ICommand[] builderCommands = description.getBuildSpec();
+// flag = false;
+// for (int i = 0; i < builderCommands.length; i++){
+// if
(builderCommands[i].getBuilderName().equals(OrmHibernateNature.ORM_HIBERNATE_BUILDER_ID))
{
+// flag = true;
+// if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW )
ExceptionHandler.logInfo("OrmContentProvider.isBuilder(...), tip="+tip +
",flagRefresh->"+flag);
+// break;
+// }
+// }
+// } catch (CoreException e) {
+// ExceptionHandler.logThrowableError(e, "projectChanged");
+// }
+ }
+ return flag;
+ }
+
+}
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java 2007-07-05
12:46:15 UTC (rev 2323)
@@ -0,0 +1,176 @@
+/*******************************************************************************
+ * 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.view.views;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.IFontProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.hibernate.mapping.Column;
+import org.hibernate.mapping.Component;
+import org.hibernate.mapping.DependantValue;
+import org.hibernate.mapping.ManyToOne;
+import org.hibernate.mapping.OneToMany;
+import org.hibernate.mapping.Property;
+import org.hibernate.mapping.RootClass;
+import org.hibernate.mapping.SimpleValue;
+import org.hibernate.mapping.SingleTableSubclass;
+import org.hibernate.mapping.Table;
+
+public class OrmLabelProvider extends LabelProvider implements IColorProvider,
IFontProvider {
+
+ private Map imageCache = new HashMap(25);
+ private OrmModelImageVisitor ormModelImageVisitor;
+ private OrmModelNameVisitor ormModelNameVisitor;
+
+ public OrmLabelProvider(OrmModelImageVisitor imageVisitor, OrmModelNameVisitor
nameVisitor) {
+ super();
+ ormModelImageVisitor = imageVisitor;
+ ormModelNameVisitor = nameVisitor;
+ }
+
+ public Image getImage(Object element) {
+ ImageDescriptor descriptor = null;
+
+ if (element instanceof RootClass) {
+ descriptor = (ImageDescriptor) ((RootClass) element).accept(ormModelImageVisitor);
+ } else if (element instanceof Property) {
+ descriptor = (ImageDescriptor)ormModelImageVisitor.visitPersistentField((Property)
element, null);
+ } else if (element instanceof Table) {
+ descriptor = (ImageDescriptor)ormModelImageVisitor.visitDatabaseTable((Table)
element);
+ } else if (element instanceof Column) {
+ descriptor = (ImageDescriptor)ormModelImageVisitor.visitDatabaseColumn((Column)
element);
+ } else if (element instanceof DependantValue) {
+ descriptor =
(ImageDescriptor)ormModelImageVisitor.visitComponentKeyMapping((DependantValue) element,
null);
+ } else if (element instanceof Component) {
+ descriptor = (ImageDescriptor)ormModelImageVisitor.visitComponentMapping((Component)
element);
+ } else {
+ //throw unknownElement(element);
+ return null;
+ }
+
+ Image image = (Image) imageCache.get(descriptor);
+ if (image == null) {
+ image = descriptor.createImage();
+ imageCache.put(descriptor, image);
+ }
+ return image;
+ }
+
+ public String getText(Object element) {
+ if (element instanceof RootClass) {
+ String name = (String)ormModelNameVisitor.visitPersistentClass((RootClass)element,
null);
+ if (name == null) {
+ return "OrmElement";
+ } else {
+ return name;
+ }
+ } else if (element instanceof SingleTableSubclass) {
+ String name =
(String)ormModelNameVisitor.visitPersistentClass((SingleTableSubclass)element, null);
+ if (name == null) {
+ return "OrmElement";
+ } else {
+ return name;
+ }
+ } else if (element instanceof Property) {
+ String name = (String)ormModelNameVisitor.visitPersistentField((Property)element,
null);
+ if (name == null) {
+ return "OrmElement";
+ } else {
+ return name;
+ }
+ } else if (element instanceof Column) {
+ String name = (String)ormModelNameVisitor.visitDatabaseColumn((Column)element, null);
+ if (name == null) {
+ return "OrmElement";
+ } else {
+ return name;
+ }
+ } else if (element instanceof OneToMany || element instanceof ManyToOne) {
+ String name = "element";
+ if (name == null) {
+ return "OrmElement";
+ } else {
+ return name;
+ }
+ } else if (element instanceof SimpleValue) {
+ if (element instanceof DependantValue) {
+ String name =
(String)ormModelNameVisitor.visitCollectionKeyMapping((DependantValue)element, null);
+ if (name == null) {
+ return "OrmElement";
+ } else {
+ return name;
+ }
+ } else if (element instanceof Component) {
+ String name = (String)ormModelNameVisitor.visitComponentMapping((Component)element,
null);
+ if (name == null) {
+ return "OrmElement";
+ } else {
+ return name;
+ }
+ } else {
+ return "element";
+// throw unknownElement(element);
+ }
+ } else if (element instanceof String){
+ return (String) element;
+ } else {
+ throw unknownElement(element);
+ }
+
+ }
+
+ protected RuntimeException unknownElement(Object element) {
+ if (element != null && element.getClass() != null )
+ return new RuntimeException("Unknown type of element in tree of type: " +
element.getClass().getName());
+ else return new RuntimeException("Unknown type of element in tree of type: "
+ element);
+
+ }
+
+ public void dispose() {
+ for (Iterator i = imageCache.values().iterator(); i.hasNext();) {
+ ((Image) i.next()).dispose();
+ }
+ imageCache.clear();
+ }
+
+ public Color getForeground(Object element) {
+ if (element instanceof RootClass) {
+ return Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN);
+ } else if (element instanceof Property) {
+ return Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE);
+ }
+
+ return null;
+ }
+
+ public Color getBackground(Object element) {
+ return null;
+ }
+
+ public Font getFont(Object element) {
+/* if (element instanceof IOrmProject) {
+ return
JFaceResources.getFontRegistry().getBold(JFaceResources.getTextFont().getFontData()[0].getName());
+ }*/
+ return null;
+ }
+
+}
\ No newline at end of file
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java 2007-07-05
12:46:15 UTC (rev 2323)
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * 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.view.views;
+
+import java.util.ResourceBundle;
+
+import org.hibernate.mapping.Column;
+import org.hibernate.mapping.Component;
+import org.hibernate.mapping.DependantValue;
+import org.hibernate.mapping.JoinedSubclass;
+import org.hibernate.mapping.PersistentClassVisitor;
+import org.hibernate.mapping.Property;
+import org.hibernate.mapping.RootClass;
+import org.hibernate.mapping.SingleTableSubclass;
+import org.hibernate.mapping.Subclass;
+import org.hibernate.mapping.Table;
+import org.hibernate.mapping.UnionSubclass;
+import org.jboss.tools.hibernate.ui.view.ViewPlugin;
+
+
+
+/**
+ * @author Tau
+ *
+ */
+public class OrmModelImageVisitor implements /*IOrmModelVisitor,
IHibernateMappingVisitor,*/ PersistentClassVisitor {
+
+ private ResourceBundle BUNDLE = ViewPlugin.BUNDLE_IMAGE;
+
+ private static Integer ID = new Integer(1);
+ private static Integer VER = new Integer(2);
+
+
+ public Object visitDatabaseTable(Table table) {
+ return
ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.DatabaseTable"));
//$NON-NLS-1$
+ }
+
+ public Object visitDatabaseColumn(Column column) {
+ if(column.isUnique()) {
+ return
ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.DatabaseUniqueKeyColumn"));
+ } else return
ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.DatabaseColumn"));
//$NON-NLS-1$
+
+ }
+
+ public Object visitPersistentField(Property field, Object argument) {
+ if (field !=null){
+ if (field.getType().isCollectionType()) {
+ return
ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldCollection"));
//$NON-NLS-1$
+ }
+ }
+ return
ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldNot_mapped"));
//$NON-NLS-1$
+ }
+
+ public Object visitComponentMapping(Component mapping) {
+ if (mapping != null){
+ return
ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldComponent"));
//$NON-NLS-1$
+ }
+ return
ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldNot_mapped"));
//$NON-NLS-1$
+ }
+
+ public Object visitComponentKeyMapping(DependantValue mapping, Object argument) {
+ if (argument == ID){
+ return
ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldComponent_id"));
//$NON-NLS-1$
+ }
+ return
ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldNot_mapped"));
//$NON-NLS-1$
+ }
+
+ public Object visitDatabaseColumn(Column column, Object argument) {
+ return null;
+ }
+
+ public Object accept(RootClass arg0) {
+ return
ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentClass"));
//$NON-NLS-1$
+ }
+
+ public Object accept(UnionSubclass arg0) {
+ return null;
+ }
+
+ public Object accept(SingleTableSubclass arg0) {
+ return null;
+ }
+
+ public Object accept(JoinedSubclass arg0) {
+ return null;
+ }
+
+ public Object accept(Subclass arg0) {
+ return null;
+ }
+
+}
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java 2007-07-05
12:46:15 UTC (rev 2323)
@@ -0,0 +1,707 @@
+/*******************************************************************************
+ * 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.view.views;
+
+import java.sql.Types;
+import java.util.ResourceBundle;
+import org.eclipse.jdt.core.Signature;
+import org.eclipse.jface.viewers.ContentViewer;
+import org.hibernate.mapping.Column;
+import org.hibernate.mapping.Component;
+import org.hibernate.mapping.DependantValue;
+import org.hibernate.mapping.Property;
+import org.hibernate.mapping.RootClass;
+import org.hibernate.mapping.SingleTableSubclass;
+import org.hibernate.mapping.Table;
+
+/**
+ * @author Tau from Minsk
+ *
+ */
+public class OrmModelNameVisitor /*implements IOrmModelVisitor*/ {
+
+ private ContentViewer viewer;
+
+ static private String SPACE = " ";
+
+ static private String POINTER = " -> ";
+
+ // add 16.03.2005 tau
+ private ResourceBundle BUNDLE = ResourceBundle
+ .getBundle(OrmModelNameVisitor.class.getPackage().getName()
+ + ".views");
+
+ public OrmModelNameVisitor(ContentViewer viewer) {
+ super();
+ this.viewer = viewer;
+ }
+
+ /**
+ * @see
org.jboss.tools.hibernate.core.IOrmModelVisitor#visitOrmModel(org.jboss.tools.hibernate.core.IOrmProject,
java.lang.Object)
+ */
+// public Object visitOrmProject(IOrmProject schema, Object argument) {
+// return schema.getName();
+// }
+
+ /**
+ * @see
org.jboss.tools.hibernate.core.IOrmModelVisitor#visitDatabaseSchema(org.jboss.tools.hibernate.core.IDatabaseSchema,
java.lang.Object)
+ */
+// public Object visitDatabaseSchema(IDatabaseSchema schema, Object argument) {
+// if (schema.getName() == null || schema.getName().trim().length() == 0) {
+// return BUNDLE
+// .getString("OrmModelNameVisitor.DefaultDatabaseSchema");
+// } else {
+// return schema.getName();
+// }
+// }
+
+ /**
+ * @see
org.jboss.tools.hibernate.core.IOrmModelVisitor#visitDatabaseTable(org.jboss.tools.hibernate.core.IDatabaseTable,
java.lang.Object)
+ */
+// public Object visitDatabaseTable(IDatabaseTable table, Object argument) {
+// // Table name (Class1, Class2 ...)
+// // add tau 13.04.2005
+// // edit tau 28.04.2005 -> vs ()
+// StringBuffer name = new StringBuffer();
+// name.append(table.getName());
+//
+// IPersistentClassMapping[] classMappings = table
+// .getPersistentClassMappings();
+// if (classMappings.length != 0) {
+// name.append(POINTER);
+// for (int i = 0; i < classMappings.length; i++) {
+// IPersistentClass persistentClass = classMappings[i]
+// .getPersistentClass();
+// if (persistentClass != null) {
+// name.append(persistentClass.getName());
+// name.append(BUNDLE.getString("OrmModelNameVisitor.Comma"));
+// name.append(" ");
+// }
+// }
+// name.delete(name.length() - 2, name.length());
+// }
+// return name.toString();
+//
+// }
+
+ /**
+ * @see
org.jboss.tools.hibernate.core.IOrmModelVisitor#visitDatabaseColumn(org.jboss.tools.hibernate.core.IDatabaseColumn,
java.lang.Object)
+ */
+// public Object visitDatabaseColumn(IDatabaseColumn column, Object argument) {
+// // update tau 16.03.2005
+// StringBuffer name = new StringBuffer();
+// name.append(column.getName());
+// //by Nick 22.04.2005
+//
+// int length = -1;
+// int scale = -1;
+//
+// if (!column.isNativeType()) {
+// int typeCode = column.getSqlTypeCode();
+// String typeName = column.getSqlTypeName();
+//
+// if (typeName == null)
+// typeCode = Types.NULL;
+//
+// //by Nick
+//
+// // (tau->tau) Column types should be shown in the following manner:
+// /*
+//
+// Character types:
+// VARCHAR(length)
+// CHAR(length)
+//
+// Numeric types:
+// NUMBER(length, precision)
+// NUMERIC(length, precision)
+//
+// Other types:
+// BIT
+// INTEGER
+// BIGNINT
+// DATE
+// FLOAT
+// REAL
+// CLOB
+// BINARY
+// etc. */
+// //by Nick 22.04.2005
+// // TODO (tau->tau)
+// // testing for ORACLE
+// // edit tau 28.04.2005 -> vs ()
+// switch (typeCode) {
+// case Types.VARCHAR:
+// case Types.CHAR:
+// case Types.NUMERIC:
+// case Types.DECIMAL: //8.07.2005 by Nick DECIMAL JDBC type denotes Oracle NUMBER type
+// //changed by Nick 10.05.2005 - fixes "->" in SQL types
+// if (typeCode == Types.NUMERIC || typeCode == Types.DECIMAL) {
+// length = column.getPrecision();
+// scale = column.getScale();
+// } else {
+// length = column.getLength();
+// }
+//
+// default:
+// break;
+//
+// }
+// } else {
+// if (column.getLength() > Column.DEFAULT_LENGTH) {
+// length = column.getLength();
+// } else if (column.getPrecision() > Column.DEFAULT_PRECISION
+// || column.getScale() > Column.DEFAULT_SCALE) {
+// length = column.getPrecision() > Column.DEFAULT_PRECISION ? (column
+// .getPrecision())
+// : (column.getScale() > 0 ? column.getScale() : 1);
+// scale = column.getScale();
+// }
+// }
+//
+// StringBuffer typeName = new StringBuffer(column.getSqlTypeName());
+//
+// //by Nick
+//
+// // (tau->tau) Column types should be shown in the following manner:
+// /*
+//
+// Character types:
+// VARCHAR(length)
+// CHAR(length)
+//
+// Numeric types:
+// NUMBER(length, precision)
+// NUMERIC(length, precision)
+//
+// Other types:
+// BIT
+// INTEGER
+// BIGNINT
+// DATE
+// FLOAT
+// REAL
+// CLOB
+// BINARY
+// etc. */
+// //by Nick 22.04.2005
+// /*
+// switch (key) {
+// case value:
+//
+// break;
+//
+// default:
+// break;
+// }
+// */
+//
+// // TODO (tau->tau)
+// // testing for ORACLE
+//
+// StringBuffer lpBuffer = new StringBuffer();
+// //name.append(POINTER);
+//
+// if (length > Column.DEFAULT_LENGTH) {
+// lpBuffer.append(SPACE);
+// lpBuffer.append(BUNDLE
+// .getString("OrmModelNameVisitor.OpenBrackets"));
+// lpBuffer.append(length);
+// if (scale > Column.DEFAULT_SCALE) {
+// lpBuffer.append(BUNDLE.getString("OrmModelNameVisitor.Comma"));
+// lpBuffer.append(SPACE);
+// lpBuffer.append(scale);
+// }
+// lpBuffer.append(BUNDLE
+// .getString("OrmModelNameVisitor.CloseBrackets"));
+// }
+// //by Nick
+//
+// if (typeName.length() != 0) {
+// // edit tau 28.04.2005 -> vs ()
+// //8.07.2005 by Nick DECIMAL JDBC type denotes Oracle NUMBER type
+// //changed by Nick 10.05.2005 - fixes "->" in SQL types
+// name.append(BUNDLE.getString("OrmModelNameVisitor.Colon"));
+// name.append(SPACE);
+// typeName.append(lpBuffer);
+// }
+//
+// name.append(typeName);
+// // name.append(SPACE);
+//
+// // by Nick
+// return name.toString();
+//
+// }
+
+ public Object visitDatabaseColumn(Column column, Object argument) {
+ // update tau 16.03.2005
+ StringBuffer name = new StringBuffer();
+ name.append(column.getName());
+ //by Nick 22.04.2005
+
+ int length = -1;
+ int scale = -1;
+
+// if (!column.isNativeType())
+// {
+// int typeCode = column.getSqlTypeCode();
+// String typeName = column.getSqlTypeName();
+//
+// if (typeName == null) typeCode = Types.NULL;
+//
+// //by Nick
+//
+// // (tau->tau) Column types should be shown in the following manner:
+// /*
+//
+// Character types:
+// VARCHAR(length)
+// CHAR(length)
+//
+// Numeric types:
+// NUMBER(length, precision)
+// NUMERIC(length, precision)
+//
+// Other types:
+// BIT
+// INTEGER
+// BIGNINT
+// DATE
+// FLOAT
+// REAL
+// CLOB
+// BINARY
+// etc. */
+// //by Nick 22.04.2005
+// /*
+// switch (key) {
+// case value:
+//
+// break;
+//
+// default:
+// break;
+// }
+// */
+//
+// // TODO (tau->tau)
+// // testing for ORACLE
+//
+// // edit tau 28.04.2005 -> vs ()
+//
+// switch (typeCode) {
+// case Types.VARCHAR:
+// case Types.CHAR:
+// case Types.NUMERIC:
+// case Types.DECIMAL: //8.07.2005 by Nick DECIMAL JDBC type denotes Oracle
NUMBER type
+// //changed by Nick 10.05.2005 - fixes "->" in SQL types
+// if (typeCode == Types.NUMERIC || typeCode == Types.DECIMAL) {
+// length = column.getPrecision();
+// scale = column.getScale();
+// }
+// else
+// {
+// length = column.getLength();
+// }
+//
+// default:
+// break;
+//
+// }
+// }
+// else
+// {
+// if (column.getLength() > Column.DEFAULT_LENGTH)
+// {
+// length = column.getLength();
+// }
+// else if (column.getPrecision() > Column.DEFAULT_PRECISION ||
column.getScale() > Column.DEFAULT_SCALE)
+// {
+// length = column.getPrecision() > Column.DEFAULT_PRECISION ?
(column.getPrecision()) : (column.getScale() > 0 ? column.getScale() : 1);
+// scale = column.getScale();
+// }
+// }
+
+// StringBuffer typeName = new StringBuffer(column.getSqlTypeName());
+//
+// //by Nick
+//
+// // (tau->tau) Column types should be shown in the following manner:
+// /*
+//
+// Character types:
+// VARCHAR(length)
+// CHAR(length)
+//
+// Numeric types:
+// NUMBER(length, precision)
+// NUMERIC(length, precision)
+//
+// Other types:
+// BIT
+// INTEGER
+// BIGNINT
+// DATE
+// FLOAT
+// REAL
+// CLOB
+// BINARY
+// etc. */
+// //by Nick 22.04.2005
+// /*
+// switch (key) {
+// case value:
+//
+// break;
+//
+// default:
+// break;
+// }
+// */
+//
+// // TODO (tau->tau)
+// // testing for ORACLE
+//
+//
+// StringBuffer lpBuffer = new StringBuffer();
+// //name.append(POINTER);
+//
+// if (length > Column.DEFAULT_LENGTH)
+// {
+// lpBuffer.append(SPACE);
+//
lpBuffer.append(BUNDLE.getString("OrmModelNameVisitor.OpenBrackets"));
+// lpBuffer.append(length);
+// if (scale > Column.DEFAULT_SCALE)
+// {
+//
lpBuffer.append(BUNDLE.getString("OrmModelNameVisitor.Comma"));
+// lpBuffer.append(SPACE);
+// lpBuffer.append(scale);
+// }
+//
lpBuffer.append(BUNDLE.getString("OrmModelNameVisitor.CloseBrackets"));
+// }
+// //by Nick
+//
+// if (typeName.length() != 0)
+// {
+// // edit tau 28.04.2005 -> vs ()
+// //8.07.2005 by Nick DECIMAL JDBC type denotes Oracle NUMBER type
+// //changed by Nick 10.05.2005 - fixes "->" in SQL types
+// name.append(BUNDLE.getString("OrmModelNameVisitor.Colon"));
+// name.append(SPACE);
+// typeName.append(lpBuffer);
+// }
+//
+// name.append(typeName);
+//// name.append(SPACE);
+//
+// // by Nick
+ return name.toString();
+
+ }
+
+ /* (non-Javadoc)
+ * @see
org.jboss.tools.hibernate.core.IOrmModelVisitor#visitDatabaseConstraint(org.jboss.tools.hibernate.core.IDatabaseConstraint,
java.lang.Object)
+ */
+// public Object visitDatabaseConstraint(IDatabaseConstraint constraint,
+// Object argument) {
+// return constraint.getName();
+// }
+
+ /* (non-Javadoc)
+ * @see
org.jboss.tools.hibernate.core.IOrmModelVisitor#visitPackage(org.jboss.tools.hibernate.core.IPackage,
java.lang.Object)
+ */
+// public Object visitPackage(IPackage pakage, Object argument) {
+// if (pakage.getName() == null || pakage.getName().trim().length() == 0) {
+// return BUNDLE.getString("OrmModelNameVisitor.DefaultPackageName");
+// } else {
+// //return pakage.getName();
+// return pakage.getProjectQualifiedName();
+// }
+// }
+
+ /* (non-Javadoc)
+ * @see
org.jboss.tools.hibernate.core.IOrmModelVisitor#visitMapping(org.jboss.tools.hibernate.core.IMapping,
java.lang.Object)
+ */
+// public Object visitMapping(IMapping mapping, Object argument) {
+// return mapping.getName();
+// }
+
+ /**
+ * @see
org.jboss.tools.hibernate.core.IOrmModelVisitor#visitMappingStorage(org.jboss.tools.hibernate.core.IMappingStorage,
java.lang.Object)
+ */
+// public Object visitMappingStorage(IMappingStorage storage, Object argument) {
+// return storage.getName();
+// }
+
+ /**
+ * @see
org.jboss.tools.hibernate.core.IOrmModelVisitor#visitPersistentClass(org.jboss.tools.hibernate.core.IPersistentClass,
java.lang.Object)
+ */
+// public Object visitPersistentClass(IPersistentClass clazz, Object argument) {
+//
+// StringBuffer name = new StringBuffer();
+// if (((OrmContentProvider) viewer.getContentProvider()).getTip() ==
OrmContentProvider.PACKAGE_CLASS_FIELD_CONTENT_PROVIDER) {
+// name.append(clazz.getShortName());
+// } else {
+// name.append(clazz.getName());
+// }
+//
+// //edit tau 24.04.2006
+// IDatabaseTable table = clazz.getDatabaseTable(); // upd tau 06.06.2005
+// //IDatabaseTable table = HibernateAutoMappingHelper.getPrivateTable(classMapping); //
upd tau 18.04.2005
+// if (table != null) {
+// String tableName = table.getName();
+// if (tableName != null) {
+// //name.append(" (");
+// name.append(POINTER);
+// name.append(tableName);
+// //name.append(")");
+// }
+// }
+//
+// return name.toString();
+// }
+
+ public Object visitPersistentClass(RootClass clazz, Object argument) {
+
+ StringBuffer name = new StringBuffer();
+// if (((OrmContentProvider) viewer.getContentProvider()).getTip() ==
OrmContentProvider.PACKAGE_CLASS_FIELD_CONTENT_PROVIDER) {
+ name.append(clazz.getClassName());
+// } else {
+// name.append(clazz.getClassName());
+// }
+
+ //edit tau 24.04.2006
+ Table table = clazz.getTable(); // upd tau 06.06.2005
+ //IDatabaseTable table = HibernateAutoMappingHelper.getPrivateTable(classMapping); //
upd tau 18.04.2005
+ if (table != null) {
+ String tableName = table.getName();
+ if (tableName != null) {
+ //name.append(" (");
+ name.append(POINTER);
+ name.append(tableName);
+ //name.append(")");
+ }
+ }
+
+ return name.toString();
+ }
+
+ public Object visitPersistentClass(SingleTableSubclass clazz, Object argument) {
+
+ StringBuffer name = new StringBuffer();
+// if (((OrmContentProvider) viewer.getContentProvider()).getTip() ==
OrmContentProvider.PACKAGE_CLASS_FIELD_CONTENT_PROVIDER) {
+ name.append(clazz.getEntityName());
+// } else {
+// name.append(clazz.getClassName());
+// }
+
+ //edit tau 24.04.2006
+ Table table = clazz.getTable(); // upd tau 06.06.2005
+ //IDatabaseTable table = HibernateAutoMappingHelper.getPrivateTable(classMapping); //
upd tau 18.04.2005
+ if (table != null) {
+ String tableName = table.getName();
+ if (tableName != null) {
+ //name.append(" (");
+ name.append(POINTER);
+ name.append(tableName);
+ //name.append(")");
+ }
+ }
+
+ return name.toString();
+ }
+
+ /**
+ * @see
org.jboss.tools.hibernate.core.IOrmModelVisitor#visitPersistentField(org.jboss.tools.hibernate.core.IPersistentField,
java.lang.Object)
+ */
+// public Object visitPersistentField(IPersistentField field, Object argument) {
+// StringBuffer name = new StringBuffer();
+// name.append(field.getName());
+// name.append(BUNDLE.getString("OrmModelNameVisitor.Colon"));
+// String typeString = field.getType();
+//
+// if (typeString != null) {
+// //added by Nick 31.03.2005
+// IPersistentValueMapping value = null;
+// if (field.getMapping() != null)
+// value = field.getMapping().getPersistentValueMapping();
+//
+// //added by Nick 18.04.2005 - to handle BLOB mappings
+// if (Signature.getArrayCount(typeString) != 0) {
+// // changed by Nick 20.10.2005
+// int depth = Signature.getArrayCount(typeString);
+// typeString = Signature.getElementType(typeString);
+// for (int i = 0; i < depth; i++) {
+// typeString += "[]";
+// }
+// // by Nick
+// }
+//
+// //by Nick
+// if (value != null && value instanceof CollectionMapping
+// && !(value instanceof ArrayMapping)) {
+// String elementsClsName = ((CollectionMapping) value)
+// .getCollectionElementClassName();
+// if (elementsClsName != null)
+// typeString = field.getType() + "(" + elementsClsName + ")";
+// }
+//
+// if (value != null && value instanceof CollectionMapping) {
+// //added by Nick 12.05.2005 to show collection table in explorer
+// IDatabaseTable collectionTable = ((CollectionMapping) value)
+// .getCollectionTable();
+// if (collectionTable != null
+// && collectionTable.getShortName() != null)
+// typeString += POINTER + collectionTable.getShortName();
+// //by Nick
+// }
+// //by Nick
+// name.append(typeString);
+//
+// // added by Nick 29.07.2005
+// if (field.getGenerifiedTypes() != null) {
+// String[] types = field.getGenerifiedTypes();
+//
+// StringBuffer buf = new StringBuffer("<");
+//
+// for (int i = 0; i < types.length; i++) {
+// String string = types[i];
+// buf.append(string);
+//
+// if (i != types.length - 1)
+// buf.append(", ");
+// }
+//
+// buf.append(">");
+//
+// name.append(buf);
+// }
+// // by Nick
+// }
+// return name.toString();
+//
+// }
+
+ public Object visitPersistentField(Property field, Object argument) {
+ StringBuffer name = new StringBuffer();
+ name.append(field.getName());
+ name.append(BUNDLE.getString("OrmModelNameVisitor.Colon"));
+ String typeString = field.getType().getReturnedClass().getName();
+
+ if (typeString != null) {
+/* IPersistentValueMapping value = null;
+ if (field.getMapping() != null)
+ value = field.getMapping().getPersistentValueMapping();
+
+ if (Signature.getArrayCount(typeString) != 0)
+ {
+ int depth = Signature.getArrayCount(typeString);
+ typeString = Signature.getElementType(typeString);
+ for (int i = 0; i < depth; i++) {
+ typeString += "[]";
+ }
+ }
+
+ if (value != null && value instanceof CollectionMapping &&
!(value instanceof ArrayMapping))
+ {
+ String elementsClsName =
((CollectionMapping)value).getCollectionElementClassName();
+ if (elementsClsName != null)
+ typeString = field.getType() + "(" + elementsClsName +
")";
+ }
+
+ if (value != null && value instanceof CollectionMapping)
+ {
+ IDatabaseTable collectionTable =
((CollectionMapping)value).getCollectionTable();
+ if (collectionTable != null && collectionTable.getShortName() !=
null)
+ typeString += POINTER + collectionTable.getShortName();
+ }*/
+ name.append(typeString);
+
+/* if (field.getGenerifiedTypes() != null)
+ {
+ String[] types = field.getGenerifiedTypes();
+
+ StringBuffer buf = new StringBuffer("<");
+
+ for (int i = 0; i < types.length; i++) {
+ String string = types[i];
+ buf.append(string);
+
+ if (i != types.length - 1)
+ buf.append(", ");
+ }
+
+ buf.append(">");
+
+ name.append(buf);
+ }*/
+ }
+ return name.toString();
+
+ }
+
+ /**
+ * @see
org.jboss.tools.hibernate.core.IOrmModelVisitor#visitPersistentClassMapping(org.jboss.tools.hibernate.core.IPersistentClassMapping,
java.lang.Object)
+ */
+// public Object visitPersistentClassMapping(IPersistentClassMapping mapping,
+// Object argument) {
+// // add tau 22.04.2005
+// // Class mapping should be shown as Class name -> table name
+//
+// StringBuffer name = new StringBuffer();
+// name.append(mapping.getName());
+//
+// IDatabaseTable table = HibernateAutoMappingHelper
+// .getPrivateTable(mapping); // upd tau 22.04.2005
+// if (table != null) {
+// String tableName = table.getName();
+// if (tableName != null) {
+// name.append(POINTER);
+// name.append(tableName);
+// }
+// }
+//
+// return name.toString();
+//
+// }
+
+ /**
+ * @see
org.jboss.tools.hibernate.core.IOrmModelVisitor#visitPersistentFieldMapping(org.jboss.tools.hibernate.core.IPersistentFieldMapping,
java.lang.Object)
+ */
+// public Object visitPersistentFieldMapping(IPersistentFieldMapping mapping,
+// Object argument) {
+// return mapping.getName();
+// }
+
+ /**
+ * @see
org.jboss.tools.hibernate.core.IOrmModelVisitor#visitPersistentValueMapping(org.jboss.tools.hibernate.core.IPersistentValueMapping,
java.lang.Object)
+ */
+// public Object visitPersistentValueMapping(IPersistentValueMapping mapping,
+// Object argument) {
+// return mapping.getName();
+// }
+
+ // add tau 27.07.2005
+// public Object visitNamedQueryMapping(INamedQueryMapping mapping,
+// Object argument) {
+// return mapping.getName();
+// }
+
+
+ public Object visitCollectionKeyMapping(DependantValue mapping, Object argument) {
+ return "key";
+ }
+
+ public Object visitComponentMapping(Component mapping, Object argument) {
+ return "element";
+ }
+}
\ No newline at end of file
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ViewsAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ViewsAction.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ViewsAction.java 2007-07-05
12:46:15 UTC (rev 2323)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * 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.view.views;
+
+import java.util.HashMap;
+import java.util.ResourceBundle;
+
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.ide.IDE;
+import org.jboss.tools.hibernate.ui.view.ViewPlugin;
+
+
+public class ViewsAction {
+ static ActionOrmTree openEditorAction;
+
+ static private ResourceBundle BUNDLE_IMAGE = ViewPlugin.BUNDLE_IMAGE;
+ static private ResourceBundle BUNDLE =
ResourceBundle.getBundle(ViewsAction.class.getPackage().getName() + ".views");
+
+ static {
+ openEditorAction = new ActionOrmTree() {
+ HashMap<Object,ObjectEditorInput> hashMap = new
HashMap<Object,ObjectEditorInput>();
+ public void rush() {
+ ObjectEditorInput input =
hashMap.get(this.getViewer().getTree().getSelection()[0].getData());
+ if(input == null) {
+ input = new
ObjectEditorInput(this.getViewer().getTree().getSelection()[0].getData());
+ hashMap.put(this.getViewer().getTree().getSelection()[0].getData(), input);
+ }
+ try {
+ IDE.openEditor(ViewPlugin.getPage(),input
,"org.jboss.tools.hibernate.ui.veditor.editors.visualeditor");
+ } catch (PartInitException e) {
+// ExceptionHandler.logThrowableError(e,"OpenEditor");
+ }
+ }
+ };
+ openEditorAction.setText(BUNDLE.getString("Explorer.OpenEditorActionName"));
+ openEditorAction.setToolTipText(BUNDLE.getString("Explorer.OpenEditorActionToolTipText"));
+ }
+}
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/views.properties
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/views.properties
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/views.properties 2007-07-05
12:46:15 UTC (rev 2323)
@@ -0,0 +1,245 @@
+//Explorer
+Explorer.ActionRootPackageClassFieldName=project -> mapping -> package ->
class(table) -> field -> column(s)
+Explorer.ActionRootPackageClassFieldContentDescription=project -> mapping ->
package -> class(table) -> field
+Explorer.ActionRootPackageClassFieldToolTipText=Group by package
+
+Explorer.ActionRootClassFieldName=project -> mapping -> class(table) -> field
-> column(s)
+Explorer.ActionRootClassFieldContentDescription=project -> mapping -> class(table)
-> field -> column(s)
+Explorer.ActionRootClassFieldToolTipText=Group by mapping
+
+Explorer.ActionRootStorageClassFieldName=project -> mapping -> mapping storage
-> class(table) -> field -> column(s)
+Explorer.ActionRootStorageClassFieldContentDescription=project -> mapping ->
mapping storage -> class(table) -> field -> column(s)
+Explorer.ActionRootStorageClassFieldToolTipText=Group by storage
+
+Explorer.HibernateConnectionWizardName=Edit Hibernate Configuration...
+Explorer.HibernateConnectionWizardToolTipText=Hibernate configuration wizard
+
+Explorer.PersistentClassesWizardName=Add Persistent Classes...
+Explorer.PersistentClassesWizardToolTipText=Add persistent classes wizard
+
+Explorer.GenerateDAOWizardName=Generate DAO Classes...
+Explorer.GenerateDAOWizardToolTipText=Generate DAO wizard
+
+Explorer.FieldMappingWizardName=Edit Mapping...
+Explorer.FieldMappingWizardToolTipText=Field mapping wizard
+//Kuzmin 06.10.2005
+Explorer.FieldMappingWizardNameNew=New Mapping...
+
+Explorer.TablesClassesWizardName=Reverse Engineer Database Schema...
+Explorer.TablesClassesWizardToolTipText=Add tables classes wizard
+Explorer.TablesClassesWizardInfoCreate=Created classes
+Explorer.TablesClassesWizardInfonoPK=Tables have no PK
+Explorer.TablesClassesWizardInfoLink=Many-to-many link tables
+Explorer.TablesClassesWizardInfoTitle=Red Hat Developer Studio Reversing Operation
Report
+
+Explorer.AddNamedQueryName=Add Named Query...
+Explorer.AddNamedQueryToolTipText=Create new named query
+Explorer.AddNamedQuery.DefaultNewName=New query
+
+Explorer.TestQueryName=Query Test...
+Explorer.TestQueryToolTipText=Query test
+Explorer.TestQuery.DefaultQuery=from {0}
+
+Explorer.EditNamedQueryName=Edit Named Query...
+Explorer.EditNamedQueryToolTipText=Edit selected named query
+
+Explorer.RemoveNamedQueryName=Remove Named Query
+Explorer.RemoveNamedQueryToolTipText=Remove selected named query
+Explorer.RemoveNamedQueryTitle=Confirm Remove Named Query
+Explorer.RemoveNamedQueryMessage=Do you want to remove the Named Query "{0}"?
+
+Explorer.DuplicateQueryNameErrorTitle=Duplicate Query Name Error
+
+Explorer.MappingWizardName=Edit Mapping...
+Explorer.MappingWizardToolTipText=Edit mapping
+
+Explorer.GenerateDDLWizardName=Generate DDL Wizard...
+Explorer.GenerateDDLWizardToolTipText=Generate DDL file
+Explorer.GenerateDDLErrorTitle=Generate DDL Error
+
+Explorer.AutoBuildingFalseTitle=Warning
+Explorer.AutoBuildingFalseMessage=Build Automaticaly is switch off.\nContinue?
+
+Explorer.HibernateCacheWizardName=Hibernate Cache Wizard...
+Explorer.HibernateCacheWizardToolTipText=Hibernate cache wizard
+
+Explorer.AutoMappingSettingName=Auto Mapping Settings...
+Explorer.AutoMappingSettingToolTipText=Auto mapping settings
+
+Explorer.RunTimeSettingName=Edit hibernate.properties...
+Explorer.RunTimeSettingToolTipText=Hibernate properties
+
+#new 11.05.2005
+Explorer.ClearPackageMappingName=Clear Mapping...
+Explorer.ClearPackageMappingToolTipText=Clear mapping
+Explorer.ClearPackageMappingTitle=Confirm Clear Mapping
+Explorer.ClearPackageMappingQuestion=Are you sure you want to remove the mapping\nfor the
"{0}"?
+
+
+Explorer.ClearClassMappingName=Clear Mapping...
+Explorer.ClearClassMappingToolTipText=Clear mapping
+Explorer.ClearClassMappingTitle=Confirm Clear Mapping
+Explorer.ClearClassMappingQuestion=Are you sure you want to remove the mapping\nfor the
"{0}"?
+
+
+Explorer.RemoveClassActionName=Remove Persistent Class...
+Explorer.RemoveClassActionToolTipText=Remove a persistent class
+Explorer.RemoveClassAction.QuestionDialog.Title=Remove Persistent Class
+Explorer.RemoveClassAction.QuestionDialog.Message=Do you want to remove "{0}"
?
+Explorer.RemoveClassAction.QuestionDialog.Radio1=Delete mapping file (if empty)
+Explorer.RemoveClassAction.QuestionDialog.Radio2=Delete source code
+
+Explorer.RemoveClassesActionName=Remove Persistent Classes...
+Explorer.RemoveClassesActionToolTipText=Remove persistent classes
+Explorer.RemoveClassesAction.QuestionDialog.Title=Remove Persistent Classes
+Explorer.RemoveClassesAction.QuestionDialog.Message=Do you want to remove all classes in
"{0}"?
+Explorer.RemoveClassesAction.QuestionDialog.Radio1=Delete mapping files (if empty)
+Explorer.RemoveClassesAction.QuestionDialog.Radio2=Delete source code
+
+Explorer.ClearFieldMappingActionName=Clear Mapping...
+Explorer.ClearFieldMappingActionToolTipText=Clear mapping
+Explorer.ClearFieldMappingTitle=Confirm Clear Mapping
+Explorer.ClearFieldMappingQuestion=Are you sure you want to remove the mapping\nfor the
"{0}"?
+
+Explorer.ClassAutoMappingActionName=Auto Mapping
+Explorer.ClassAutoMappingActionToolTipText=Auto mapping
+
+Explorer.RefreshClassSchemaMappingActionName=Synchronize Mapping...
+Explorer.RefreshClassSchemaMappingActionToolTipText=Synchronize Mapping
+Explorer.RefreshClassSchemaMappingTitle=Warning
+Explorer.RefreshClassSchemaMappingQuestion=Red Hat Developer Studio will automatically
synchronize mapping with the source code.\n\nPress OK to continue.
+
+
+Explorer.PackageAutoMappingActionName=Auto Mapping
+Explorer.PackageAutoMappingActionToolTipText=Auto mapping
+Explorer.PackageAutoMappingAction.ProgressMonitor=Auto mapping "{0}"
+
+Explorer.RefreshPackageSchemaMappingActionName=Synchronize Mapping...
+Explorer.RefreshPackageSchemaMappingActionToolTipText=Synchronize Mapping
+Explorer.RefreshPackageSchemaMappingTitle=Warning
+Explorer.RefreshPackageSchemaMappingQuestion=Red Hat Developer Studio will automatically
synchronize mapping with the source code.\n\nPress OK to continue.
+
+Explorer.RefreshMappingSchemaMappingActionName=Synchronize Mapping...
+Explorer.RefreshMappingSchemaMappingActionToolTipText=Synchronize Mapping
+Explorer.RefreshMappingSchemaMapping.ProgressMonitor=Synchronize Mapping "{0}"
+Explorer.RefreshMappingSchemaMappingTitle=Warning
+Explorer.RefreshMappingSchemaMappingQuestion=Red Hat Developer Studio will automatically
synchronize mapping with the source code.\n\nPress OK to continue.
+
+Explorer.RefactoringDialogClassActionName=Rename Class...
+Explorer.RefactoringDialogClassActionToolTipText=Rename a class
+
+Explorer.RefactoringDialogFieldActionName=Rename Field...
+Explorer.refactoringDialogFieldActionToolTipText=Rename a field
+
+Explorer.FetchStrategyWizarddName=Fetch Strategy Wizard...
+Explorer.FetchStrategyWizardToolTipText=Fetch strategy
+
+Explorer.CollapseAllActionName=Collapse All
+Explorer.CollapseAllActionToolTipText=Collapse all
+
+Explorer.ExpandAllActionName=Expand All
+Explorer.ExpandAllActionToolTipText=Expand all
+
+Explorer.refreshMappingActionName=Refresh
+Explorer.refreshMappingActionToolTipText=Refresh
+Explorer.refreshMappingAction.ProgressMonitor=Refresh
+
+Explorer.refreshOrmProjectActionName=Refresh
+Explorer.refreshOrmProjectActionToolTipText=Refresh
+Explorer.refreshOrmProjectAction.ProgressMonitor=Refresh "{0}"
+
+Explorer.removeConfigAction.ProgressMonitor=Remove "{0}"
+Explorer.removeConfigActionName=Remove Hibernate Configuration...
+Explorer.removeConfigActionToolTipText=Remove Hibernate configuration
+Explorer.removeConfigAction.QuestionDialog.Title=Confirm Remove Hibernate Configuration
+Explorer.removeConfigAction.QuestionDialog.Message=Do you want to remove the Hibernate
Configuration "{0}"?
+Explorer.removeConfigAction.QuestionDialog.Radio1=Also delete the mapping files
+Explorer.removeConfigAction.QuestionDialog.Radio2=Do not delete the mapping files
+
+Explorer.RenameTableObjectActionName=Rename Table...
+Explorer.RenameTableObjectActionToolTipText=Rename table
+
+Explorer.AddColumnDialogActionName=Add Column...
+Explorer.AddColumnDialogActionToolTipText=Add column
+
+Explorer.RemoveTableActionName=Remove Table...
+Explorer.RemoveTableActionTipText=Remove table
+Explorer.RemoveTableQuestion=Are you sure you want to remove table '
+Explorer.RemoveTableConfirmDeleteTitle=Confirm Delete
+
+Explorer.renameTableObjectDialogForColumnActionName=Rename Column...
+Explorer.renameTableObjectDialogForColumnActionToolTipText=Rename column
+
+Explorer.AddMappingStorageActionName=Add Mapping Files...
+Explorer.AddMappingStorageActionMessage=Choose mapping files to be added to the current
Hibernate configuration:
+Explorer.AddMappingStorageActionTipText=Add a Hibernate mapping file
+Explorer.FileNoErrorProjectDialogTitle=Action Explorer Visitor
+Explorer.FileNoErrorProjectDialogMessage=File "{0}" is outside of project
"{1}"
+Explorer.ConfirmProjectToPathDialogTitle=Confirm Add Project to the Build Path
+Explorer.ConfirmProjectToPathDialogMessage=Do you want to add project "{0}" to
the build path and mapping files to the current Hibernate configuration?
+Explorer.ConfirmProjectToPathDialogButtonLabelOK=OK
+Explorer.ConfirmProjectToPathDialogButtonLabelCancel=Cancel
+Explorer.XMLFileStorageDublicateTitle=Add Mapping Files
+Explorer.XMLFileStorageDublicateMessage=File "{0}" contains mapping for
existing persistent class "{1}".\nThe file will be ignored.
+
+
+Explorer.ColumnPropertyDialogActionName=Properties...
+Explorer.ColumnPropertyDialogActionToolTipText=Properties
+
+Explorer.ViewTableActionName=View Table
+Explorer.ViewTableActionToolTipText=View table
+
+Explorer.ormProjectsNotFound=There are no projects available with Hibernate
capabilities!
+Explorer.ormProjectsWasFound=
+
+Explorer.openSourceActionName=Open Source Code
+Explorer.openSourceActionToolTipText=Open a source file
+
+Explorer.openMappingStorageActionName=Open Mapping
+Explorer.openMappingStorageActionToolTipText=Open a mapping storage file
+
+Explorer.openMappingActionName=Open Mapping
+Explorer.openMappingActionToolTipText=Open a Hibernate configuration file
+
+Explorer.hibernateAddMappingWizardName=New Hibernate Configuration...
+Explorer.hibernateAddMappingWizardToolTipText=New Hibernate Configuration...
+
+Explorer.RefreshSchemaMappingActionName=Synchronize Schema Mapping...
+Explorer.RefreshSchemaMappingActionToolTipText=Synchronize Schema Mapping
+Explorer.RefreshSchemaMappingTitle=Warning
+Explorer.RefreshSchemaMappingQuestion=Warning.\nRed Hat Developer Studio will
automatically synchronize mapping with the Data Schema.
+
+
+Explorer.RefreshDatabaseTableSchemaMappingActionName=Synchronize Table Mapping...
+Explorer.RefreshDatabaseTableSchemaMappingActionToolTipText=Synchronize Table Mapping
+Explorer.RefreshDatabaseTableSchemaTitle=Warning
+Explorer.RefreshDatabaseTableSchemaQuestion=Warning.\nRed Hat Developer Studio will
automatically synchronize mapping with the Data Schema.
+
+Explorer.HQLConsole=HQL Console
+Explorer.HQLConsoleToolTipText=HQL Console
+Explorer.HibernateConsole=Hibernate Console
+Explorer.HibernateConsoleToolTipText=Hibernate Console
+
+Explorer.OpenEditorActionName=Open Mapping Diagram
+Explorer.OpenEditorActionToolTipText=Open Mapping Diagram
+
+#ExplorerBase
+ExplorerBase.ActionRootSchemaTableColumnName=project -> mapping -> schema ->
table -> column
+ExplorerBase.ActionRootSchemaTableColumnContentDescription=project -> mapping ->
schema -> table -> column
+ExplorerBase.ActionRootSchemaTableColumnToolTipText=Show Relational Schema
+
+ExplorerBase.ActionRootTableColumnName=project -> mapping -> table -> column
+ExplorerBase.ActionRootTableColumnContentDescription=project -> mapping -> table
-> column
+ExplorerBase.ActionRootTableColumnToolTipText=Show columns
+OrmExplorer.licenceTitle=Evaluation Period
+OrmExplorer.licencemessage=Evaluation period expired.
+#OrmModelNameVisitor
+OrmModelNameVisitor.DefaultPackageName=Default Package
+OrmModelNameVisitor.DefaultDatabaseSchema=Default Schema
+OrmModelNameVisitor.Colon=:
+OrmModelNameVisitor.OpenBrackets=(
+OrmModelNameVisitor.Comma=,
+OrmModelNameVisitor.CloseBrackets=)
+
+#Job
+Job.LoadMapping=Loading mappings...