JBoss Tools SVN: r17643 - in trunk: jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-09-17 18:40:05 -0400 (Thu, 17 Sep 2009)
New Revision: 17643
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/JavaMemberELSegmentImpl.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java
Log:
JBIDE-4897: OpenOn's don't work for EL in xhtml pages.
The open-ons operability is restored
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/JavaMemberELSegmentImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/JavaMemberELSegmentImpl.java 2009-09-17 21:47:15 UTC (rev 17642)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/JavaMemberELSegmentImpl.java 2009-09-17 22:40:05 UTC (rev 17643)
@@ -105,6 +105,7 @@
*/
public void setMemberInfo(MemberInfo memberInfo) {
this.memberInfo = memberInfo;
+ this.setElement(memberInfo != null ? memberInfo.getJavaElement() : null);
}
/**
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java 2009-09-17 21:47:15 UTC (rev 17642)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java 2009-09-17 22:40:05 UTC (rev 17643)
@@ -481,7 +481,6 @@
proposals.add(proposal);
}
segment.setMemberInfo(bijectedAttribute!=null?bijectedAttribute:member);
- segment.setElement(bijectedAttribute!=null?bijectedAttribute.getJavaElement():member!=null?member.getJavaElement():null);
segment.getVariables().add(var);
}
// <<<=== JBIDE-512, JBIDE-2541 related changes
@@ -500,7 +499,6 @@
if (member != null && !members.contains(member)) {
members.add(member);
segment.setMemberInfo(member);
- segment.setElement(member.getJavaElement());
segment.getVariables().add(var);
segment.setResolved(true);
}
@@ -527,7 +525,6 @@
}
if(!members.isEmpty()) {
segment.setMemberInfo(members.get(0)); // TODO: This is a buggy way to select a member to setup in a segment
- segment.setElement(members.get(0).getJavaElement());
}
resolution.addSegment(segment);
} else { // Last segment
@@ -756,7 +753,6 @@
proposalsToFilter.addAll(infos.getMethodPresentations());
proposalsToFilter.addAll(infos.getPropertyPresentations(segment.getUnpairedGettersOrSetters()));
segment.setMemberInfo(mbr);
- segment.setElement(mbr!=null?mbr.getJavaElement():null);
}
for (TypeInfoCollector.MemberPresentation proposal : proposalsToFilter) {
// We do expect nothing but name for method tokens (No round brackets)
@@ -773,7 +769,6 @@
kbProposals.add(kbProposal);
segment.setMemberInfo(proposal.getMember());
- segment.setElement(proposal.getMember()!=null?proposal.getMember().getJavaElement():null);
if(segment.getUnpairedGettersOrSetters()!=null) {
TypeInfoCollector.MethodInfo unpirMethod = segment.getUnpairedGettersOrSetters().get(filter);
segment.clearUnpairedGettersOrSetters();
@@ -829,7 +824,6 @@
WebKbPlugin.getDefault().logError(jme);
}
segment.setMemberInfo(mbr);
- segment.setElement(mbr!=null?mbr.getJavaElement():null);
}
String filter = expr.getMemberName();
@@ -862,7 +856,6 @@
kbProposals.add(kbProposal);
segment.setMemberInfo(proposal.getMember());
- segment.setElement(proposal.getMember()!=null?proposal.getMember().getJavaElement():null);
if(segment.getUnpairedGettersOrSetters()!=null) {
TypeInfoCollector.MethodInfo unpirMethod = segment.getUnpairedGettersOrSetters().get(filter);
segment.clearUnpairedGettersOrSetters();
15 years, 4 months
JBoss Tools SVN: r17642 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb: src/org/jboss/tools/jst/web/kb/el and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-09-17 17:47:15 -0400 (Thu, 17 Sep 2009)
New Revision: 17642
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java
Log:
JBIDE-512 context variable code completion dropdown should show their "source"
JBIDE-2541 Show java-doc for EL content assist item
The values of type, sourceType and JavaDoc are gathered to be displayed in CA
The JavaDoc comments are shown even from classes stored in JavaSource folders
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2009-09-17 17:47:25 UTC (rev 17641)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2009-09-17 21:47:15 UTC (rev 17642)
@@ -12,7 +12,8 @@
org.jboss.tools.common.el.core,
org.eclipse.jface.text,
org.eclipse.wst.sse.core,
- org.eclipse.wst.xml.ui;bundle-version="1.1.0"
+ org.eclipse.wst.xml.ui;bundle-version="1.1.0",
+ org.eclipse.jdt.ui;bundle-version="3.5.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %providerName
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java 2009-09-17 17:47:25 UTC (rev 17641)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java 2009-09-17 21:47:15 UTC (rev 17642)
@@ -17,9 +17,11 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
+import org.eclipse.jdt.internal.ui.text.java.ProposalInfo;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.common.el.core.model.ELArgumentInvocation;
@@ -109,6 +111,14 @@
return resolution;
}
+ /**
+ * Resolves EL Operand
+ *
+ * @param operand
+ * @param context
+ * @param returnEqualedVariablesOnly
+ * @return
+ */
public ELResolution resolveELOperand(ELExpression operand, ELContext context, boolean returnEqualedVariablesOnly) {
List<Var> vars = new ArrayList<Var>();
Var[] array = context.getVars();
@@ -282,14 +292,8 @@
}
IJavaElement element = memberInfo == null ? null : memberInfo.getJavaElement();
- String attachedJavaDoc = null;
+ String attachedJavaDoc = (element instanceof IMember)?(new ProposalInfo((IMember)element)).getInfo(null):null;
- try {
- attachedJavaDoc = element == null ? null : element.getAttachedJavadoc(null);
- } catch (JavaModelException e) {
- WebKbPlugin.getDefault().logError(e);
- }
-
String varNameProposal = v.getName().substring(prefix.length());
TextProposal proposal = new TextProposal();
proposal.setLabel(v.getName());
@@ -406,14 +410,8 @@
typeName = Signature.getSimpleName(typeName);
IJavaElement element = member == null ? null : member.getJavaElement();
- String attachedJavaDoc = null;
+ String attachedJavaDoc = (element instanceof IMember)?(new ProposalInfo((IMember)element)).getInfo(null):null;
- try {
- attachedJavaDoc = element == null ? null : element.getAttachedJavadoc(null);
- } catch (JavaModelException e) {
- WebKbPlugin.getDefault().logError(e);
- }
-
TextProposal proposal = new TextProposal();
proposal.setLabel(varName);
proposal.setReplacementString(varName.substring(operand.getLength()));
@@ -460,14 +458,8 @@
if (typeName != null && typeName.indexOf('.') != -1)
typeName = Signature.getSimpleName(typeName);
IJavaElement element = member == null ? null : member.getJavaElement();
- String attachedJavaDoc = null;
-
- try {
- attachedJavaDoc = element == null ? null : element.getAttachedJavadoc(null);
- } catch (JavaModelException e) {
- WebKbPlugin.getDefault().logError(e);
- }
-
+ String attachedJavaDoc = (element instanceof IMember)?(new ProposalInfo((IMember)element)).getInfo(null):null;
+
String varName = var.getName();
if(operand.getLength()<=varName.length()) {
TextProposal proposal = new TextProposal();
@@ -685,14 +677,8 @@
if (typeName != null && typeName.indexOf('.') != -1)
typeName = Signature.getSimpleName(typeName);
IJavaElement element = member == null ? null : member.getJavaElement();
- String attachedJavaDoc = null;
+ String attachedJavaDoc = (element instanceof IMember)?(new ProposalInfo((IMember)element)).getInfo(null):null;
- try {
- attachedJavaDoc = element == null ? null : element.getAttachedJavadoc(null);
- } catch (JavaModelException e) {
- WebKbPlugin.getDefault().logError(e);
- }
-
TextProposal proposal = new TextProposal();
proposal.setReplacementString(presentationString);
proposal.setLabel(presentationString);
@@ -733,14 +719,8 @@
if (typeName != null && typeName.indexOf('.') != -1)
typeName = Signature.getSimpleName(typeName);
IJavaElement element = member == null ? null : member.getJavaElement();
- String attachedJavaDoc = null;
+ String attachedJavaDoc = (element instanceof IMember)?(new ProposalInfo((IMember)element)).getInfo(null):null;
- try {
- attachedJavaDoc = element == null ? null : element.getAttachedJavadoc(null);
- } catch (JavaModelException e) {
- WebKbPlugin.getDefault().logError(e);
- }
-
TextProposal proposal = new TextProposal();
proposal.setReplacementString(presentationString);
proposal.setLabel(presentationString);
@@ -815,13 +795,7 @@
if (typeName != null && typeName.indexOf('.') != -1)
typeName = Signature.getSimpleName(typeName);
IJavaElement element = member == null ? null : member.getJavaElement();
- String attachedJavaDoc = null;
-
- try {
- attachedJavaDoc = element == null ? null : element.getAttachedJavadoc(null);
- } catch (JavaModelException e) {
- WebKbPlugin.getDefault().logError(e);
- }
+ String attachedJavaDoc = (element instanceof IMember)?(new ProposalInfo((IMember)element)).getInfo(null):null;
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal.getPresentation().substring(filter.length()));
@@ -910,14 +884,8 @@
if (typeName != null && typeName.indexOf('.') != -1)
typeName = Signature.getSimpleName(typeName);
IJavaElement element = member == null ? null : member.getJavaElement();
- String attachedJavaDoc = null;
+ String attachedJavaDoc = (element instanceof IMember)?(new ProposalInfo((IMember)element)).getInfo(null):null;
- try {
- attachedJavaDoc = element == null ? null : element.getAttachedJavadoc(null);
- } catch (JavaModelException e) {
- WebKbPlugin.getDefault().logError(e);
- }
-
TextProposal kbProposal = new TextProposal();
String replacementString = proposal.getPresentation().substring(filter.length());
15 years, 4 months
JBoss Tools SVN: r17641 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-09-17 13:47:25 -0400 (Thu, 17 Sep 2009)
New Revision: 17641
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4771
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java 2009-09-17 17:18:22 UTC (rev 17640)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java 2009-09-17 17:47:25 UTC (rev 17641)
@@ -376,17 +376,12 @@
SimpleELContext context = new SimpleELContext();
- ElVarSearcher elSearcher = new ElVarSearcher((ELCompletionEngine)resolver);
-
- List<Var> vars = elSearcher.findAllVars(file, offset);
-
- if(vars == null)
- continue;
-
- context.setVars(vars);
context.setResource(file);
context.setElResolvers(resolvers);
-
+
+ List<Var> vars = ElVarSearcher.findAllVars(context, offset, resolver);
+ context.setVars(vars);
+
ELResolution resolution = resolver.resolve(context, operand);
if(resolution == null)
@@ -407,4 +402,4 @@
}
}
}
-}
+}
\ No newline at end of file
15 years, 4 months
JBoss Tools SVN: r17640 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram: editors and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-09-17 13:18:22 -0400 (Thu, 17 Sep 2009)
New Revision: 17640
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ActionMenu.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/RefreshAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleAssociationAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleClassMappingAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleForeignKeyConstraintAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/TogglePropertyMappingAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleassociation.png
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleclassmapping.png
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleforeignkeyconstraint.png
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/togglepropertymapping.png
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleshapeexpandstate2.png
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/DiagramViewerMessages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/DiagramViewerMessages.properties
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramActionBarContributor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramContentOutlinePage.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/DiagramBaseAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/DiagramBaseRetargetAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenMappingAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenSourceAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleConnectionsAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleShapeExpandStateAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleShapeVisibleStateAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/autolayout.png
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleconnections.png
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleshapeexpandstate.png
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleshapevisiblestate.png
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Connection.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Shape.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/popup/PopupMenuProvider.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4873, https://jira.jboss.org/jira/browse/JBIDE-4620 - gui update (icons, toolbar, menu, new action, small bugfix)
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/DiagramViewerMessages.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/DiagramViewerMessages.java 2009-09-17 16:41:17 UTC (rev 17639)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/DiagramViewerMessages.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -53,4 +53,8 @@
public static String DiagramViewer_OutlinePage_Sort_label;
public static String DiagramViewer_OutlinePage_Sort_tooltip;
public static String DiagramViewer_OutlinePage_Sort_description;
+ public static String ToggleClassMappingAction_class_mappings;
+ public static String TogglePropertyMappingAction_property_mappings;
+ public static String ToggleAssociationAction_associations;
+ public static String ToggleForeignKeyConstraintAction_foreign_key_constraints;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/DiagramViewerMessages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/DiagramViewerMessages.properties 2009-09-17 16:41:17 UTC (rev 17639)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/DiagramViewerMessages.properties 2009-09-17 17:18:22 UTC (rev 17640)
@@ -15,9 +15,9 @@
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
-ToggleShapeExpandStateAction_toggle_expand_state=Toggle expand state
+ToggleShapeExpandStateAction_toggle_expand_state=Expand|Collapse
ToggleShapeVisibleStateAction_toggle_visible_state=Toggle visible state
-ToggleConnectionsAction_toggle_connections=Toggle connections
+ToggleConnectionsAction_toggle_connections=Show|Hide connections
ShapeSetConstraintCommand_move=move
PartFactory_canot_create_part_for_model_element=Can't create part for model element:
PartFactory_null=null
@@ -29,3 +29,7 @@
DiagramViewer_OutlinePage_Sort_label=Sort
DiagramViewer_OutlinePage_Sort_tooltip=Sort
DiagramViewer_OutlinePage_Sort_description=Enable Sorting
+ToggleClassMappingAction_class_mappings=Class Mappings
+TogglePropertyMappingAction_property_mappings=Property Mappings
+ToggleAssociationAction_associations=Associations
+ToggleForeignKeyConstraintAction_foreign_key_constraints=Foreign key constraints
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramActionBarContributor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramActionBarContributor.java 2009-09-17 16:41:17 UTC (rev 17639)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramActionBarContributor.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -19,6 +19,7 @@
import org.eclipse.gef.ui.actions.ZoomComboContributionItem;
import org.eclipse.gef.ui.actions.ZoomInRetargetAction;
import org.eclipse.gef.ui.actions.ZoomOutRetargetAction;
+import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
@@ -30,9 +31,14 @@
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
import org.jboss.tools.hibernate.ui.diagram.UiPlugin;
+import org.jboss.tools.hibernate.ui.diagram.editors.actions.ActionMenu;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.AutoLayoutAction;
+import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleAssociationAction;
+import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleClassMappingAction;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleConnectionsAction;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.DiagramBaseRetargetAction;
+import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleForeignKeyConstraintAction;
+import org.jboss.tools.hibernate.ui.diagram.editors.actions.TogglePropertyMappingAction;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleShapeExpandStateAction;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleShapeVisibleStateAction;
import org.jboss.tools.hibernate.ui.view.ImageBundle;
@@ -49,28 +55,72 @@
workbenchAction.setToolTipText(DiagramViewerMessages.EditorActionContributor_refresh_visual_mapping);
addAction(workbenchAction);
//
- addRetargetAction(new DiagramBaseRetargetAction(
+ DiagramBaseRetargetAction diagramAction;
+ Action[] act;
+ //
+ diagramAction = new DiagramBaseRetargetAction(
AutoLayoutAction.ACTION_ID,
DiagramViewerMessages.AutoLayoutAction_auto_layout,
DiagramViewerMessages.AutoLayoutAction_auto_layout,
- AutoLayoutAction.img));
+ AutoLayoutAction.img);
+ addRetargetAction(diagramAction);
//
- addRetargetAction(new DiagramBaseRetargetAction(
+ DiagramBaseRetargetAction diagramAction1 = new DiagramBaseRetargetAction(
ToggleConnectionsAction.ACTION_ID,
DiagramViewerMessages.ToggleConnectionsAction_toggle_connections,
DiagramViewerMessages.ToggleConnectionsAction_toggle_connections,
- ToggleConnectionsAction.img));
- addRetargetAction(new DiagramBaseRetargetAction(
+ ToggleConnectionsAction.img);
+ addRetargetAction(diagramAction1);
+ //
+ DiagramBaseRetargetAction diagramAction2 = new DiagramBaseRetargetAction(
ToggleShapeExpandStateAction.ACTION_ID,
DiagramViewerMessages.ToggleShapeExpandStateAction_toggle_expand_state,
DiagramViewerMessages.ToggleShapeExpandStateAction_toggle_expand_state,
- ToggleShapeExpandStateAction.img));
- addRetargetAction(new DiagramBaseRetargetAction(
+ ToggleShapeExpandStateAction.img);
+ addRetargetAction(diagramAction2);
+ //
+ diagramAction = new DiagramBaseRetargetAction(
ToggleShapeVisibleStateAction.ACTION_ID,
DiagramViewerMessages.ToggleShapeVisibleStateAction_toggle_visible_state,
DiagramViewerMessages.ToggleShapeVisibleStateAction_toggle_visible_state,
- ToggleShapeVisibleStateAction.img));
+ ToggleShapeVisibleStateAction.img);
+ addRetargetAction(diagramAction);
//
+ diagramAction = new DiagramBaseRetargetAction(
+ ToggleClassMappingAction.ACTION_ID,
+ DiagramViewerMessages.ToggleClassMappingAction_class_mappings,
+ DiagramViewerMessages.ToggleClassMappingAction_class_mappings,
+ ToggleClassMappingAction.img, IAction.AS_CHECK_BOX);
+ addRetargetAction(diagramAction);
+ //
+ diagramAction = new DiagramBaseRetargetAction(
+ TogglePropertyMappingAction.ACTION_ID,
+ DiagramViewerMessages.TogglePropertyMappingAction_property_mappings,
+ DiagramViewerMessages.TogglePropertyMappingAction_property_mappings,
+ TogglePropertyMappingAction.img, IAction.AS_CHECK_BOX);
+ addRetargetAction(diagramAction);
+ //
+ diagramAction = new DiagramBaseRetargetAction(
+ ToggleAssociationAction.ACTION_ID,
+ DiagramViewerMessages.ToggleAssociationAction_associations,
+ DiagramViewerMessages.ToggleAssociationAction_associations,
+ ToggleAssociationAction.img, IAction.AS_CHECK_BOX);
+ addRetargetAction(diagramAction);
+ //
+ diagramAction = new DiagramBaseRetargetAction(
+ ToggleForeignKeyConstraintAction.ACTION_ID,
+ DiagramViewerMessages.ToggleForeignKeyConstraintAction_foreign_key_constraints,
+ DiagramViewerMessages.ToggleForeignKeyConstraintAction_foreign_key_constraints,
+ ToggleForeignKeyConstraintAction.img, IAction.AS_CHECK_BOX);
+ addRetargetAction(diagramAction);
+ //
+ act = new Action[4];
+ act[0] = (Action)getAction(TogglePropertyMappingAction.ACTION_ID);
+ act[1] = (Action)getAction(ToggleClassMappingAction.ACTION_ID);
+ act[2] = (Action)getAction(ToggleAssociationAction.ACTION_ID);
+ act[3] = (Action)getAction(ToggleForeignKeyConstraintAction.ACTION_ID);
+ diagramAction1.setMenuCreator(new ActionMenu(act));
+ //
addRetargetAction(new UndoRetargetAction());
addRetargetAction(new RedoRetargetAction());
addRetargetAction(new ZoomInRetargetAction());
@@ -93,10 +143,10 @@
*/
public void contributeToToolBar(IToolBarManager tbm) {
tbm.add(getAction(ActionFactory.REFRESH.getId()));
- tbm.add(new Separator());
- tbm.add(getAction(ActionFactory.UNDO.getId()));
- tbm.add(getAction(ActionFactory.REDO.getId()));
- tbm.add(new Separator());
+ tbm.add(new Separator());
+ //tbm.add(getAction(ActionFactory.UNDO.getId()));
+ //tbm.add(getAction(ActionFactory.REDO.getId()));
+ //tbm.add(new Separator());
//tbm.add(getAction(GEFActionConstants.ZOOM_IN));
//tbm.add(getAction(GEFActionConstants.ZOOM_OUT));
String[] zoomStrings = new String[] {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramContentOutlinePage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramContentOutlinePage.java 2009-09-17 16:41:17 UTC (rev 17639)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramContentOutlinePage.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -44,6 +44,10 @@
import org.eclipse.ui.part.IPageSite;
import org.eclipse.ui.part.PageBook;
import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
+import org.jboss.tools.hibernate.ui.diagram.editors.actions.AutoLayoutAction;
+import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleConnectionsAction;
+import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleShapeExpandStateAction;
+import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleShapeVisibleStateAction;
import org.jboss.tools.hibernate.ui.diagram.editors.model.OrmDiagram;
import org.jboss.tools.hibernate.ui.diagram.editors.parts.TreePartFactory;
import org.jboss.tools.hibernate.ui.diagram.editors.popup.PopupMenuProvider;
@@ -151,6 +155,18 @@
bars.setGlobalActionHandler(id, registry.getAction(id));
id = ActionFactory.REDO.getId();
bars.setGlobalActionHandler(id, registry.getAction(id));
+ id = ActionFactory.REFRESH.getId();
+ bars.setGlobalActionHandler(id, registry.getAction(id));
+ id = ActionFactory.PRINT.getId();
+ bars.setGlobalActionHandler(id, registry.getAction(id));
+ id = AutoLayoutAction.ACTION_ID;
+ bars.setGlobalActionHandler(id, registry.getAction(id));
+ id = ToggleConnectionsAction.ACTION_ID;
+ bars.setGlobalActionHandler(id, registry.getAction(id));
+ id = ToggleShapeExpandStateAction.ACTION_ID;
+ bars.setGlobalActionHandler(id, registry.getAction(id));
+ id = ToggleShapeVisibleStateAction.ACTION_ID;
+ bars.setGlobalActionHandler(id, registry.getAction(id));
bars.updateActionBars();
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java 2009-09-17 16:41:17 UTC (rev 17639)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -41,13 +41,13 @@
import org.eclipse.gef.ui.actions.ToggleRulerVisibilityAction;
import org.eclipse.gef.ui.actions.ToggleSnapToGeometryAction;
import org.eclipse.gef.ui.actions.UndoAction;
-import org.eclipse.gef.ui.actions.WorkbenchPartAction;
import org.eclipse.gef.ui.actions.ZoomInAction;
import org.eclipse.gef.ui.actions.ZoomOutAction;
import org.eclipse.gef.ui.parts.GraphicalEditor;
import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
import org.eclipse.gef.ui.parts.TreeViewer;
import org.eclipse.gef.ui.rulers.RulerComposite;
+import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.util.TransferDropTargetListener;
import org.eclipse.swt.SWT;
@@ -60,6 +60,7 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.mapping.RootClass;
import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
+import org.jboss.tools.hibernate.ui.diagram.editors.actions.ActionMenu;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.AutoLayoutAction;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.CollapseAllAction;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.ExpandAllAction;
@@ -67,7 +68,12 @@
import org.jboss.tools.hibernate.ui.diagram.editors.actions.OpenMappingAction;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.OpenSourceAction;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.PrintDiagramViewerAction;
+import org.jboss.tools.hibernate.ui.diagram.editors.actions.RefreshAction;
+import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleAssociationAction;
+import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleClassMappingAction;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleConnectionsAction;
+import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleForeignKeyConstraintAction;
+import org.jboss.tools.hibernate.ui.diagram.editors.actions.TogglePropertyMappingAction;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleShapeExpandStateAction;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleShapeVisibleStateAction;
import org.jboss.tools.hibernate.ui.diagram.editors.model.OrmDiagram;
@@ -81,7 +87,9 @@
import org.jboss.tools.hibernate.ui.view.ObjectEditorInput;
/**
- * @author some modifications from Vitali
+ *
+ * @author ?
+ * @author Vitali Yemialyanchyk
*/
public class DiagramViewer extends GraphicalEditor {
@@ -151,21 +159,15 @@
@SuppressWarnings("unchecked")
protected void createActions() {
- getEditorSite().getActionBars().setGlobalActionHandler(
- ActionFactory.REFRESH.getId(), new WorkbenchPartAction(this) {
-
- protected boolean calculateEnabled() {
- return true;
- }
- public void run() {
- ormDiagram.refresh();
- }
- });
-
//super.createActions();
// BEGIN: redefine super.createActions
ActionRegistry registry = getActionRegistry();
IAction action;
+
+ action = new RefreshAction(this);
+ registry.registerAction(action);
+ getEditorSite().getActionBars().setGlobalActionHandler(
+ ActionFactory.REFRESH.getId(), action);
action = new UndoAction(this);
registry.registerAction(action);
@@ -206,14 +208,28 @@
action = new AutoLayoutAction(this);
registry.registerAction(action);
- action = new ToggleConnectionsAction(this);
+ ToggleConnectionsAction actionToggleConnections = new ToggleConnectionsAction(this);
+ registry.registerAction(actionToggleConnections);
+
+ action = new ToggleAssociationAction(this);
registry.registerAction(action);
+ action = new ToggleClassMappingAction(this);
+ registry.registerAction(action);
+
+ action = new ToggleForeignKeyConstraintAction(this);
+ registry.registerAction(action);
+
+ action = new TogglePropertyMappingAction(this);
+ registry.registerAction(action);
+
action = new ToggleShapeExpandStateAction(this);
registry.registerAction(action);
+ getSelectionActions().add(action.getId());
action = new ToggleShapeVisibleStateAction(this);
registry.registerAction(action);
+ getSelectionActions().add(action.getId());
action = new CollapseAllAction(this);
registry.registerAction(action);
@@ -227,6 +243,13 @@
action = new ZoomOutAction(gefRootEditPart.getZoomManager());
registry.registerAction(action);
+ Action[] act = new Action[4];
+ act[0] = (Action)registry.getAction(TogglePropertyMappingAction.ACTION_ID);
+ act[1] = (Action)registry.getAction(ToggleClassMappingAction.ACTION_ID);
+ act[2] = (Action)registry.getAction(ToggleAssociationAction.ACTION_ID);
+ act[3] = (Action)registry.getAction(ToggleForeignKeyConstraintAction.ACTION_ID);
+ actionToggleConnections.setMenuCreator(new ActionMenu(act));
+
}
private TransferDropTargetListener createTransferDropTargetListener() {
@@ -304,6 +327,9 @@
outline.setSelectionSynchronizer(getSelectionSynchronizer());
outline.setOrmDiagram(ormDiagram);
outline.setEditor(this);
+ RefreshAction refreshAction = (RefreshAction)getActionRegistry().getAction(
+ ActionFactory.REFRESH.getId());
+ refreshAction.setOutlinePage(outline);
return outline;
}
if (type == ZoomManager.class) {
@@ -480,4 +506,49 @@
}
return res;
}
+
+
+ public boolean getConnectionsVisibilityAssociation() {
+ return getViewerContents().getConnectionsVisibilityAssociation();
+ }
+
+ public void setConnectionsVisibilityAssociation(boolean connectionsVisibilityAssociation) {
+ getViewerContents().setConnectionsVisibilityAssociation(connectionsVisibilityAssociation);
+ ActionRegistry registry = getActionRegistry();
+ IAction action = registry.getAction(ToggleAssociationAction.ACTION_ID);
+ action.setChecked(connectionsVisibilityAssociation);
+ }
+
+ public boolean getConnectionsVisibilityClassMapping() {
+ return getViewerContents().getConnectionsVisibilityClassMapping();
+ }
+
+ public void setConnectionsVisibilityClassMapping(boolean connectionsVisibilityClassMapping) {
+ getViewerContents().setConnectionsVisibilityClassMapping(connectionsVisibilityClassMapping);
+ ActionRegistry registry = getActionRegistry();
+ IAction action = registry.getAction(ToggleClassMappingAction.ACTION_ID);
+ action.setChecked(connectionsVisibilityClassMapping);
+ }
+
+ public boolean getConnectionsVisibilityForeignKeyConstraint() {
+ return getViewerContents().getConnectionsVisibilityForeignKeyConstraint();
+ }
+
+ public void setConnectionsVisibilityForeignKeyConstraint(boolean connectionsVisibilityForeignKeyConstraint) {
+ getViewerContents().setConnectionsVisibilityForeignKeyConstraint(connectionsVisibilityForeignKeyConstraint);
+ ActionRegistry registry = getActionRegistry();
+ IAction action = registry.getAction(ToggleForeignKeyConstraintAction.ACTION_ID);
+ action.setChecked(connectionsVisibilityForeignKeyConstraint);
+ }
+
+ public boolean getConnectionsVisibilityPropertyMapping() {
+ return getViewerContents().getConnectionsVisibilityPropertyMapping();
+ }
+
+ public void setConnectionsVisibilityPropertyMapping(boolean connectionsVisibilityPropertyMapping) {
+ getViewerContents().setConnectionsVisibilityPropertyMapping(connectionsVisibilityPropertyMapping);
+ ActionRegistry registry = getActionRegistry();
+ IAction action = registry.getAction(TogglePropertyMappingAction.ACTION_ID);
+ action.setChecked(connectionsVisibilityPropertyMapping);
+ }
}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ActionMenu.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ActionMenu.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ActionMenu.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 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.diagram.editors.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+
+/**
+ * Menu with list of actions.
+ *
+ * @author Vitali Yemialyanchyk
+ */
+public class ActionMenu extends Action implements IMenuCreator {
+
+ private Action[] actions;
+ private Menu menu;
+
+ public ActionMenu(Action[] actions) {
+ this.actions = actions;
+ if (this.actions.length > 0) {
+ setToolTipText(actions[0].getToolTipText());
+ setImageDescriptor(actions[0].getImageDescriptor());
+ if (actions.length > 1) {
+ setMenuCreator(this);
+ }
+ }
+ }
+
+ public void run() {
+ if (actions.length > 0) {
+ actions[0].run();
+ }
+ }
+
+ public void dispose() {
+ if (menu != null) {
+ menu.dispose();
+ menu = null;
+ }
+ }
+
+ public Menu getMenu(Control parent) {
+ if (menu != null) {
+ menu.dispose();
+ }
+ menu = new Menu(parent);
+ for (int i = 0; i < actions.length; i++) {
+ addActionToMenu(menu, actions[i]);
+ }
+ return menu;
+ }
+
+ public Menu getMenu(Menu parent) {
+ if (menu != null) {
+ menu.dispose();
+ }
+ menu = new Menu(parent);
+ for (int i = 0; i < actions.length; i++) {
+ addActionToMenu(menu, actions[i]);
+ }
+ return menu;
+ }
+
+ protected void addActionToMenu(Menu parent, Action action) {
+ ActionContributionItem item = new ActionContributionItem(action);
+ item.fill(parent, -1);
+ }
+}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/DiagramBaseAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/DiagramBaseAction.java 2009-09-17 16:41:17 UTC (rev 17639)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/DiagramBaseAction.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -27,6 +27,11 @@
public DiagramBaseAction(DiagramViewer editor) {
this.editor = editor;
}
+
+ public DiagramBaseAction(DiagramViewer editor, int style) {
+ super(null, style);
+ this.editor = editor;
+ }
protected DiagramViewer getDiagramViewer() {
DiagramViewer res = editor;
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/DiagramBaseRetargetAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/DiagramBaseRetargetAction.java 2009-09-17 16:41:17 UTC (rev 17639)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/DiagramBaseRetargetAction.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -24,5 +24,13 @@
setToolTipText(toolTipText);
setImageDescriptor(imgDescriptor);
}
+
+ public DiagramBaseRetargetAction(final String actionId, final String text,
+ final String toolTipText, final ImageDescriptor imgDescriptor,
+ int style) {
+ super(actionId, text, style);
+ setToolTipText(toolTipText);
+ setImageDescriptor(imgDescriptor);
+ }
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenMappingAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenMappingAction.java 2009-09-17 16:41:17 UTC (rev 17639)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenMappingAction.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2007-2009 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,
@@ -16,11 +16,9 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.gef.ui.actions.SelectionAction;
-import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.mapping.Column;
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenSourceAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenSourceAction.java 2009-09-17 16:41:17 UTC (rev 17639)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenSourceAction.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -16,11 +16,9 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.gef.ui.actions.SelectionAction;
-import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.mapping.Column;
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/RefreshAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/RefreshAction.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/RefreshAction.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 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.diagram.editors.actions;
+
+import org.eclipse.gef.ui.actions.WorkbenchPartAction;
+import org.eclipse.ui.actions.ActionFactory;
+import org.jboss.tools.hibernate.ui.diagram.editors.DiagramContentOutlinePage;
+import org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer;
+
+/**
+ * Refresh diagram action
+ *
+ * @author Vitali Yemialyanchyk
+ */
+public class RefreshAction extends WorkbenchPartAction {
+
+ public static final String ACTION_ID = ActionFactory.REFRESH.getId();
+
+ protected DiagramContentOutlinePage outline = null;
+
+ public RefreshAction(DiagramViewer editor) {
+ super(editor);
+ setId(ACTION_ID);
+ }
+
+ protected DiagramViewer getDiagramViewer() {
+ return (DiagramViewer)getWorkbenchPart();
+ }
+
+ public void run() {
+ getDiagramViewer().getViewerContents().refresh();
+ if (outline != null) {
+ // synchronize contents of outline page
+ outline.setContents(outline.getOrmDiagram());
+ }
+ }
+
+ @Override
+ protected boolean calculateEnabled() {
+ return true;
+ }
+
+ public void setOutlinePage(DiagramContentOutlinePage outline) {
+ this.outline = outline;
+ }
+}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleAssociationAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleAssociationAction.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleAssociationAction.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 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.diagram.editors.actions;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
+import org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer;
+
+/**
+ * Show|Hide connections which type is "Associations" (class associations).
+ *
+ * @author Vitali Yemialyanchyk
+ */
+public class ToggleAssociationAction extends DiagramBaseAction {
+
+ public static final String ACTION_ID = "toggleAssociationId"; //$NON-NLS-1$
+ public static final ImageDescriptor img =
+ ImageDescriptor.createFromFile(DiagramViewer.class, "icons/toggleassociation.png"); //$NON-NLS-1$
+
+ public ToggleAssociationAction(DiagramViewer editor) {
+ super(editor);
+ setId(ACTION_ID);
+ setText(DiagramViewerMessages.ToggleAssociationAction_associations);
+ setToolTipText(DiagramViewerMessages.ToggleAssociationAction_associations);
+ setImageDescriptor(img);
+ boolean state = getDiagramViewer().getConnectionsVisibilityAssociation();
+ setChecked(state);
+ }
+
+ public void run() {
+ boolean state = getDiagramViewer().getConnectionsVisibilityAssociation();
+ getDiagramViewer().setConnectionsVisibilityAssociation(!state);
+ }
+}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleClassMappingAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleClassMappingAction.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleClassMappingAction.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 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.diagram.editors.actions;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
+import org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer;
+
+/**
+ * Show|Hide connections which type is "Class Mappings" (class->table).
+ *
+ * @author Vitali Yemialyanchyk
+ */
+public class ToggleClassMappingAction extends DiagramBaseAction {
+
+ public static final String ACTION_ID = "toggleClassMappingId"; //$NON-NLS-1$
+ public static final ImageDescriptor img =
+ ImageDescriptor.createFromFile(DiagramViewer.class, "icons/toggleclassmapping.png"); //$NON-NLS-1$
+
+ public ToggleClassMappingAction(DiagramViewer editor) {
+ super(editor);
+ setId(ACTION_ID);
+ setText(DiagramViewerMessages.ToggleClassMappingAction_class_mappings);
+ setToolTipText(DiagramViewerMessages.ToggleClassMappingAction_class_mappings);
+ setImageDescriptor(img);
+ boolean state = getDiagramViewer().getConnectionsVisibilityClassMapping();
+ setChecked(state);
+ }
+
+ public void run() {
+ boolean state = getDiagramViewer().getConnectionsVisibilityClassMapping();
+ getDiagramViewer().setConnectionsVisibilityClassMapping(!state);
+ }
+}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleConnectionsAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleConnectionsAction.java 2009-09-17 16:41:17 UTC (rev 17639)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleConnectionsAction.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -15,6 +15,8 @@
import org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer;
/**
+ * Show|Hide all connections.
+ *
* @author Vitali Yemialyanchyk
*/
public class ToggleConnectionsAction extends DiagramBaseAction {
@@ -24,7 +26,7 @@
ImageDescriptor.createFromFile(DiagramViewer.class, "icons/toggleconnections.png"); //$NON-NLS-1$
public ToggleConnectionsAction(DiagramViewer editor) {
- super(editor);
+ super(editor, AS_DROP_DOWN_MENU);
setId(ACTION_ID);
setText(DiagramViewerMessages.ToggleConnectionsAction_toggle_connections);
setToolTipText(DiagramViewerMessages.ToggleConnectionsAction_toggle_connections);
@@ -32,6 +34,13 @@
}
public void run() {
- getDiagramViewer().getViewerContents().toggleConnections();
+ boolean state = getDiagramViewer().getConnectionsVisibilityAssociation();
+ getDiagramViewer().setConnectionsVisibilityAssociation(!state);
+ state = getDiagramViewer().getConnectionsVisibilityClassMapping();
+ getDiagramViewer().setConnectionsVisibilityClassMapping(!state);
+ state = getDiagramViewer().getConnectionsVisibilityForeignKeyConstraint();
+ getDiagramViewer().setConnectionsVisibilityForeignKeyConstraint(!state);
+ state = getDiagramViewer().getConnectionsVisibilityPropertyMapping();
+ getDiagramViewer().setConnectionsVisibilityPropertyMapping(!state);
}
}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleForeignKeyConstraintAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleForeignKeyConstraintAction.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleForeignKeyConstraintAction.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 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.diagram.editors.actions;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
+import org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer;
+
+/**
+ * Show|Hide connections which type is "Foreign key constraints"
+ * (foreign keys which associations are based on).
+ *
+ * @author Vitali Yemialyanchyk
+ */
+public class ToggleForeignKeyConstraintAction extends DiagramBaseAction {
+
+ public static final String ACTION_ID = "toggleForeignKeyConstraintId"; //$NON-NLS-1$
+ public static final ImageDescriptor img =
+ ImageDescriptor.createFromFile(DiagramViewer.class, "icons/toggleforeignkeyconstraint.png"); //$NON-NLS-1$
+
+ public ToggleForeignKeyConstraintAction(DiagramViewer editor) {
+ super(editor);
+ setId(ACTION_ID);
+ setText(DiagramViewerMessages.ToggleForeignKeyConstraintAction_foreign_key_constraints);
+ setToolTipText(DiagramViewerMessages.ToggleForeignKeyConstraintAction_foreign_key_constraints);
+ setImageDescriptor(img);
+ boolean state = getDiagramViewer().getConnectionsVisibilityForeignKeyConstraint();
+ setChecked(state);
+ }
+
+ public void run() {
+ boolean state = getDiagramViewer().getConnectionsVisibilityForeignKeyConstraint();
+ getDiagramViewer().setConnectionsVisibilityForeignKeyConstraint(!state);
+ }
+}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/TogglePropertyMappingAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/TogglePropertyMappingAction.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/TogglePropertyMappingAction.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 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.diagram.editors.actions;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
+import org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer;
+
+/**
+ * Show|Hide connections which type is "Property Mappings" (property->column).
+ *
+ * @author Vitali Yemialyanchyk
+ */
+public class TogglePropertyMappingAction extends DiagramBaseAction {
+
+ public static final String ACTION_ID = "togglePropertyMappingId"; //$NON-NLS-1$
+ public static final ImageDescriptor img =
+ ImageDescriptor.createFromFile(DiagramViewer.class, "icons/togglepropertymapping.png"); //$NON-NLS-1$
+
+ public TogglePropertyMappingAction(DiagramViewer editor) {
+ super(editor);
+ setId(ACTION_ID);
+ setText(DiagramViewerMessages.TogglePropertyMappingAction_property_mappings);
+ setToolTipText(DiagramViewerMessages.TogglePropertyMappingAction_property_mappings);
+ setImageDescriptor(img);
+ boolean state = getDiagramViewer().getConnectionsVisibilityPropertyMapping();
+ setChecked(state);
+ }
+
+ public void run() {
+ boolean state = getDiagramViewer().getConnectionsVisibilityPropertyMapping();
+ getDiagramViewer().setConnectionsVisibilityPropertyMapping(!state);
+ }
+}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleShapeExpandStateAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleShapeExpandStateAction.java 2009-09-17 16:41:17 UTC (rev 17639)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleShapeExpandStateAction.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -15,10 +15,9 @@
import java.util.List;
import org.eclipse.gef.editparts.AbstractTreeEditPart;
+import org.eclipse.gef.ui.actions.SelectionAction;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
import org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer;
import org.jboss.tools.hibernate.ui.diagram.editors.model.ExpandableShape;
@@ -29,13 +28,13 @@
*
* @author Vitali Yemialyanchyk
*/
-public class ToggleShapeExpandStateAction extends DiagramBaseAction {
+public class ToggleShapeExpandStateAction extends SelectionAction {
public static final String ACTION_ID = "toggleShapeExpandStateId"; //$NON-NLS-1$
public static final ImageDescriptor img =
- ImageDescriptor.createFromFile(DiagramViewer.class, "icons/toggleshapeexpandstate.png"); //$NON-NLS-1$
+ ImageDescriptor.createFromFile(DiagramViewer.class, "icons/toggleshapeexpandstate2.png"); //$NON-NLS-1$
- public ToggleShapeExpandStateAction(DiagramViewer editor) {
+ public ToggleShapeExpandStateAction(IWorkbenchPart editor) {
super(editor);
setId(ACTION_ID);
setText(DiagramViewerMessages.ToggleShapeExpandStateAction_toggle_expand_state);
@@ -45,29 +44,52 @@
@SuppressWarnings("unchecked")
public void run() {
- ISelection selection = getDiagramViewer().getEditPartViewer().getSelection();
- if (!(selection instanceof StructuredSelection)) {
+ if (getSelectedObjects().isEmpty()) {
return;
}
List<ExpandableShape> selectedShape = new ArrayList<ExpandableShape>();
- IStructuredSelection structedSelection = (IStructuredSelection)selection;
- if (structedSelection != null) {
- Iterator it = structedSelection.iterator();
- while (it.hasNext()) {
- Object firstElement = it.next();
- Object obj = null;
- if (firstElement instanceof OrmEditPart) {
- obj = ((OrmEditPart)firstElement).getModel();
- } else if (firstElement instanceof AbstractTreeEditPart) {
- obj = ((AbstractTreeEditPart)firstElement).getModel();
- }
- if (null != obj && obj instanceof ExpandableShape) {
- selectedShape.add((ExpandableShape)obj);
- }
+ Iterator it = getSelectedObjects().iterator();
+ while (it.hasNext()) {
+ Object firstElement = it.next();
+ Object obj = null;
+ if (firstElement instanceof OrmEditPart) {
+ obj = ((OrmEditPart)firstElement).getModel();
+ } else if (firstElement instanceof AbstractTreeEditPart) {
+ obj = ((AbstractTreeEditPart)firstElement).getModel();
}
+ if (null != obj && obj instanceof ExpandableShape) {
+ selectedShape.add((ExpandableShape)obj);
+ }
}
for (ExpandableShape shape : selectedShape) {
shape.setExpanded(!shape.isExpanded());
}
}
+
+ @Override
+ protected boolean calculateEnabled() {
+ return canPerformAction();
+ }
+
+ @SuppressWarnings("unchecked")
+ private boolean canPerformAction() {
+ boolean res = false;
+ if (getSelectedObjects().isEmpty()) {
+ return res;
+ }
+ Iterator it = getSelectedObjects().iterator();
+ while (it.hasNext() && !res) {
+ Object firstElement = it.next();
+ Object obj = null;
+ if (firstElement instanceof OrmEditPart) {
+ obj = ((OrmEditPart)firstElement).getModel();
+ } else if (firstElement instanceof AbstractTreeEditPart) {
+ obj = ((AbstractTreeEditPart)firstElement).getModel();
+ }
+ if (null != obj && obj instanceof ExpandableShape) {
+ res = true;
+ }
+ }
+ return res;
+ }
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleShapeVisibleStateAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleShapeVisibleStateAction.java 2009-09-17 16:41:17 UTC (rev 17639)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleShapeVisibleStateAction.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -15,10 +15,9 @@
import java.util.List;
import org.eclipse.gef.editparts.AbstractTreeEditPart;
+import org.eclipse.gef.ui.actions.SelectionAction;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Table;
import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
@@ -31,13 +30,13 @@
*
* @author Vitali Yemialyanchyk
*/
-public class ToggleShapeVisibleStateAction extends DiagramBaseAction {
+public class ToggleShapeVisibleStateAction extends SelectionAction {
public static final String ACTION_ID = "toggleShapeVisibleStateId"; //$NON-NLS-1$
public static final ImageDescriptor img =
ImageDescriptor.createFromFile(DiagramViewer.class, "icons/toggleshapevisiblestate.png"); //$NON-NLS-1$
- public ToggleShapeVisibleStateAction(DiagramViewer editor) {
+ public ToggleShapeVisibleStateAction(IWorkbenchPart editor) {
super(editor);
setId(ACTION_ID);
setText(DiagramViewerMessages.ToggleShapeVisibleStateAction_toggle_visible_state);
@@ -47,26 +46,22 @@
@SuppressWarnings("unchecked")
public void run() {
- ISelection selection = getDiagramViewer().getEditPartViewer().getSelection();
- if (!(selection instanceof StructuredSelection)) {
+ if (getSelectedObjects().isEmpty()) {
return;
}
List<OrmShape> selectedShape = new ArrayList<OrmShape>();
- IStructuredSelection structedSelection = (IStructuredSelection)selection;
- if (structedSelection != null) {
- Iterator it = structedSelection.iterator();
- while (it.hasNext()) {
- Object firstElement = it.next();
- Object obj = null;
- if (firstElement instanceof OrmEditPart) {
- obj = ((OrmEditPart)firstElement).getModel();
- } else if (firstElement instanceof AbstractTreeEditPart) {
- obj = ((AbstractTreeEditPart)firstElement).getModel();
- }
- if (null != obj && obj instanceof OrmShape) {
- selectedShape.add((OrmShape)obj);
- }
+ Iterator it = getSelectedObjects().iterator();
+ while (it.hasNext()) {
+ Object firstElement = it.next();
+ Object obj = null;
+ if (firstElement instanceof OrmEditPart) {
+ obj = ((OrmEditPart)firstElement).getModel();
+ } else if (firstElement instanceof AbstractTreeEditPart) {
+ obj = ((AbstractTreeEditPart)firstElement).getModel();
}
+ if (null != obj && obj instanceof OrmShape) {
+ selectedShape.add((OrmShape)obj);
+ }
}
for (OrmShape shape : selectedShape) {
Object ormElement = shape.getOrmElement();
@@ -75,4 +70,34 @@
}
}
}
+
+ @Override
+ protected boolean calculateEnabled() {
+ return canPerformAction();
+ }
+
+ @SuppressWarnings("unchecked")
+ private boolean canPerformAction() {
+ boolean res = false;
+ if (getSelectedObjects().isEmpty()) {
+ return res;
+ }
+ Iterator it = getSelectedObjects().iterator();
+ while (it.hasNext() && !res) {
+ Object firstElement = it.next();
+ Object obj = null;
+ if (firstElement instanceof OrmEditPart) {
+ obj = ((OrmEditPart)firstElement).getModel();
+ } else if (firstElement instanceof AbstractTreeEditPart) {
+ obj = ((AbstractTreeEditPart)firstElement).getModel();
+ }
+ if (null != obj && obj instanceof OrmShape) {
+ Object ormElement = ((OrmShape)obj).getOrmElement();
+ if (ormElement instanceof PersistentClass || ormElement instanceof Table) {
+ res = true;
+ }
+ }
+ }
+ return res;
+ }
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/autolayout.png
===================================================================
(Binary files differ)
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleassociation.png
===================================================================
(Binary files differ)
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleassociation.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleclassmapping.png
===================================================================
(Binary files differ)
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleclassmapping.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleconnections.png
===================================================================
(Binary files differ)
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleforeignkeyconstraint.png
===================================================================
(Binary files differ)
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleforeignkeyconstraint.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/togglepropertymapping.png
===================================================================
(Binary files differ)
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/togglepropertymapping.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleshapeexpandstate.png
===================================================================
(Binary files differ)
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleshapeexpandstate2.png
===================================================================
(Binary files differ)
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleshapeexpandstate2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/icons/toggleshapevisiblestate.png
===================================================================
(Binary files differ)
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Connection.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Connection.java 2009-09-17 16:41:17 UTC (rev 17639)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Connection.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -13,12 +13,20 @@
/**
* Directed connection between 2 shapes, from source to target.
*
- * @author some modifications from Vitali
+ * @author ?
+ * @author Vitali Yemialyanchyk
*/
public class Connection extends BaseElement {
protected Shape source;
protected Shape target;
+
+ public enum ConnectionType {
+ ClassMapping,
+ PropertyMapping,
+ Association,
+ ForeignKeyConstraint,
+ };
/**
* flag to prevent cycle call of updateVisibleValue()
@@ -42,6 +50,20 @@
public Shape getTarget() {
return target;
}
+
+ public ConnectionType getConnectionType() {
+ if ((source instanceof OrmShape) && (target instanceof OrmShape)) {
+ return ConnectionType.ClassMapping;
+ }
+ if ((source instanceof OrmShape) || (target instanceof OrmShape)) {
+ return ConnectionType.Association;
+ }
+ // TODO: what is ForeignKeyConstraint?
+ //if ( ??? ) {
+ // return ConnectionType.ForeignKeyConstraint;
+ //}
+ return ConnectionType.PropertyMapping;
+ }
/**
* It has no children, so not possible to add.
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java 2009-09-17 16:41:17 UTC (rev 17639)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -39,6 +39,7 @@
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.mapping.RootClass;
import org.jboss.tools.hibernate.ui.diagram.UiPlugin;
+import org.jboss.tools.hibernate.ui.diagram.editors.model.Connection.ConnectionType;
import org.jboss.tools.hibernate.ui.diagram.rulers.DiagramRuler;
import org.jboss.tools.hibernate.ui.view.OrmLabelProvider;
@@ -62,7 +63,10 @@
private HashMap<String, OrmShape> elements = new HashMap<String, OrmShape>();
private RootClass[] ormElements;
private String[] entityNames;
- private boolean connectionsVisibility = true;
+ private boolean connectionsVisibilityClassMapping = true;
+ private boolean connectionsVisibilityPropertyMapping = true;
+ private boolean connectionsVisibilityAssociation = true;
+ private boolean connectionsVisibilityForeignKeyConstraint = true;
private ArrayList<Connection> connections = new ArrayList<Connection>();
// editor elements settings
@@ -315,27 +319,74 @@
firePropertyChange(AUTOLAYOUT, null, null);
}
- public boolean getConnectionsVisibility() {
- return connectionsVisibility;
+ public boolean getConnectionsVisibilityAssociation() {
+ return connectionsVisibilityAssociation;
}
- public void setConnectionsVisibility(boolean connectionsVisibility) {
- if (this.connectionsVisibility == connectionsVisibility) {
+ public void setConnectionsVisibilityAssociation(boolean connectionsVisibilityAssociation) {
+ if (this.connectionsVisibilityAssociation == connectionsVisibilityAssociation) {
return;
}
- this.connectionsVisibility = connectionsVisibility;
+ this.connectionsVisibilityAssociation = connectionsVisibilityAssociation;
for (Connection connection : connections) {
- if (!(connection.getSource() instanceof OrmShape) ||
- !(connection.getTarget() instanceof OrmShape)) {
- connection.setVisible(connectionsVisibility);
+ ConnectionType ct = connection.getConnectionType();
+ if (ct == ConnectionType.Association) {
+ connection.setVisible(connectionsVisibilityAssociation);
}
}
}
- public void toggleConnections() {
- setConnectionsVisibility(!getConnectionsVisibility());
+ public boolean getConnectionsVisibilityClassMapping() {
+ return connectionsVisibilityClassMapping;
}
+ public void setConnectionsVisibilityClassMapping(boolean connectionsVisibilityClassMapping) {
+ if (this.connectionsVisibilityClassMapping == connectionsVisibilityClassMapping) {
+ return;
+ }
+ this.connectionsVisibilityClassMapping = connectionsVisibilityClassMapping;
+ for (Connection connection : connections) {
+ ConnectionType ct = connection.getConnectionType();
+ if (ct == ConnectionType.ClassMapping) {
+ connection.setVisible(connectionsVisibilityClassMapping);
+ }
+ }
+ }
+
+ public boolean getConnectionsVisibilityForeignKeyConstraint() {
+ return connectionsVisibilityForeignKeyConstraint;
+ }
+
+ public void setConnectionsVisibilityForeignKeyConstraint(boolean connectionsVisibilityForeignKeyConstraint) {
+ if (this.connectionsVisibilityForeignKeyConstraint == connectionsVisibilityForeignKeyConstraint) {
+ return;
+ }
+ this.connectionsVisibilityForeignKeyConstraint = connectionsVisibilityForeignKeyConstraint;
+ for (Connection connection : connections) {
+ ConnectionType ct = connection.getConnectionType();
+ if (ct == ConnectionType.ForeignKeyConstraint) {
+ connection.setVisible(connectionsVisibilityForeignKeyConstraint);
+ }
+ }
+ }
+
+ public boolean getConnectionsVisibilityPropertyMapping() {
+ return connectionsVisibilityPropertyMapping;
+ }
+
+ public void setConnectionsVisibilityPropertyMapping(boolean connectionsVisibilityPropertyMapping) {
+ if (this.connectionsVisibilityPropertyMapping == connectionsVisibilityPropertyMapping) {
+ return;
+ }
+ this.connectionsVisibilityPropertyMapping = connectionsVisibilityPropertyMapping;
+ for (Connection connection : connections) {
+ ConnectionType ct = connection.getConnectionType();
+ if (ct == ConnectionType.PropertyMapping) {
+ connection.setVisible(connectionsVisibilityPropertyMapping);
+ }
+ }
+ }
+
@Override
protected void loadFromProperties(Properties properties) {
super.loadFromProperties(properties);
@@ -349,6 +400,14 @@
zoom = Double.valueOf(str).doubleValue();
str = properties.getProperty("deepIntoSort", "false"); //$NON-NLS-1$ //$NON-NLS-2$
deepIntoSort = Boolean.valueOf(str).booleanValue();
+ str = properties.getProperty("connectionsVisibilityAssociation", "true"); //$NON-NLS-1$ //$NON-NLS-2$
+ connectionsVisibilityAssociation = Boolean.valueOf(str).booleanValue();
+ str = properties.getProperty("connectionsVisibilityClassMapping", "true"); //$NON-NLS-1$ //$NON-NLS-2$
+ connectionsVisibilityClassMapping = Boolean.valueOf(str).booleanValue();
+ str = properties.getProperty("connectionsVisibilityForeignKeyConstraint", "true"); //$NON-NLS-1$ //$NON-NLS-2$
+ connectionsVisibilityForeignKeyConstraint = Boolean.valueOf(str).booleanValue();
+ str = properties.getProperty("connectionsVisibilityPropertyMapping", "true"); //$NON-NLS-1$ //$NON-NLS-2$
+ connectionsVisibilityPropertyMapping = Boolean.valueOf(str).booleanValue();
}
@Override
@@ -358,6 +417,10 @@
properties.put("gridEnabled", "" + gridEnabled); //$NON-NLS-1$ //$NON-NLS-2$
properties.put("zoom", "" + zoom); //$NON-NLS-1$ //$NON-NLS-2$
properties.put("deepIntoSort", "" + deepIntoSort); //$NON-NLS-1$ //$NON-NLS-2$
+ properties.put("connectionsVisibilityAssociation", "" + connectionsVisibilityAssociation); //$NON-NLS-1$ //$NON-NLS-2$
+ properties.put("connectionsVisibilityClassMapping", "" + connectionsVisibilityClassMapping); //$NON-NLS-1$ //$NON-NLS-2$
+ properties.put("connectionsVisibilityForeignKeyConstraint", "" + connectionsVisibilityForeignKeyConstraint); //$NON-NLS-1$ //$NON-NLS-2$
+ properties.put("connectionsVisibilityPropertyMapping", "" + connectionsVisibilityPropertyMapping); //$NON-NLS-1$ //$NON-NLS-2$
super.saveInProperties(properties);
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Shape.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Shape.java 2009-09-17 16:41:17 UTC (rev 17639)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Shape.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -20,6 +20,7 @@
import org.hibernate.mapping.Component;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.Value;
+import org.jboss.tools.hibernate.ui.diagram.editors.model.Connection.ConnectionType;
import org.jboss.tools.hibernate.ui.view.HibernateUtils;
/**
@@ -171,10 +172,42 @@
super.updateVisibleValue(initState);
// update connections visibility state
for (Connection connection : sourceConnections) {
- connection.updateVisibleValue(getOrmDiagram().getConnectionsVisibility());
+ boolean state = true;
+ ConnectionType ct = connection.getConnectionType();
+ switch (ct) {
+ case ClassMapping:
+ state = getOrmDiagram().getConnectionsVisibilityClassMapping();
+ break;
+ case PropertyMapping:
+ state = getOrmDiagram().getConnectionsVisibilityPropertyMapping();
+ break;
+ case Association:
+ state = getOrmDiagram().getConnectionsVisibilityAssociation();
+ break;
+ case ForeignKeyConstraint:
+ state = getOrmDiagram().getConnectionsVisibilityForeignKeyConstraint();
+ break;
+ }
+ connection.updateVisibleValue(state);
}
for (Connection connection : targetConnections) {
- connection.updateVisibleValue(getOrmDiagram().getConnectionsVisibility());
+ boolean state = true;
+ ConnectionType ct = connection.getConnectionType();
+ switch (ct) {
+ case ClassMapping:
+ state = getOrmDiagram().getConnectionsVisibilityClassMapping();
+ break;
+ case PropertyMapping:
+ state = getOrmDiagram().getConnectionsVisibilityPropertyMapping();
+ break;
+ case Association:
+ state = getOrmDiagram().getConnectionsVisibilityAssociation();
+ break;
+ case ForeignKeyConstraint:
+ state = getOrmDiagram().getConnectionsVisibilityForeignKeyConstraint();
+ break;
+ }
+ connection.updateVisibleValue(state);
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/popup/PopupMenuProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/popup/PopupMenuProvider.java 2009-09-17 16:41:17 UTC (rev 17639)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/popup/PopupMenuProvider.java 2009-09-17 17:18:22 UTC (rev 17640)
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2007-2009 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2007-2009 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.tools.hibernate.ui.diagram.editors.popup;
@@ -41,13 +41,16 @@
import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleConnectionsAction;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleShapeExpandStateAction;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleShapeVisibleStateAction;
+import org.jboss.tools.hibernate.ui.diagram.editors.model.ExpandableShape;
+import org.jboss.tools.hibernate.ui.diagram.editors.model.OrmShape;
import org.jboss.tools.hibernate.ui.diagram.editors.model.Shape;
import org.jboss.tools.hibernate.ui.diagram.editors.parts.OrmEditPart;
/**
* Context menu provider for Diagram Viewer and Diagram Outline.
*
- * @author some modifications from Vitali
+ * @author ?
+ * @author Vitali Yemialyanchyk
*/
public class PopupMenuProvider extends ContextMenuProvider {
private ActionRegistry actionRegistry;
@@ -94,9 +97,10 @@
createMenuItem(getMenu(), action);
}
}
- boolean addToggleMenu = false;
+ boolean addToggleVisibleStateMenu = false;
+ boolean addToggleExpandStateMenu = false;
Iterator it = selection.iterator();
- while (it.hasNext() && !addToggleMenu) {
+ while (it.hasNext() && (!addToggleVisibleStateMenu || !addToggleExpandStateMenu)) {
Object element = it.next();
Object obj = null;
if (element instanceof OrmEditPart) {
@@ -104,19 +108,23 @@
} else if (element instanceof AbstractTreeEditPart) {
obj = ((AbstractTreeEditPart)element).getModel();
}
- if (null != obj && obj instanceof Shape) {
+ if (null != obj && obj instanceof OrmShape) {
selectedShape = (Shape)obj;
Object first = selectedShape.getOrmElement();
if (first instanceof PersistentClass || first instanceof Table) {
- addToggleMenu = true;
+ addToggleVisibleStateMenu = true;
}
+ }
+ if (null != obj && obj instanceof ExpandableShape) {
+ addToggleExpandStateMenu = true;
}
}
- if (addToggleMenu) {
+ if (addToggleVisibleStateMenu) {
action = getActionRegistry().getAction(ToggleShapeVisibleStateAction.ACTION_ID);
appendToGroup(GEFActionConstants.GROUP_EDIT, action);
createMenuItem(getMenu(), action);
-
+ }
+ if (addToggleExpandStateMenu) {
action = getActionRegistry().getAction(ToggleShapeExpandStateAction.ACTION_ID);
appendToGroup(GEFActionConstants.GROUP_EDIT, action);
createMenuItem(getMenu(), action);
15 years, 4 months
JBoss Tools SVN: r17639 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-09-17 12:41:17 -0400 (Thu, 17 Sep 2009)
New Revision: 17639
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java
Log:
JBIDE-4860: Improve/refactor JBT EL resolvers.
JavaElements are set for the segments
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java 2009-09-17 15:48:54 UTC (rev 17638)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/AbstractELCompletionEngine.java 2009-09-17 16:41:17 UTC (rev 17639)
@@ -488,7 +488,8 @@
proposal.setContextInfo(attachedJavaDoc);
proposals.add(proposal);
}
- segment.setMemberInfo(bijectedAttribute!=null?bijectedAttribute:getMemberInfoByVariable(var, true));
+ segment.setMemberInfo(bijectedAttribute!=null?bijectedAttribute:member);
+ segment.setElement(bijectedAttribute!=null?bijectedAttribute.getJavaElement():member!=null?member.getJavaElement():null);
segment.getVariables().add(var);
}
// <<<=== JBIDE-512, JBIDE-2541 related changes
@@ -507,6 +508,7 @@
if (member != null && !members.contains(member)) {
members.add(member);
segment.setMemberInfo(member);
+ segment.setElement(member.getJavaElement());
segment.getVariables().add(var);
segment.setResolved(true);
}
@@ -532,7 +534,8 @@
members = resolveSegment(left, members, resolution, returnEqualedVariablesOnly, varIsUsed, segment);
}
if(!members.isEmpty()) {
- segment.setMemberInfo(members.get(0));
+ segment.setMemberInfo(members.get(0)); // TODO: This is a buggy way to select a member to setup in a segment
+ segment.setElement(members.get(0).getJavaElement());
}
resolution.addSegment(segment);
} else { // Last segment
@@ -773,6 +776,7 @@
proposalsToFilter.addAll(infos.getMethodPresentations());
proposalsToFilter.addAll(infos.getPropertyPresentations(segment.getUnpairedGettersOrSetters()));
segment.setMemberInfo(mbr);
+ segment.setElement(mbr!=null?mbr.getJavaElement():null);
}
for (TypeInfoCollector.MemberPresentation proposal : proposalsToFilter) {
// We do expect nothing but name for method tokens (No round brackets)
@@ -789,6 +793,7 @@
kbProposals.add(kbProposal);
segment.setMemberInfo(proposal.getMember());
+ segment.setElement(proposal.getMember()!=null?proposal.getMember().getJavaElement():null);
if(segment.getUnpairedGettersOrSetters()!=null) {
TypeInfoCollector.MethodInfo unpirMethod = segment.getUnpairedGettersOrSetters().get(filter);
segment.clearUnpairedGettersOrSetters();
@@ -850,6 +855,7 @@
WebKbPlugin.getDefault().logError(jme);
}
segment.setMemberInfo(mbr);
+ segment.setElement(mbr!=null?mbr.getJavaElement():null);
}
String filter = expr.getMemberName();
@@ -882,6 +888,7 @@
kbProposals.add(kbProposal);
segment.setMemberInfo(proposal.getMember());
+ segment.setElement(proposal.getMember()!=null?proposal.getMember().getJavaElement():null);
if(segment.getUnpairedGettersOrSetters()!=null) {
TypeInfoCollector.MethodInfo unpirMethod = segment.getUnpairedGettersOrSetters().get(filter);
segment.clearUnpairedGettersOrSetters();
15 years, 4 months
JBoss Tools SVN: r17638 - trunk/jsf/docs/userguide/en/images/visual_page.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-09-17 11:48:54 -0400 (Thu, 17 Sep 2009)
New Revision: 17638
Modified:
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_23a.png
Log:
JBDS-787 - screenshot adjusted
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_23a.png
===================================================================
(Binary files differ)
15 years, 4 months
JBoss Tools SVN: r17637 - trunk/jsf/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-09-17 11:43:17 -0400 (Thu, 17 Sep 2009)
New Revision: 17637
Modified:
trunk/jsf/docs/userguide/en/modules/css_perspective.xml
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-864 - Updated the CSS Perspective chapter with the info about supporting editing style sheets being inserted in any of possible places.</p>
</body></html>
Modified: trunk/jsf/docs/userguide/en/modules/css_perspective.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/css_perspective.xml 2009-09-17 15:42:04 UTC (rev 17636)
+++ trunk/jsf/docs/userguide/en/modules/css_perspective.xml 2009-09-17 15:43:17 UTC (rev 17637)
@@ -13,10 +13,21 @@
your css files,edit them and see the results.
To use this perspective you need to choose <emphasis><property>Window >Open Perspective> CSS Editing </property></emphasis>
.All of the views are fully synchronized with each other:the changes being made in one view are reflected in othes at once.</para>
- <para>In CSS Editing Perspective you can change your css file in three ways:</para>
+ <para>As you know, there are three ways of inserting a style sheet:
+ </para>
<itemizedlist>
+ <listitem><para>External style sheet (.css file)</para>
+ </listitem>
+ <listitem><para>Internal style sheet (using the <emphasis><property><style></property></emphasis> tag in the head section of an HTML/XHTML/JSP page)</para>
+ </listitem>
+ <listitem><para>Inline style (using style attribute)</para>
+ </listitem>
+ </itemizedlist>
+ <para>Using CSS Editing Perspective you can change your style sheet,
+ inserted in any of the possible places described before, in three ways:</para>
+ <itemizedlist>
<listitem>
- <para>directly in your CSS Editor
+ <para>directly in your Editor
</para>
</listitem>
<listitem>
15 years, 4 months
JBoss Tools SVN: r17636 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-09-17 11:42:04 -0400 (Thu, 17 Sep 2009)
New Revision: 17636
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibconfig3.meta
Log:
https://jira.jboss.org/jira/browse/JBIDE-2607
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibconfig3.meta
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibconfig3.meta 2009-09-17 14:57:48 UTC (rev 17635)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibconfig3.meta 2009-09-17 15:42:04 UTC (rev 17636)
@@ -942,17 +942,47 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute
- PROPERTIES="category=general;h_property=hibernate.c3p0.acquire_increment" name="acquire increment"/>
+ PROPERTIES="category=general;h_property=hibernate.c3p0.acquire_increment" name="acquire increment">
+ <Constraint loader="Int">
+ <value name="mandatory=false"/>
+ </Constraint>
+ <Editor name="Int"/>
+ </XModelAttribute>
<XModelAttribute
- PROPERTIES="category=general;h_property=hibernate.c3p0.idle_test_period" name="idle test period"/>
+ PROPERTIES="category=general;h_property=hibernate.c3p0.idle_test_period" name="idle test period">
+ <Constraint loader="Int">
+ <value name="mandatory=false"/>
+ </Constraint>
+ <Editor name="Int"/>
+ </XModelAttribute>
<XModelAttribute
- PROPERTIES="category=general;h_property=hibernate.c3p0.max_size" name="max size"/>
+ PROPERTIES="category=general;h_property=hibernate.c3p0.max_size" name="max size">
+ <Constraint loader="Int">
+ <value name="mandatory=false"/>
+ </Constraint>
+ <Editor name="Int"/>
+ </XModelAttribute>
<XModelAttribute
- PROPERTIES="category=general;h_property=hibernate.c3p0.max_statements" name="max statements"/>
+ PROPERTIES="category=general;h_property=hibernate.c3p0.max_statements" name="max statements">
+ <Constraint loader="Int">
+ <value name="mandatory=false"/>
+ </Constraint>
+ <Editor name="Int"/>
+ </XModelAttribute>
<XModelAttribute
- PROPERTIES="category=general;h_property=hibernate.c3p0.min_size" name="min size"/>
+ PROPERTIES="category=general;h_property=hibernate.c3p0.min_size" name="min size">
+ <Constraint loader="Int">
+ <value name="mandatory=false"/>
+ </Constraint>
+ <Editor name="Int"/>
+ </XModelAttribute>
<XModelAttribute
- PROPERTIES="category=general;h_property=hibernate.c3p0.timeout" name="timeout"/>
+ PROPERTIES="category=general;h_property=hibernate.c3p0.timeout" name="timeout">
+ <Constraint loader="Int">
+ <value name="mandatory=false"/>
+ </Constraint>
+ <Editor name="Int"/>
+ </XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
<XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions"/>
@@ -987,40 +1017,16 @@
PROPERTIES="category=general;h_property=hibernate.cache.jndi" name="jndi"/>
<XModelAttribute
PROPERTIES="category=general;h_property=hibernate.cache.provider_class" name="provider class">
- <Constraint loader="List">
- <value/>
- <value name="true"/>
- <value name="false"/>
- </Constraint>
<Editor name="AccessibleJava"/>
</XModelAttribute>
<XModelAttribute
- PROPERTIES="category=general;h_property=hibernate.cache.provider_configuration_file_resource_path" name="provider configuration file">
- <Constraint loader="List">
- <value/>
- <value name="true"/>
- <value name="false"/>
- </Constraint>
- <Editor name="AccessibleJava"/>
- </XModelAttribute>
+ PROPERTIES="category=general;h_property=hibernate.cache.provider_configuration_file_resource_path" name="provider configuration file"/>
<XModelAttribute
PROPERTIES="category=general;h_property=hibernate.cache.query_cache_factory" name="query cache factory">
- <Constraint loader="List">
- <value/>
- <value name="true"/>
- <value name="false"/>
- </Constraint>
<Editor name="AccessibleJava"/>
</XModelAttribute>
<XModelAttribute
- PROPERTIES="category=general;h_property=hibernate.cache.region_prefix" name="region prefix">
- <Constraint loader="List">
- <value/>
- <value name="true"/>
- <value name="false"/>
- </Constraint>
- <Editor name="AccessibleJava"/>
- </XModelAttribute>
+ PROPERTIES="category=general;h_property=hibernate.cache.region_prefix" name="region prefix"/>
<XModelAttribute
PROPERTIES="category=general;h_property=hibernate.cache.use_minimal_puts" name="use minimal puts">
<Constraint loader="List">
@@ -1221,6 +1227,85 @@
</Constraint>
<Editor name="List"/>
</XModelAttribute>
+ <XModelAttribute
+ PROPERTIES="category=general;h_property=hibernate.default_batch_fetch_size" name="default batch fetch size">
+ <Constraint loader="Int">
+ <value name="mandatory=false"/>
+ </Constraint>
+ <Editor name="Int"/>
+ </XModelAttribute>
+ <XModelAttribute
+ PROPERTIES="category=general;h_property=hibernate.default_catalog" name="default catalog"/>
+ <XModelAttribute
+ PROPERTIES="category=general;h_property=hibernate.default_entity_mode" name="default entity mode">
+ <Constraint loader="List">
+ <value/>
+ <value name="dynamic-map"/>
+ <value name="dom4j"/>
+ <value name="pojo"/>
+ </Constraint>
+ <Editor name="List"/>
+ </XModelAttribute>
+ <XModelAttribute
+ PROPERTIES="category=general;h_property=hibernate.default_schema" name="default schema"/>
+ <XModelAttribute
+ PROPERTIES="category=general;h_property=hibernate.current_session_context_class" name="current session context class"/>
+ <XModelAttribute
+ PROPERTIES="category=general;h_property=hibernate.generate_statistics" name="generate statistics">
+ <Constraint loader="List">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="List"/>
+ </XModelAttribute>
+ <XModelAttribute
+ PROPERTIES="category=general;h_property=hibernate.hbm2ddl.auto" name="hbm2ddl auto">
+ <Constraint loader="List">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="List"/>
+ </XModelAttribute>
+ <XModelAttribute
+ PROPERTIES="category=general;h_property=hibernate.jacc_context_id" name="jacc context id"/>
+ <XModelAttribute
+ PROPERTIES="category=general;h_property=hibernate.max_fetch_depth" name="max fetch depth">
+ <Constraint loader="Int">
+ <value name="mandatory=false"/>
+ </Constraint>
+ <Editor name="Int"/>
+ </XModelAttribute>
+ <XModelAttribute
+ PROPERTIES="category=general;h_property=hibernate.order_inserts" name="order inserts">
+ <Constraint loader="List">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="List"/>
+ </XModelAttribute>
+ <XModelAttribute
+ PROPERTIES="category=general;h_property=hibernate.order_updates" name="order updates">
+ <Constraint loader="List">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="List"/>
+ </XModelAttribute>
+ <XModelAttribute
+ PROPERTIES="category=general;h_property=hibernate.session_factory_name" name="session factory name"/>
+ <XModelAttribute
+ PROPERTIES="category=general;h_property=hibernate.use_identifier_rollback" name="use identifier rollback">
+ <Constraint loader="List">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="List"/>
+ </XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
<XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions"/>
15 years, 4 months
JBoss Tools SVN: r17635 - in trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp: jspeditor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-09-17 10:57:48 -0400 (Thu, 17 Sep 2009)
New Revision: 17635
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AutoContentAssistantProposal.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
Log:
JBIDE-512 context variable code completion dropdown should show their "source"
JBIDE-2541 Show java-doc for EL content assist item
The values of type, sourceType and JavaDoc are gathered to be displayed in CA
CA shows proposals for EL in a Java-like manner
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AutoContentAssistantProposal.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AutoContentAssistantProposal.java 2009-09-17 14:37:38 UTC (rev 17634)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AutoContentAssistantProposal.java 2009-09-17 14:57:48 UTC (rev 17635)
@@ -12,8 +12,10 @@
import org.eclipse.jface.text.ITextOperationTarget;
import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposalExtension6;
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.viewers.StyledString;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
@@ -22,8 +24,10 @@
/**
* @author Igels
*/
-public class AutoContentAssistantProposal extends CustomCompletionProposal {
+public class AutoContentAssistantProposal extends CustomCompletionProposal implements ICompletionProposalExtension6
+{
+
private boolean autoContentAssistant = false;
public AutoContentAssistantProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo) {
@@ -72,4 +76,55 @@
}
return cursorPosition>-1?cursorPosition:super.getCursorPosition();
}
+
+
+ StyledString fStyledDisplayString;
+
+ public String getDisplayString() {
+ if (super.getDisplayString() != null)
+ return super.getDisplayString();
+ else {
+ if (super.getReplacementString() != null) {
+ setDisplayString(super.getReplacementString());
+ return super.getDisplayString();
+ }
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ public void setDisplayString(String string) {
+ super.setDisplayString(string);
+
+ boolean isJavaWordPart = string.length() > 0 && Character.isJavaIdentifierPart(string.charAt(0));
+ boolean hasRetType = isJavaWordPart && string.indexOf(':') > 0;
+ boolean hasDeclType = isJavaWordPart && string.lastIndexOf('-') > 0;
+
+ int p1i = string.indexOf(':');
+ int p2i = string.lastIndexOf('-');
+
+ String p1 = hasRetType && hasDeclType ? string.substring(0, p2i) : string;
+ String p2 = string.substring(p1.length());
+
+ StyledString styledString = new StyledString();
+
+ // name, attrs, type
+ styledString.append(p1);
+
+ // decl type
+ if (p2 != null && p2.length() > 0)
+ styledString.append(p2, StyledString.QUALIFIER_STYLER);
+ fStyledDisplayString = styledString;
+ }
+
+ public StyledString getStyledDisplayString() {
+ if (fStyledDisplayString == null) {
+ setDisplayString(super.getDisplayString()); // This re-creates Styled Display String
+ }
+ return fStyledDisplayString;
+ }
+
+ public void setStyledDisplayString(StyledString text) {
+ fStyledDisplayString = text;
+ super.setDisplayString(fStyledDisplayString == null ? "" : fStyledDisplayString.getString());
+ }
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2009-09-17 14:37:38 UTC (rev 17634)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2009-09-17 14:57:48 UTC (rev 17635)
@@ -27,6 +27,8 @@
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.TextEvent;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
import org.eclipse.jface.text.formatter.IContentFormatter;
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
import org.eclipse.jface.text.source.IAnnotationModel;
@@ -411,6 +413,10 @@
IVerticalRuler ruler, int styles) {
ISourceViewer sv = super.createSourceViewer(parent, ruler, styles);
sv.getTextWidget().addFocusListener(new TextFocusListener());
+ IContentAssistant ca = getSourceViewerConfiguration().getContentAssistant(sv);
+ if (ca instanceof ContentAssistant) {
+ ((ContentAssistant)ca).enableColoredLabels(true);
+ }
return sv;
}
15 years, 4 months
JBoss Tools SVN: r17634 - in trunk: seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-09-17 10:37:38 -0400 (Thu, 17 Sep 2009)
New Revision: 17634
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamELReferencesQueryParticipant.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4771
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java 2009-09-17 13:59:09 UTC (rev 17633)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java 2009-09-17 14:37:38 UTC (rev 17634)
@@ -36,15 +36,22 @@
* @see org.jboss.tools.common.el.core.resolver.ELResolution#findSegmentsByJavaElement(org.eclipse.jdt.core.IJavaElement)
*/
public List<ELSegment> findSegmentsByJavaElement(IJavaElement element) {
- // TODO
- return null;
+ ArrayList<ELSegment> list = new ArrayList<ELSegment>();
+ for(ELSegment segment : segments){
+ if(segment instanceof JavaMemberELSegment && ((JavaMemberELSegment)segment).getJavaElement().equals(element))
+ list.add(segment);
+ }
+ return list;
}
/* (non-Javadoc)
* @see org.jboss.tools.common.el.core.resolver.ELResolution#findSegmentByOffset(int)
*/
- public ELSegment findSegmentByOffset(int offcet) {
- // TODO
+ public ELSegment findSegmentByOffset(int offset) {
+ for(ELSegment segment : segments){
+ if(segment.getSourceReference() != null && segment.getSourceReference().getStartPosition() == offset)
+ return segment;
+ }
return null;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java 2009-09-17 13:59:09 UTC (rev 17633)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java 2009-09-17 14:37:38 UTC (rev 17634)
@@ -11,6 +11,7 @@
package org.jboss.tools.seam.internal.core.refactoring;
import java.io.IOException;
+import java.util.List;
import java.util.StringTokenizer;
import org.eclipse.core.resources.IContainer;
@@ -19,6 +20,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
import org.eclipse.jdt.ui.text.IJavaPartitions;
@@ -36,6 +38,7 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.jboss.tools.common.el.core.model.ELExpression;
import org.jboss.tools.common.el.core.model.ELInstance;
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.model.ELMethodInvocation;
@@ -43,6 +46,15 @@
import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
import org.jboss.tools.common.el.core.parser.ELParser;
import org.jboss.tools.common.el.core.parser.ELParserUtil;
+import org.jboss.tools.common.el.core.resolver.ELCompletionEngine;
+import org.jboss.tools.common.el.core.resolver.ELResolution;
+import org.jboss.tools.common.el.core.resolver.ELResolver;
+import org.jboss.tools.common.el.core.resolver.ELResolverFactoryManager;
+import org.jboss.tools.common.el.core.resolver.ELSegment;
+import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.el.core.resolver.JavaMemberELSegment;
+import org.jboss.tools.common.el.core.resolver.SimpleELContext;
+import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -66,11 +78,17 @@
protected IFile baseFile;
protected String propertyName;
+ protected IJavaElement javaElement;
public SeamRefactorSearcher(IFile baseFile, String propertyName){
this.baseFile = baseFile;
this.propertyName = propertyName;
}
+
+ public SeamRefactorSearcher(IFile baseFile, String propertyName, IJavaElement javaElement){
+ this(baseFile, propertyName);
+ this.javaElement = javaElement;
+ }
public void findELReferences(){
if(baseFile == null)
@@ -253,10 +271,10 @@
if(expression != null){
if(expression instanceof ELPropertyInvocation){
ELPropertyInvocation pi = (ELPropertyInvocation)expression;
- match(file, offset+pi.getName().getStart(), pi.getName().getLength());
+ checkMatch(file, pi, offset+pi.getName().getStart(), pi.getName().getLength());
}else if(expression instanceof ELMethodInvocation){
ELMethodInvocation mi = (ELMethodInvocation)expression;
- match(file, offset+mi.getName().getStart(), mi.getName().getLength());
+ checkMatch(file, mi, offset+mi.getName().getStart(), mi.getName().getLength());
}
}
}
@@ -324,6 +342,13 @@
protected abstract void match(IFile file, int offset, int length);
+ private void checkMatch(IFile file, ELExpression operand, int offset, int length){
+ if(javaElement != null && operand != null)
+ resolve(file, operand, offset, length);
+ else
+ match(file, offset, length);
+ }
+
public static String getPropertyName(String methodName){
if(methodName.startsWith(GET) || methodName.startsWith(SET)){
String name = methodName.substring(3);
@@ -339,8 +364,47 @@
}
public static boolean isSetter(String methodName){
- if(methodName.startsWith(SET))
- return true;
- return false;
+ return methodName.startsWith(SET);
}
+
+ private void resolve(IFile file, ELExpression operand, int offset, int length){
+ ELResolver[] resolvers = ELResolverFactoryManager.getInstance().getResolvers(file);
+
+ for(ELResolver resolver : resolvers){
+ if(!(resolver instanceof ELCompletionEngine))
+ continue;
+
+ SimpleELContext context = new SimpleELContext();
+
+ ElVarSearcher elSearcher = new ElVarSearcher((ELCompletionEngine)resolver);
+
+ List<Var> vars = elSearcher.findAllVars(file, offset);
+
+ if(vars == null)
+ continue;
+
+ context.setVars(vars);
+ context.setResource(file);
+ context.setElResolvers(resolvers);
+
+ ELResolution resolution = resolver.resolve(context, operand);
+
+ if(resolution == null)
+ continue;
+
+ ELSegment segment = resolution.findSegmentByOffset(offset);
+
+ if(segment == null)
+ continue;
+
+ if(segment instanceof JavaMemberELSegment){
+ JavaMemberELSegment javaSegment = (JavaMemberELSegment)segment;
+ if(javaSegment.isResolved()){
+ IJavaElement segmentJavaElement = javaSegment.getJavaElement();
+ if(segmentJavaElement.equals(javaElement))
+ match(file, offset, length);
+ }
+ }
+ }
+ }
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamELReferencesQueryParticipant.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamELReferencesQueryParticipant.java 2009-09-17 13:59:09 UTC (rev 17633)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamELReferencesQueryParticipant.java 2009-09-17 14:37:38 UTC (rev 17634)
@@ -14,6 +14,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.ui.search.ElementQuerySpecification;
import org.eclipse.jdt.ui.search.IMatchPresentation;
@@ -49,7 +50,7 @@
IFile file = (IFile)qs.getElement().getResource();
String name = ELSearcher.getPropertyName(qs.getElement().getElementName());
- searcher = new ELSearcher(requestor, file, name);
+ searcher = new ELSearcher(requestor, qs.getElement(), file, name);
searcher.findELReferences();
}
@@ -66,8 +67,8 @@
class ELSearcher extends SeamRefactorSearcher{
ISearchRequestor requestor;
- public ELSearcher(ISearchRequestor requestor, IFile file, String name){
- super(file, name);
+ public ELSearcher(ISearchRequestor requestor, IJavaElement element, IFile file, String name){
+ super(file, name, element);
this.requestor = requestor;
}
15 years, 4 months