JBoss Tools SVN: r14903 - in trunk: jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-04-24 10:58:53 -0400 (Fri, 24 Apr 2009)
New Revision: 14903
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFPromptingProvider.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/correctCustomTags.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/tags/facelets.taglib.xml
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCustomTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeIncludeTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDParser.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDReference.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3197, attribute processing was added
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFPromptingProvider.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFPromptingProvider.java 2009-04-24 14:45:21 UTC (rev 14902)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFPromptingProvider.java 2009-04-24 14:58:53 UTC (rev 14903)
@@ -59,7 +59,7 @@
SUPPORTED_IDS.add(JSF_CONVERT_URL_TO_PATH);
SUPPORTED_IDS.add(JSF_GET_TAGLIBS);
}
- public final String PROVIDER_ID = "jsf";
+ public final static String PROVIDER_ID = "jsf"; //$NON-NLS-1$
public boolean isSupporting(String id) {
return id != null && SUPPORTED_IDS.contains(id);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/correctCustomTags.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/correctCustomTags.xhtml.xml 2009-04-24 14:45:21 UTC (rev 14902)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/correctCustomTags.xhtml.xml 2009-04-24 14:58:53 UTC (rev 14903)
@@ -2,7 +2,7 @@
<test id="correctCustomTags">
<DIV ID="correctCustomTags" STYLE="-moz-user-modify: read-write;" >
<!-- Test case when custom template defined -->
-<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
+<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;" >
<TABLE BORDER="0" STYLE="margin-right: auto; margin-left: auto; -moz-user-modify: read-only;">
<TBODY>
<TR>
@@ -22,7 +22,7 @@
<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;" >
<SPAN STYLE="-moz-user-modify: read-only;">
<SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
-${echo}
+Echo
</SPAN>
</SPAN>
</DIV>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/tags/facelets.taglib.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/tags/facelets.taglib.xml 2009-04-24 14:45:21 UTC (rev 14902)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/tags/facelets.taglib.xml 2009-04-24 14:58:53 UTC (rev 14903)
@@ -11,7 +11,7 @@
<tag-name>paginator</tag-name>
<source>components/paginator.xhtml</source>
</tag>
- <tag>
- <tag-name>test1</tag-name>
- </tag>
+<!-- <tag>-->
+<!-- <tag-name>test1</tag-name>-->
+<!-- </tag>-->
</facelet-taglib>
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2009-04-24 14:45:21 UTC (rev 14902)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2009-04-24 14:58:53 UTC (rev 14903)
@@ -1387,7 +1387,7 @@
return Status.OK_STATUS;
}
};
- visualRefreshJob.setRule(new GreedyRule(this));
+// visualRefreshJob.setRule(new GreedyRule(this));
visualRefreshJob.setPriority(Job.SHORT);
visualRefreshJob.schedule();
}
@@ -2664,7 +2664,7 @@
return Status.OK_STATUS;
}
};
- reinitJob.setRule(new GreedyRule(this));
+// reinitJob.setRule(new GreedyRule(this));
reinitJob.schedule();
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java 2009-04-24 14:45:21 UTC (rev 14902)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java 2009-04-24 14:58:53 UTC (rev 14903)
@@ -414,7 +414,7 @@
* <code>create</code>
* @param pageContext Contains the information on edited page.
*/
- public void validate(VpePageContext pageContext, Node sourceNode,
+ public void validate(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument, VpeCreationData data) {
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCustomTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCustomTemplate.java 2009-04-24 14:45:21 UTC (rev 14902)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCustomTemplate.java 2009-04-24 14:58:53 UTC (rev 14903)
@@ -10,19 +10,26 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.template;
+import java.util.ArrayList;
+import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.ide.IDE;
+import org.jboss.tools.common.el.core.ELReferenceList;
+import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.VpeIncludeInfo;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.custom.CustomTLDReference;
import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
/**
@@ -45,12 +52,16 @@
IPath pathToFile = CustomTLDReference
.getCustomElementPath(sourceNode, pageContext);
-
if (pathToFile != null) {
+ //add attributes to EL list
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(
+
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(
pathToFile);
if (file != null && file.exists()) {
+
+
+
if (!pageContext.getVisualBuilder().isFileInIncludeStack(
file)) {
Document document = pageContext.getVisualBuilder()
@@ -65,7 +76,8 @@
if (document != null) {
VpeCreationData creationData = createInclude(
document, visualDocument);
- creationData.setData(file);
+ ResourceReference [] oldResourceReferences = VpeCustomTemplate.addAttributesToELExcpressions(sourceNode, file);
+ creationData.setData(new TransferObject(oldResourceReferences, file));
pageContext.getVisualBuilder().pushIncludeStack(
new VpeIncludeInfo((Element) sourceNode,
file, document));
@@ -92,7 +104,46 @@
}
}
}
+
+ @Override
+ public void validate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, VpeCreationData data){
+
+ if(data.getData() instanceof TransferObject) {
+ TransferObject trObject = (TransferObject) data.getData();
+ ELReferenceList.getInstance().setAllResources(trObject.getCustomFile(), trObject.getResourceReferebces());
+ data.setData(trObject.getCustomFile());
+ }
+
+ super.validate(pageContext, sourceNode, visualDocument, data);
+ }
+
/**
+ * Temparary add to attribute for custom el expressions
+ * @param pageContext Page Context
+ * @param sourceNode source Node
+ * @param processedFile processed File
+ * @return resourceReferences - unchanged resource references
+ */
+ private static final ResourceReference[] addAttributesToELExcpressions(final Node sourceNode,
+ final IFile processedFile){
+
+ //obtain old resource references for this file
+ ResourceReference[] resourceReferences = ELReferenceList.getInstance().getAllResources(processedFile);
+ //obtain attribute resource references for file
+ NamedNodeMap attributesMap = sourceNode.getAttributes();
+ List<ResourceReference> addedAttrToElExpressions = new ArrayList<ResourceReference>();
+ for(int i=0;i<attributesMap.getLength();i++) {
+ Attr attr = (Attr) attributesMap.item(i);
+ //adds attribute if such attribute not exists for page
+ ResourceReference resRef = new ResourceReference(attr.getName(), ResourceReference.FILE_SCOPE);
+ resRef.setProperties(attr.getValue());
+ addedAttrToElExpressions.add(resRef);
+ }
+ ELReferenceList.getInstance().setAllResources(processedFile,addedAttrToElExpressions.toArray(new ResourceReference[0]));
+ return resourceReferences;
+ }
+ /**
* Looks for file to open on each editor, for open on click
* @param pageContext
* @param sourceElement
@@ -105,15 +156,60 @@
IFile file =null;
if(pathToFile!=null) {
- file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(
+ file = ResourcesPlugin.getWorkspace().getRoot().getFile(
pathToFile);
}
//if we cann't find source file, then just open tld definition file
if(file==null || !file.exists()) {
pathToFile = CustomTLDReference.getCustomTLDPath(pageContext, sourceElement);
- file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(
+ file = ResourcesPlugin.getWorkspace().getRoot().getFile(
pathToFile);
}
return file;
}
+
+ @Override
+ public void beforeRemove(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Object data) {
+ IFile file = null;
+ if(data instanceof TransferObject) {
+ file = ((TransferObject)data).getCustomFile();
+ } else if(data instanceof IFile) {
+ file = (IFile) data;
+ }
+ super.beforeRemove(pageContext, sourceNode, visualNode, file);
+ }
+
+ /**
+ * Object which used to passing argument throw template event processing,
+ * restore el expressions after processing custom template
+ *
+ * @author mareshkau
+ *
+ */
+ private class TransferObject {
+ private ResourceReference [] resourceReferebces;
+ private IFile customFile;
+
+ /**
+ * @param resourceReferebces
+ * @param customFile
+ */
+ public TransferObject(ResourceReference[] resourceReferebces,
+ IFile customFile) {
+ this.resourceReferebces = resourceReferebces;
+ this.customFile = customFile;
+ }
+ /**
+ * @return the resourceReferebces
+ */
+ public ResourceReference[] getResourceReferebces() {
+ return this.resourceReferebces;
+ }
+ /**
+ * @return the customFile
+ */
+ public IFile getCustomFile() {
+ return this.customFile;
+ }
+ };
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeIncludeTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeIncludeTemplate.java 2009-04-24 14:45:21 UTC (rev 14902)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeIncludeTemplate.java 2009-04-24 14:58:53 UTC (rev 14903)
@@ -93,6 +93,7 @@
return creationData;
}
+ @Override
public void validate(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument, VpeCreationData data) {
if (data.getData() != null) {
VpeIncludeInfo includeInfo = pageContext.getVisualBuilder().popIncludeStack();
@@ -102,16 +103,13 @@
}
}
+ @Override
public void beforeRemove(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Object data) {
IFile file = (IFile)data;
if (file != null) {
pageContext.getEditPart().getController().getIncludeList().removeIncludeModel(file);
}
}
-
- public boolean recreateAtAttrChange(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement visualNode, Object data, String name, String value) {
- return true;
- }
protected VpeCreationData createInclude(Document sourceDocument, nsIDOMDocument visualDocument) {
nsIDOMElement visualNewElement = visualDocument.createElement(HTML.TAG_DIV);
@@ -146,6 +144,7 @@
return new VpeCreationData(visualNewElement);
}
+ @Override
public void openIncludeEditor(VpePageContext pageContext, Element sourceElement, Object data) {
if (sourceElement != null && fileNameExpression != null) {
VpeValue vpeValue;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2009-04-24 14:45:21 UTC (rev 14902)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2009-04-24 14:58:53 UTC (rev 14903)
@@ -385,7 +385,7 @@
String templateTaglibPrefix = getTemplateTaglibPrefix(sourceNodeUri);
if(templateTaglibPrefix != null) {
- return templateTaglibPrefix + ":" + sourceNode.getLocalName(); //$NON-NLS-1
+ return templateTaglibPrefix + ":" + sourceNode.getLocalName(); //$NON-NLS-1$
}
return null;
default :
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDParser.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDParser.java 2009-04-24 14:45:21 UTC (rev 14902)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDParser.java 2009-04-24 14:58:53 UTC (rev 14903)
@@ -42,7 +42,7 @@
*/
public static final String getNameSpace(IPath pathToFile){
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(pathToFile);
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(pathToFile);
if(file!=null && file.exists()) {
Document document=null;
try {
@@ -71,7 +71,7 @@
* @return source value if exists or null otherwise
*/
public static final String getSourceValuetInTag(IPath pathToFile, String name){
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(pathToFile);
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(pathToFile);
Document document=null;
if(file!=null &&file.exists()) {
try{
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDReference.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDReference.java 2009-04-24 14:45:21 UTC (rev 14902)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDReference.java 2009-04-24 14:58:53 UTC (rev 14903)
@@ -15,6 +15,7 @@
import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.ui.IEditorInput;
@@ -59,7 +60,7 @@
if (customTLDData == null) {
return null;
}
- IPath pathToSourceFile = (IPath) customTLDData.getTldFilePath();
+ IPath pathToSourceFile = customTLDData.getTldFilePath();
pathToSourceFile = pathToSourceFile.removeLastSegments(1);
String sourceParamValue = CustomTLDParser.getSourceValuetInTag(
customTLDData.getTldFilePath(), sourceNode.getLocalName());
@@ -129,8 +130,13 @@
for (String faceletLib : libs) {
IPath rootPath = VpeStyleUtil
.getRootPath(iEditorInput);
+ IPath projectPath = ((IFileEditorInput)iEditorInput).getFile().getProject().getLocation();
+
IPath pathToCustonTld = new Path(faceletLib);
+
pathToCustonTld = rootPath.append(pathToCustonTld);
+ pathToCustonTld = pathToCustonTld.makeRelativeTo(projectPath);
+ pathToCustonTld = ((IFileEditorInput)iEditorInput).getFile().getProject().getFile(pathToCustonTld).getFullPath();
CustomTLDData customTLDData = new CustomTLDData(
pathToCustonTld, CustomTLDParser
.getNameSpace(pathToCustonTld));
15 years, 8 months
JBoss Tools SVN: r14902 - in trunk/hibernatetools: plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-04-24 10:45:21 -0400 (Fri, 24 Apr 2009)
New Revision: 14902
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java
Log:
JBIDE-4221
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2009-04-24 13:47:00 UTC (rev 14901)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2009-04-24 14:45:21 UTC (rev 14902)
@@ -33,7 +33,6 @@
import org.eclipse.ui.actions.SelectionListenerAction;
import org.eclipse.ui.part.MultiPageEditorPart;
import org.eclipse.ui.texteditor.ITextEditor;
-import org.hibernate.EntityMode;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
@@ -81,7 +80,7 @@
}
}
- public static void run(TreePath path, ConsoleConfiguration consoleConfiguration) throws PartInitException, JavaModelException, FileNotFoundException {
+ public static IEditorPart run(TreePath path, ConsoleConfiguration consoleConfiguration) throws PartInitException, JavaModelException, FileNotFoundException {
boolean isPropertySel = (path.getLastSegment().getClass() == Property.class);
if (isPropertySel){
Property propertySel = (Property)path.getLastSegment();
@@ -90,11 +89,10 @@
|| (RootClass.class.isAssignableFrom(persClass.getClass())
&& persClass.getClass() != RootClass.class)){
Property parentProp = (Property)path.getParentPath().getLastSegment();
- run(propertySel, parentProp, consoleConfiguration);
- return;
+ return run(propertySel, parentProp, consoleConfiguration);
}
}
- run(path.getLastSegment(), consoleConfiguration);
+ return run(path.getLastSegment(), consoleConfiguration);
}
/**
@@ -109,46 +107,51 @@
IEditorPart editorPart = null;
IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
java.io.File configXMLFile = consoleConfiguration.getPreferences().getConfigXMLFile();
- if (configXMLFile == null) return null;
- IResource resource = null;
- if (selection instanceof Property){
- Property p = (Property)selection;
- if (p.getPersistentClass() == null) return null;
- //use PersistentClass to open editor
- resource = OpenFileActionUtils.getResource(consoleConfiguration, proj, configXMLFile, p.getPersistentClass());
- //editorPart = openMapping(p.getPersistentClass(), consoleConfiguration);
- } else {
- resource = OpenFileActionUtils.getResource(consoleConfiguration, proj, configXMLFile, selection);
- //editorPart = openMapping(selection, consoleConfiguration);
- }
- if (resource != null){
- editorPart = openMapping(resource);
- if (editorPart != null){
- applySelectionToEditor(selection, editorPart);
+ if (configXMLFile != null) {
+ IResource resource = null;
+ if (selection instanceof Property) {
+ Property p = (Property)selection;
+ if (p.getPersistentClass() != null) {
+ //use PersistentClass to open editor
+ resource = OpenFileActionUtils.getResource(consoleConfiguration, proj, configXMLFile, p.getPersistentClass());
+ //editorPart = openMapping(p.getPersistentClass(), consoleConfiguration);
+ }
}
- return editorPart;
+ else {
+ resource = OpenFileActionUtils.getResource(consoleConfiguration, proj, configXMLFile, selection);
+ //editorPart = openMapping(selection, consoleConfiguration);
+ }
+ if (resource != null) {
+ editorPart = openMapping(resource);
+ if (editorPart != null){
+ applySelectionToEditor(selection, editorPart);
+ }
+ }
}
-
- //try to find hibernate-annotations
- PersistentClass rootClass = null;
- if (selection instanceof PersistentClass) {
- rootClass = (PersistentClass)selection;
- } else if (selection instanceof Property) {
- Property p = (Property)selection;
- if (p.getPersistentClass() == null) return null;
- rootClass = (PersistentClass)p.getPersistentClass();
- }
- if (rootClass != null){
- if (OpenFileActionUtils.rootClassHasAnnotations(consoleConfiguration, configXMLFile, rootClass)) {
- String fullyQualifiedName = rootClass.getClassName();
- editorPart = new OpenSourceAction().run(selection, proj, fullyQualifiedName);
- return editorPart;
+ if (editorPart == null) {
+ //try to find hibernate-annotations
+ PersistentClass rootClass = null;
+ if (selection instanceof PersistentClass) {
+ rootClass = (PersistentClass)selection;
+ }
+ else if (selection instanceof Property) {
+ Property p = (Property)selection;
+ if (p.getPersistentClass() != null) {
+ rootClass = (PersistentClass)p.getPersistentClass();
+ }
+ }
+ if (rootClass != null){
+ if (OpenFileActionUtils.rootClassHasAnnotations(consoleConfiguration, configXMLFile, rootClass)) {
+ String fullyQualifiedName = rootClass.getClassName();
+ editorPart = OpenSourceAction.run(selection, proj, fullyQualifiedName);
+ }
}
- } else {
- String out = NLS.bind(HibernateConsoleMessages.OpenMappingAction_mapping_for_not_found, selection);
- throw new FileNotFoundException(out);
+ else {
+ String out = NLS.bind(HibernateConsoleMessages.OpenMappingAction_mapping_for_not_found, selection);
+ throw new FileNotFoundException(out);
+ }
}
- return null;
+ return editorPart;
}
/**
@@ -218,7 +221,7 @@
PersistentClass rootClass = parentProperty.getPersistentClass();
if (OpenFileActionUtils.rootClassHasAnnotations(consoleConfiguration, configXMLFile, rootClass)) {
String fullyQualifiedName =((Component)((Property) parentProperty).getValue()).getComponentClassName();
- IEditorPart editor = new OpenSourceAction().run(compositeProperty, proj, fullyQualifiedName);
+ IEditorPart editor = OpenSourceAction.run(compositeProperty, proj, fullyQualifiedName);
return editor;
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java 2009-04-24 13:47:00 UTC (rev 14901)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java 2009-04-24 14:45:21 UTC (rev 14902)
@@ -92,7 +92,7 @@
* @throws PartInitException
* @throws FileNotFoundException
*/
- public IEditorPart run(Object selection, IJavaProject proj,
+ public static IEditorPart run(Object selection, IJavaProject proj,
String fullyQualifiedName) throws JavaModelException, PartInitException, FileNotFoundException {
if (fullyQualifiedName == null) return null;
String remainder = null;
@@ -141,7 +141,7 @@
}
}
- private void selectionToEditor(IJavaElement jElement, JavaEditor jEditor) {
+ private static void selectionToEditor(IJavaElement jElement, JavaEditor jEditor) {
if (jEditor != null) {
jEditor.setSelection(jElement);
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java 2009-04-24 13:47:00 UTC (rev 14901)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java 2009-04-24 14:45:21 UTC (rev 14902)
@@ -38,6 +38,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.actions.ActionContext;
import org.eclipse.ui.actions.ActionGroup;
@@ -169,8 +170,9 @@
Object last = path.getLastSegment();
ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)(path.getSegment(0));
if (last instanceof PersistentClass || last.getClass() == Property.class){
+ IEditorPart res = null;
try {
- OpenMappingAction.run(path, consoleConfiguration);
+ res = OpenMappingAction.run(path, consoleConfiguration);
} catch (Exception e) {
HibernateConsolePlugin.getDefault().logErrorMessage("Can't find mapping file.", e); //$NON-NLS-1$
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java 2009-04-24 13:47:00 UTC (rev 14901)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java 2009-04-24 14:45:21 UTC (rev 14902)
@@ -10,11 +10,14 @@
******************************************************************************/
package org.jboss.tools.hibernate.ui.veditor.editors.actions;
+import java.io.FileNotFoundException;
import java.util.Iterator;
import java.util.Set;
import org.eclipse.gef.ui.actions.SelectionAction;
+import org.eclipse.jdt.core.JavaModelException;
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.Property;
@@ -56,8 +59,12 @@
Property parentProperty = ((SpecialRootClass)((Property)selection).getPersistentClass()).getProperty();
try {
org.hibernate.eclipse.console.actions.OpenMappingAction.run(compositSel, parentProperty, consoleConfiguration);
- } catch (Exception e) {
+ } catch (PartInitException e) {
HibernateConsolePlugin.getDefault().logErrorMessage(UIVEditorMessages.OpenMappingAction_canot_find_or_open_mapping_file, e);
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage(UIVEditorMessages.OpenMappingAction_canot_find_or_open_mapping_file, e);
+ } catch (FileNotFoundException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage(UIVEditorMessages.OpenMappingAction_canot_find_or_open_mapping_file, e);
}
continue;
}
@@ -66,8 +73,12 @@
}
try {
org.hibernate.eclipse.console.actions.OpenMappingAction.run(selection, consoleConfiguration);
- } catch (Exception e) {
+ } catch (PartInitException e) {
HibernateConsolePlugin.getDefault().logErrorMessage(UIVEditorMessages.OpenMappingAction_open_mapping_file, e);
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage(UIVEditorMessages.OpenMappingAction_open_mapping_file, e);
+ } catch (FileNotFoundException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage(UIVEditorMessages.OpenMappingAction_open_mapping_file, e);
}
/*IResource resource = null;
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java 2009-04-24 13:47:00 UTC (rev 14901)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java 2009-04-24 14:45:21 UTC (rev 14902)
@@ -91,7 +91,7 @@
IEditorPart editor = null;
Throwable ex = null;
try {
- editor = new OpenSourceAction().run(selection, MappingTestProject.getTestProject().getIJavaProject(),
+ editor = OpenSourceAction.run(selection, MappingTestProject.getTestProject().getIJavaProject(),
fullyQualifiedName);
boolean highlighted = ProjectUtil.checkHighlighting(editor);
if (!highlighted) {
15 years, 8 months
JBoss Tools SVN: r14901 - trunk/as/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-04-24 09:47:00 -0400 (Fri, 24 Apr 2009)
New Revision: 14901
Modified:
trunk/as/docs/reference/en/modules/perspective.xml
trunk/as/docs/reference/en/modules/quick_start.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-588 - Old jboss server's view is completely replace with a new one.All the required changes connected to the Clean button removing and the new jboss server view were added to the JBoss Server Manager Reference Guide.
Modified: trunk/as/docs/reference/en/modules/perspective.xml
===================================================================
--- trunk/as/docs/reference/en/modules/perspective.xml 2009-04-24 13:46:34 UTC (rev 14900)
+++ trunk/as/docs/reference/en/modules/perspective.xml 2009-04-24 13:47:00 UTC (rev 14901)
@@ -45,9 +45,9 @@
<section id="jbossserver_view_toolbar">
<title>JBoss Server View Toolbar</title>
<para>In the right top corner of the <property>JBoss Server View</property> there is a
- special toolbar which provides a quick access to starting a server (in debug mode,
- run mode, or profile mode), restarting a server, stopping a server, publishing to a
- server and a possibility to clean a server.</para>
+ special toolbar which provides a quick access to starting a server (in the debug mode,
+ run mode, or profile mode), restarting a server, stopping a server and a possibility to publish to a
+ server.</para>
<figure>
<title>The JBoss Server View Toolbar</title>
@@ -74,12 +74,7 @@
</emphasis> button will republish any modules where it has determined the workspace
is out of sync with the server. It will attempt to do an incremental publish if it
turns out that the module in question is capable of doing one.</para>
-
-
- <para>Press <emphasis>
- <property>Clean</property>
- </emphasis> if you need to clean projects published on the server, i.e. remove
- invalid resources from the server.</para>
+
</section>
<section id="jbossserver_view_structure">
@@ -256,15 +251,6 @@
<row>
<entry>
- <para>Clean</para>
- </entry>
- <entry>
- <para>The option for complete redeploying the resources</para>
- </entry>
- </row>
-
- <row>
- <entry>
<para>Explore</para>
</entry>
<entry>
Modified: trunk/as/docs/reference/en/modules/quick_start.xml
===================================================================
--- trunk/as/docs/reference/en/modules/quick_start.xml 2009-04-24 13:46:34 UTC (rev 14900)
+++ trunk/as/docs/reference/en/modules/quick_start.xml 2009-04-24 13:47:00 UTC (rev 14901)
@@ -23,11 +23,9 @@
<property>stop</property>
</emphasis> it or <emphasis>
<property>restart</property>
- </emphasis> it, <emphasis>
+ </emphasis> it and <emphasis>
<property>publish</property>
- </emphasis> to the server, <emphasis>
- <property>clean</property>
- </emphasis> the server.</para>
+ </emphasis> to the server.</para>
<figure>
<title>JBoss Server Toolbar</title>
15 years, 8 months
JBoss Tools SVN: r14900 - trunk/as/docs/reference/en/images/quick_start.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-04-24 09:46:34 -0400 (Fri, 24 Apr 2009)
New Revision: 14900
Modified:
trunk/as/docs/reference/en/images/quick_start/quick_start_5.png
Log:
https://jira.jboss.org/jira/browse/JBDS-588 - Old jboss server's view is completely replace with a new one.All the required changes connected to the Clean button removing and the new jboss server view were added to the JBoss Server Manager Reference Guide.
Modified: trunk/as/docs/reference/en/images/quick_start/quick_start_5.png
===================================================================
(Binary files differ)
15 years, 8 months
JBoss Tools SVN: r14899 - trunk/as/docs/reference/en/images/quick_start.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-04-24 09:46:22 -0400 (Fri, 24 Apr 2009)
New Revision: 14899
Modified:
trunk/as/docs/reference/en/images/quick_start/quick_start_1.png
trunk/as/docs/reference/en/images/quick_start/quick_start_2.png
trunk/as/docs/reference/en/images/quick_start/quick_start_3.png
Log:
https://jira.jboss.org/jira/browse/JBDS-588 - Old jboss server's view is completely replace with a new one.All the required changes connected to the Clean button removing and the new jboss server view were added to the JBoss Server Manager Reference Guide.
Modified: trunk/as/docs/reference/en/images/quick_start/quick_start_1.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/quick_start/quick_start_2.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/quick_start/quick_start_3.png
===================================================================
(Binary files differ)
15 years, 8 months
JBoss Tools SVN: r14898 - trunk/as/docs/reference/en/images/tptp_support.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-04-24 09:46:05 -0400 (Fri, 24 Apr 2009)
New Revision: 14898
Modified:
trunk/as/docs/reference/en/images/tptp_support/tptp_support_1.png
Log:
https://jira.jboss.org/jira/browse/JBDS-588 - Old jboss server's view is completely replace with a new one.All the required changes connected to the Clean button removing and the new jboss server view were added to the JBoss Server Manager Reference Guide.
Modified: trunk/as/docs/reference/en/images/tptp_support/tptp_support_1.png
===================================================================
(Binary files differ)
15 years, 8 months
JBoss Tools SVN: r14897 - trunk/as/docs/reference/en/images/perspective.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-04-24 09:45:45 -0400 (Fri, 24 Apr 2009)
New Revision: 14897
Modified:
trunk/as/docs/reference/en/images/perspective/perspective_8.png
Log:
https://jira.jboss.org/jira/browse/JBDS-588 - Old jboss server's view is completely replace with a new one.All the required changes connected to the Clean button removing and the new jboss server view were added to the JBoss Server Manager Reference Guide.
Modified: trunk/as/docs/reference/en/images/perspective/perspective_8.png
===================================================================
(Binary files differ)
15 years, 8 months
JBoss Tools SVN: r14896 - trunk/as/docs/reference/en/images/perspective.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-04-24 09:45:35 -0400 (Fri, 24 Apr 2009)
New Revision: 14896
Modified:
trunk/as/docs/reference/en/images/perspective/perspective_2.png
Log:
https://jira.jboss.org/jira/browse/JBDS-588 - Old jboss server's view is completely replace with a new one.All the required changes connected to the Clean button removing and the new jboss server view were added to the JBoss Server Manager Reference Guide.
Modified: trunk/as/docs/reference/en/images/perspective/perspective_2.png
===================================================================
(Binary files differ)
15 years, 8 months
JBoss Tools SVN: r14895 - trunk/as/docs/reference/en/images/perspective.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-04-24 09:45:18 -0400 (Fri, 24 Apr 2009)
New Revision: 14895
Modified:
trunk/as/docs/reference/en/images/perspective/perspective_1.png
Log:
https://jira.jboss.org/jira/browse/JBDS-588 - Old jboss server's view is completely replace with a new one.All the required changes connected to the Clean button removing and the new jboss server view were added to the JBoss Server Manager Reference Guide.
Modified: trunk/as/docs/reference/en/images/perspective/perspective_1.png
===================================================================
(Binary files differ)
15 years, 8 months