JBoss Tools SVN: r16052 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-06-18 14:38:11 -0400 (Thu, 18 Jun 2009)
New Revision: 16052
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/CustomTagLibManager.java
Log:
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/CustomTagLibManager.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/CustomTagLibManager.java 2009-06-18 18:11:41 UTC (rev 16051)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/CustomTagLibManager.java 2009-06-18 18:38:11 UTC (rev 16052)
@@ -79,7 +79,7 @@
Set<ICustomTagLibrary> libSet = new HashSet<ICustomTagLibrary>();
Set<CustomTagLibAttribute> extensionSet = new HashSet<CustomTagLibAttribute>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint = registry.getExtensionPoint("org.jboss.tools.jst.web.kb.KbTagLib"); //$NON-NLS-1$
+ IExtensionPoint extensionPoint = registry.getExtensionPoint("org.jboss.tools.jst.web.kb.tagLib"); //$NON-NLS-1$
if (extensionPoint != null) {
IExtension[] extensions = extensionPoint.getExtensions();
for (int i=0; i<extensions.length; i++) {
15 years, 6 months
JBoss Tools SVN: r16051 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-06-18 14:11:41 -0400 (Thu, 18 Jun 2009)
New Revision: 16051
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-06-18 17:33:04 UTC (rev 16050)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-06-18 18:11:41 UTC (rev 16051)
@@ -115,7 +115,7 @@
protected IComponent[] getComponents(KbQuery query, String prefix, IPageContext context) {
String fullTagName = null;
boolean mask = false;
- if(query.getType()==KbQuery.Type.TAG_NAME) {
+ if(query.getType()==KbQuery.Type.TAG_NAME || query.getType()==KbQuery.Type.TEXT) {
fullTagName = query.getValue();
mask = query.isMask();
} else {
@@ -318,10 +318,10 @@
String prefix = getPrefix(query, context);
List<TextProposal> proposals = new ArrayList<TextProposal>();
IComponent[] components = getComponents(query, prefix, context);
- if(query.getType() == KbQuery.Type.TAG_NAME) {
+ if(query.getType() == KbQuery.Type.TAG_NAME || query.getType() == KbQuery.Type.TEXT) {
for (int i = 0; i < components.length; i++) {
if(!(components[i] instanceof CustomComponentExtension)) {
- proposals.add(getProposal(prefix, components[i]));
+ proposals.add(getProposal(prefix, components[i]));
}
}
} else {
@@ -341,7 +341,7 @@
TextProposal proposal = new TextProposal();
proposal.setContextInfo(component.getDescription());
proposal.setSource(component);
- StringBuffer label = new StringBuffer();
+ StringBuffer label = new StringBuffer("<");
if(prefix!=null) {
label.append(prefix + KbQuery.PREFIX_SEPARATOR);
}
@@ -357,6 +357,7 @@
if(!component.canHaveBody()) {
label.append(" /");
}
+ label.append(">");
proposal.setReplacementString(label.toString());
15 years, 6 months
JBoss Tools SVN: r16050 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-06-18 13:33:04 -0400 (Thu, 18 Jun 2009)
New Revision: 16050
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java
Log:
JBIDE-2808: Improve/refactor org.jboss.tools.common.kb plugin.
The skeleton to prompt for the EL in text regions is updated
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java 2009-06-18 16:11:32 UTC (rev 16049)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java 2009-06-18 17:33:04 UTC (rev 16050)
@@ -658,7 +658,7 @@
* Returns URI for the current/parent tag
* @return
*/
- protected String getELPrefix() {
+ protected TextRegion getELPrefix() {
IStructuredModel sModel = StructuredModelManager
.getModelManager()
.getExistingModelForRead(getDocument());
@@ -701,13 +701,13 @@
String matchString = text.substring(0, inValueOffset);
ELParser p = ELParserUtil.getJbossFactory().createParser();
- ELModel model = p.parse(matchString);
- ELInstance is = ELUtil.findInstance(model, inValueOffset);
+ ELModel model = p.parse(text);
+ ELInstance is = ELUtil.findInstance(model, inValueOffset);// ELInstance
+ model.toString(); model.getSyntaxErrors();
+ boolean isELClosed = (model != null && model.toString().endsWith("}"));
+ TextRegion tr = new TextRegion(startOffset, is == null ? inValueOffset : is.getStartPosition(), is == null ? 0 : inValueOffset - is.getStartPosition(), is == null ? "" : is.getText(), isELClosed);
- String elPrefix = is.getText();
-
-
- return elPrefix;
+ return tr;
} finally {
if (sModel != null) {
sModel.releaseFromRead();
@@ -715,6 +715,44 @@
}
}
+ protected class TextRegion {
+ private int startOffset;
+ private int offset;
+ private int length;
+ private String text;
+ private boolean isELClosed;
+
+ TextRegion(int startOffset, int offset, int length, String text, boolean isELClosed) {
+ this.startOffset = startOffset;
+ this.offset = offset;
+ this.length = length;
+ this.text = text;
+ this.isELClosed = isELClosed;
+ }
+
+ public int getStartOffset() {
+ return startOffset;
+ }
+
+ public int getOffset() {
+ return offset;
+ }
+
+ public int getLength() {
+ return length;
+ }
+
+ public String getText() {
+ StringBuffer sb = new StringBuffer(length);
+ sb = sb.append(text.substring(0, length));
+ sb.setLength(length);
+ return sb.toString();
+ }
+
+ public boolean isELClosed() {
+ return isELClosed;
+ }
+ }
/*
* Checks if the EL operand starting characters are present
* @return
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java 2009-06-18 16:11:32 UTC (rev 16049)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java 2009-06-18 17:33:04 UTC (rev 16050)
@@ -19,12 +19,14 @@
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
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.ui.internal.contentassist.ContentAssistRequest;
import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.jsp.contentassist.AbstractXMLContentAssistProcessor.TextRegion;
import org.jboss.tools.jst.web.kb.IFaceletPageContext;
import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
@@ -163,12 +165,16 @@
// TODO Auto-generated method stub
System.out.println("FaceletPageContectAssistProcessor: addTextELProposals() invoked");
try {
- String matchString = getELPrefix();
+ TextRegion prefix = getELPrefix();
+ String matchString = prefix.getText();
String query = matchString;
if (query == null)
query = "";
String stringQuery = matchString;
-
+
+ int beginChangeOffset = prefix.getStartOffset() + prefix.getOffset();
+
+
KbQuery kbQuery = createKbQuery(Type.TEXT, query, stringQuery);
TextProposal[] proposals = PageProcessor.getInstance().getProposals(kbQuery, getContext());
@@ -177,13 +183,13 @@
System.out.println("Tag Text EL proposal [" + (i + 1) + "/" + proposals.length + "]: " + textProposal.getReplacementString());
- String replacementString = textProposal.getReplacementString();
+ int replacementOffset = beginChangeOffset;
+ int replacementLength = prefix.getLength();
+ String replacementString = prefix.getText().substring(0, replacementLength) + textProposal.getReplacementString();
+ int cursorPosition = replacementString.length();
+ Image image = textProposal.getImage();
- int replacementOffset = contentAssistRequest.getReplacementBeginPosition();
- int replacementLength = contentAssistRequest.getReplacementLength();
- int cursorPosition = getCursorPositionForProposedText(replacementString);
- Image image = textProposal.getImage();
- String displayString = (textProposal.getLabel() == null ? replacementString : textProposal.getLabel());
+ String displayString = prefix.getText().substring(0, replacementLength) + textProposal.getReplacementString() + "}";
IContextInformation contextInformation = null;
String additionalProposalInfo = textProposal.getContextInfo();
int relevance = textProposal.getRelevance() + 10000;
@@ -191,6 +197,14 @@
CustomCompletionProposal proposal = new CustomCompletionProposal(replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, contextInformation, additionalProposalInfo, relevance);
contentAssistRequest.addProposal(proposal);
}
+
+ if (proposals == null || proposals.length == 0) {
+ if (!prefix.isELClosed()) {
+ CustomCompletionProposal proposal = new CustomCompletionProposal("}", contentAssistRequest.getReplacementBeginPosition(),
+ 0, 1, null, "}", null, "Close EL Expression", 10000);
+ contentAssistRequest.addProposal(proposal);
+ }
+ }
} finally {
System.out.println("FaceletPageContectAssistProcessor: addTextELProposals() exited");
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java 2009-06-18 16:11:32 UTC (rev 16049)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java 2009-06-18 17:33:04 UTC (rev 16050)
@@ -398,7 +398,8 @@
// TODO Auto-generated method stub
System.out.println("JspContentAssistProcessor: addAttributeValueELProposals() invoked");
try {
- String matchString = getELPrefix();
+ TextRegion prefix = getELPrefix();
+ String matchString = prefix.getText();
String query = matchString;
if (query == null)
query = "";
15 years, 6 months
JBoss Tools SVN: r16049 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-06-18 12:11:32 -0400 (Thu, 18 Jun 2009)
New Revision: 16049
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4406
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-06-18 15:48:30 UTC (rev 16048)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-06-18 16:11:32 UTC (rev 16049)
@@ -56,22 +56,15 @@
public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
CheckConditionsContext context) throws CoreException,
OperationCanceledException {
- pm.beginTask("", 1); //$NON-NLS-1$
- try {
- RefactoringStatus status = new RefactoringStatus();
- if(component != null){
- checkDeclarations(component, status);
-
- rootChange = new CompositeChange(SeamCoreMessages.RENAME_SEAM_COMPONENT_PROCESSOR_TITLE);
-
- renameComponent(component);
-
- checkResources(status);
- }
- return status;
- } finally {
- pm.done();
+ status = new RefactoringStatus();
+ if(component != null){
+ checkDeclarations(component);
+
+ rootChange = new CompositeChange(SeamCoreMessages.RENAME_SEAM_COMPONENT_PROCESSOR_TITLE);
+
+ renameComponent(pm, component);
}
+ return status;
}
/*
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java 2009-06-18 15:48:30 UTC (rev 16048)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java 2009-06-18 16:11:32 UTC (rev 16049)
@@ -51,26 +51,20 @@
public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
CheckConditionsContext context) throws CoreException,
OperationCanceledException {
- pm.beginTask("", 1); //$NON-NLS-1$
- try {
- RefactoringStatus status = new RefactoringStatus();
- ISeamComponent component = checkComponent();
- if(component != null){
- checkDeclarations(component, status);
-
- rootChange = new CompositeChange(SeamCoreMessages.RENAME_SEAM_CONTEXT_VARIABLE_PROCESSOR_TITLE);
-
- renameComponent(component);
- }else{
- Set<ISeamFactory> factories = checkFactories();
- if(factories != null)
- renameFactories(factories);
- }
- checkResources(status);
- return status;
- } finally {
- pm.done();
+ status = new RefactoringStatus();
+ ISeamComponent component = checkComponent();
+ if(component != null){
+ checkDeclarations(component);
+
+ rootChange = new CompositeChange(SeamCoreMessages.RENAME_SEAM_CONTEXT_VARIABLE_PROCESSOR_TITLE);
+
+ renameComponent(pm, component);
+ }else{
+ Set<ISeamFactory> factories = checkFactories();
+ if(factories != null)
+ renameFactories(pm, factories);
}
+ return status;
}
/*
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java 2009-06-18 15:48:30 UTC (rev 16048)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java 2009-06-18 16:11:32 UTC (rev 16049)
@@ -22,6 +22,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
@@ -85,6 +86,8 @@
protected static final String SEAM_PROPERTIES_FILE = "seam.properties"; //$NON-NLS-1$
+ protected RefactoringStatus status;
+
private SeamContextValidationHelper coreHelper = new SeamContextValidationHelper();
protected CompositeChange rootChange;
@@ -229,6 +232,9 @@
if(isBadLocation(location))
return;
+ if(!isFileCorrect(file))
+ return;
+
String content = null;
try {
content = FileUtil.readStream(file.getContents());
@@ -257,6 +263,9 @@
private void changeAnnotation(ITextSourceReference location, IFile file){
if(isBadLocation(location))
return;
+
+ if(!isFileCorrect(file))
+ return;
String content = null;
try {
@@ -321,7 +330,7 @@
}
}
- protected void checkDeclarations(ISeamComponent component, RefactoringStatus status) throws CoreException{
+ protected void checkDeclarations(ISeamComponent component) throws CoreException{
if(component.getJavaDeclaration() != null){
if(coreHelper.isJar(component.getJavaDeclaration()))
status.addInfo(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_COMPONENT_HAS_DECLARATION_FROM_JAR, new String[]{component.getName(), component.getJavaDeclaration().getResource().getFullPath().toString()}));
@@ -335,20 +344,18 @@
}
}
- protected void checkResources(RefactoringStatus status){
- for(int i=0; i < rootChange.getChildren().length; i++){
- TextFileChange change = (TextFileChange)rootChange.getChildren()[i];
- IFile file = change.getFile();
-
- if(!file.isSynchronized(IResource.DEPTH_ZERO))
- status.addInfo(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_OUT_OF_SYNC_FILE, file.getFullPath().toString()));
-
- if(file.isPhantom())
+ protected boolean isFileCorrect(IFile file){
+ if(!file.isSynchronized(IResource.DEPTH_ZERO)){
+ status.addFatalError(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_OUT_OF_SYNC_FILE, file.getFullPath().toString()));
+ return false;
+ }else if(file.isPhantom()){
status.addFatalError(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_ERROR_PHANTOM_FILE, file.getFullPath().toString()));
- else if(file.isReadOnly())
+ return false;
+ }else if(file.isReadOnly()){
status.addFatalError(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_ERROR_READ_ONLY_FILE, file.getFullPath().toString()));
-
- }
+ return false;
+ }
+ return true;
}
private void renameJavaDeclaration(ISeamJavaComponentDeclaration javaDecl) throws CoreException{
@@ -476,6 +483,10 @@
private void scanForJava(IFile file){
String ext = file.getFileExtension();
+
+ if(!isFileCorrect(file))
+ return;
+
String content = null;
try {
content = FileUtil.readStream(file.getContents());
@@ -493,6 +504,10 @@
private void scan(IFile file){
String ext = file.getFileExtension();
+
+ if(!isFileCorrect(file))
+ return;
+
String content = null;
try {
content = FileUtil.readStream(file.getContents());
@@ -654,19 +669,31 @@
}
}
- protected void renameComponent(ISeamComponent component)throws CoreException{
+ protected void renameComponent(IProgressMonitor pm, ISeamComponent component)throws CoreException{
+ pm.beginTask("", 3);
findDeclarations(component);
+ pm.worked(1);
+
findAnnotations();
+ pm.worked(1);
+
findELReferences();
+
+ pm.done();
}
- protected void renameFactories(Set<ISeamFactory> factories){
+ protected void renameFactories(IProgressMonitor pm, Set<ISeamFactory> factories){
+ pm.beginTask("", factories.size()+1);
+
for(ISeamFactory factory : factories){
changeFactory(factory, true);
+ pm.worked(1);
}
findELReferences();
+
+ pm.done();
}
}
15 years, 6 months
JBoss Tools SVN: r16048 - trunk/seam/docs/reference/en/images/seam_editors.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-06-18 11:48:30 -0400 (Thu, 18 Jun 2009)
New Revision: 16048
Added:
trunk/seam/docs/reference/en/images/seam_editors/seam_editors_2d.png
trunk/seam/docs/reference/en/images/seam_editors/seam_editors_2e.png
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-768 -?\208?\161hanged the structure of OpenOn section. Added the description of OpenOn use cases in .xhtml files, components.xml file ,etc.</p>
</body></html>
Added: trunk/seam/docs/reference/en/images/seam_editors/seam_editors_2d.png
===================================================================
(Binary files differ)
Property changes on: trunk/seam/docs/reference/en/images/seam_editors/seam_editors_2d.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/docs/reference/en/images/seam_editors/seam_editors_2e.png
===================================================================
(Binary files differ)
Property changes on: trunk/seam/docs/reference/en/images/seam_editors/seam_editors_2e.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 6 months
JBoss Tools SVN: r16047 - trunk/seam/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-06-18 11:47:57 -0400 (Thu, 18 Jun 2009)
New Revision: 16047
Modified:
trunk/seam/docs/reference/en/modules/seam_editors.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-768 -?\208?\161hanged the structure of OpenOn section. Added the description of OpenOn use cases in .xhtml files, components.xml file ,etc.</p>
</body></html>
Modified: trunk/seam/docs/reference/en/modules/seam_editors.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/seam_editors.xml 2009-06-18 15:43:15 UTC (rev 16046)
+++ trunk/seam/docs/reference/en/modules/seam_editors.xml 2009-06-18 15:47:57 UTC (rev 16047)
@@ -490,8 +490,40 @@
</imageobject>
</mediaobject>
</figure>
-
- <para>OpenOn is also supported in Page Descriptors (<property>.page.xml</property> and <property>pages.xml</property>). OpenOn allows you to navigate to Java beans as well as to view pages.
+ <para>OpenOn is available for the following files:</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <link linkend="xmlFiles">XML files</link>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <link linkend="xhtmlFiles">JSP/XHTML Pages</link>
+ </para>
+ </listitem>
+ <listitem>
+ <para> <link linkend="javaFiles">Java files</link></para>
+ </listitem>
+ </itemizedlist>
+ <note>
+ <title>Note:</title>
+
+ <para>In this section were described only use cases special for Seam applications.For general information please read
+ <ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/jsf/html/editors.htm...">OpenOn section in Visual Web Tools Reference Guide</ulink>.</para>
+ </note>
+ <itemizedlist>
+ <listitem id="xhtmlFiles"> <para>Using OpenOn in .xhtml files you can open:</para>
+ <itemizedlist>
+ <listitem><para>components or properties resolved using an EL expression;</para></listitem>
+ <listitem><para>all actions described in pages.xml;</para></listitem>
+ <listitem><para>other .xhtml files that paths are specified in a current file;</para></listitem>
+ <listitem><para>image files that paths are set in the <emphasis>
+ <property>value</property></emphasis> property.The files will be opened in the default system graphical editor.</para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem id="xmlFiles">
+ <para>OpenOn is also supported in Page Descriptors (<property>.page.xml</property> and <property>pages.xml</property>). OpenOn allows you to navigate to Java beans as well as to view pages.
You can <property>Ctrl + left click</property> on a bean or on view page file (e.g. XTML file) to navigate to the file you clicked on. </para>
<figure>
@@ -515,15 +547,41 @@
</imageobject>
</mediaobject>
</figure>
+ <para>You can also use OpenOn to open jBPM components that are described in Seam component descriptor.
+ Two places where it works are available: </para>
+ <itemizedlist>
+ <listitem><para>inside <emphasis>
+ <property><component></property></emphasis> definition;</para>
+ <figure>
+ <title>OpenOn in components.xml file</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/seam_editors/seam_editors_2d.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure></listitem>
+ <listitem><para>inside <emphasis>
+ <property>jbpm</property></emphasis> tags;</para>
+ <figure>
+ <title>OpenOn in components.xml file</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/seam_editors/seam_editors_2e.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem id="javaFiles">
<para>
OpenOn is also supported in seam components where <property> In annotation</property> is presented.
After pressing <property>Ctrl + left click</property> on the seam component specified in <code>@In </code> you will get the possibility to open the file where the component is declarated as well as
all of the seam components where it is used in the next declarations:</para>
<itemizedlist>
- <listitem>@Out</listitem>
- <listitem>@DataModel</listitem>
- <listitem>@Role</listitem>
- <listitem>@Roles</listitem>
+ <listitem><para>@Out</para></listitem>
+ <listitem><para>@DataModel</para></listitem>
+ <listitem><para>@Role</para></listitem>
+ <listitem><para>@Roles</para></listitem>
</itemizedlist>
<figure>
@@ -534,16 +592,10 @@
</imageobject>
</mediaobject>
</figure>
-
- <para>You can also use OpenOn to open jBPM components that are described in Seam component descriptor.
- Two places where it works are available: </para>
- <itemizedlist>
- <listitem>inside <component> definition;</listitem>
- <listitem>inside jbpm tags;</listitem>
- </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ </section>
- </section>
-
<section id="SeamValidation">
<title>Seam Validation</title>
15 years, 6 months
JBoss Tools SVN: r16046 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-06-18 11:43:15 -0400 (Thu, 18 Jun 2009)
New Revision: 16046
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4406
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java 2009-06-18 15:42:49 UTC (rev 16045)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java 2009-06-18 15:43:15 UTC (rev 16046)
@@ -154,6 +154,7 @@
// Rename Seam Component
RenameComponentProcessor processor = new RenameComponentProcessor(component);
processor.setNewName(newName);
+ processor.checkFinalConditions(new NullProgressMonitor(), null);
CompositeChange rootChange = (CompositeChange)processor.createChange(new NullProgressMonitor());
assertEquals("There is unexpected number of changes",changeList.size(), rootChange.getChildren().length);
15 years, 6 months
JBoss Tools SVN: r16045 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core/refactoring and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-06-18 11:42:49 -0400 (Thu, 18 Jun 2009)
New Revision: 16045
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreMessages.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/messages.properties
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4406
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreMessages.java 2009-06-18 15:01:29 UTC (rev 16044)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreMessages.java 2009-06-18 15:42:49 UTC (rev 16045)
@@ -45,4 +45,7 @@
public static String RENAME_SEAM_COMPONENT_PROCESSOR_THIS_IS_NOT_A_SEAM_COMPONENT;
public static String RENAME_SEAM_CONTEXT_VARIABLE_PROCESSOR_TITLE;
public static String SEAM_RENAME_PROCESSOR_COMPONENT_HAS_DECLARATION_FROM_JAR;
+ public static String SEAM_RENAME_PROCESSOR_OUT_OF_SYNC_FILE;
+ public static String SEAM_RENAME_PROCESSOR_ERROR_PHANTOM_FILE;
+ public static String SEAM_RENAME_PROCESSOR_ERROR_READ_ONLY_FILE;
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/messages.properties 2009-06-18 15:01:29 UTC (rev 16044)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/messages.properties 2009-06-18 15:42:49 UTC (rev 16045)
@@ -32,5 +32,8 @@
RENAME_SEAM_COMPONENT_PROCESSOR_TITLE=Rename Seam Component
RENAME_SEAM_COMPONENT_PROCESSOR_THIS_IS_NOT_A_SEAM_COMPONENT=This is not a Seam Component.
RENAME_SEAM_CONTEXT_VARIABLE_PROCESSOR_TITLE=Rename Seam Context Variable
-SEAM_RENAME_PROCESSOR_COMPONENT_HAS_DECLARATION_FROM_JAR=This component has a declaration which is located in jar file
+SEAM_RENAME_PROCESSOR_COMPONENT_HAS_DECLARATION_FROM_JAR=Component ''{0}'' has a declaration which is located in jar file: ''{1}''. Press next to force rename.
+SEAM_RENAME_PROCESSOR_OUT_OF_SYNC_FILE=File ''{0}'' is not in sync. Press next to force rename.
+SEAM_RENAME_PROCESSOR_ERROR_PHANTOM_FILE=Cannot change phantom file: ''{0}''.
+SEAM_RENAME_PROCESSOR_ERROR_READ_ONLY_FILE=Cannot change read-only file: ''{0}''.
SEAM_INSTALL_WIZARD_PROJECT_NAME_WITH_UPPERCASE=Project names which start with a capital letter may break Seam/JSF applications; use lower case.
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-06-18 15:01:29 UTC (rev 16044)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-06-18 15:42:49 UTC (rev 16045)
@@ -56,10 +56,22 @@
public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
CheckConditionsContext context) throws CoreException,
OperationCanceledException {
- RefactoringStatus status = new RefactoringStatus();
- if(component != null && isJarDeclarations(component))
- status.addWarning(SeamCoreMessages.SEAM_RENAME_PROCESSOR_COMPONENT_HAS_DECLARATION_FROM_JAR);
- return status;
+ pm.beginTask("", 1); //$NON-NLS-1$
+ try {
+ RefactoringStatus status = new RefactoringStatus();
+ if(component != null){
+ checkDeclarations(component, status);
+
+ rootChange = new CompositeChange(SeamCoreMessages.RENAME_SEAM_COMPONENT_PROCESSOR_TITLE);
+
+ renameComponent(component);
+
+ checkResources(status);
+ }
+ return status;
+ } finally {
+ pm.done();
+ }
}
/*
@@ -83,9 +95,7 @@
@Override
public Change createChange(IProgressMonitor pm) throws CoreException,
OperationCanceledException {
- rootChange = new CompositeChange(SeamCoreMessages.RENAME_SEAM_COMPONENT_PROCESSOR_TITLE);
- renameComponent(component);
return rootChange;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java 2009-06-18 15:01:29 UTC (rev 16044)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java 2009-06-18 15:42:49 UTC (rev 16045)
@@ -14,7 +14,6 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
@@ -26,7 +25,6 @@
import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamFactory;
-import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCoreMessages;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -53,11 +51,26 @@
public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
CheckConditionsContext context) throws CoreException,
OperationCanceledException {
- RefactoringStatus status = new RefactoringStatus();
- ISeamComponent component = checkComponent();
- if(component != null && isJarDeclarations(component))
- status.addWarning(SeamCoreMessages.SEAM_RENAME_PROCESSOR_COMPONENT_HAS_DECLARATION_FROM_JAR);
- return status;
+ pm.beginTask("", 1); //$NON-NLS-1$
+ try {
+ RefactoringStatus status = new RefactoringStatus();
+ ISeamComponent component = checkComponent();
+ if(component != null){
+ checkDeclarations(component, status);
+
+ rootChange = new CompositeChange(SeamCoreMessages.RENAME_SEAM_CONTEXT_VARIABLE_PROCESSOR_TITLE);
+
+ renameComponent(component);
+ }else{
+ Set<ISeamFactory> factories = checkFactories();
+ if(factories != null)
+ renameFactories(factories);
+ }
+ checkResources(status);
+ return status;
+ } finally {
+ pm.done();
+ }
}
/*
@@ -79,16 +92,7 @@
public Change createChange(IProgressMonitor pm) throws CoreException,
OperationCanceledException {
- rootChange = new CompositeChange(SeamCoreMessages.RENAME_SEAM_CONTEXT_VARIABLE_PROCESSOR_TITLE);
- ISeamComponent component = checkComponent();
- if(component != null)
- renameComponent(component);
- else{
- Set<ISeamFactory> factories = checkFactories();
- if(factories != null)
- renameFactories(factories);
- }
return rootChange;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java 2009-06-18 15:01:29 UTC (rev 16044)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameProcessor.java 2009-06-18 15:42:49 UTC (rev 16045)
@@ -22,7 +22,6 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
@@ -35,6 +34,7 @@
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.core.refactoring.TextFileChange;
import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
+import org.eclipse.ltk.internal.core.refactoring.Messages;
import org.eclipse.text.edits.MultiTextEdit;
import org.eclipse.text.edits.ReplaceEdit;
import org.eclipse.text.edits.TextEdit;
@@ -321,21 +321,36 @@
}
}
- protected boolean isJarDeclarations(ISeamComponent component) throws CoreException{
+ protected void checkDeclarations(ISeamComponent component, RefactoringStatus status) throws CoreException{
if(component.getJavaDeclaration() != null){
if(coreHelper.isJar(component.getJavaDeclaration()))
- return true;
+ status.addInfo(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_COMPONENT_HAS_DECLARATION_FROM_JAR, new String[]{component.getName(), component.getJavaDeclaration().getResource().getFullPath().toString()}));
}
Set<ISeamXmlComponentDeclaration> xmlDecls = component.getXmlDeclarations();
for(ISeamXmlComponentDeclaration xmlDecl : xmlDecls){
if(coreHelper.isJar(xmlDecl))
- return true;
+ status.addInfo(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_COMPONENT_HAS_DECLARATION_FROM_JAR, new String[]{component.getName(), xmlDecl.getResource().getFullPath().toString()}));
}
- return false;
}
+ protected void checkResources(RefactoringStatus status){
+ for(int i=0; i < rootChange.getChildren().length; i++){
+ TextFileChange change = (TextFileChange)rootChange.getChildren()[i];
+ IFile file = change.getFile();
+
+ if(!file.isSynchronized(IResource.DEPTH_ZERO))
+ status.addInfo(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_OUT_OF_SYNC_FILE, file.getFullPath().toString()));
+
+ if(file.isPhantom())
+ status.addFatalError(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_ERROR_PHANTOM_FILE, file.getFullPath().toString()));
+ else if(file.isReadOnly())
+ status.addFatalError(Messages.format(SeamCoreMessages.SEAM_RENAME_PROCESSOR_ERROR_READ_ONLY_FILE, file.getFullPath().toString()));
+
+ }
+ }
+
private void renameJavaDeclaration(ISeamJavaComponentDeclaration javaDecl) throws CoreException{
IFile file = (IFile)javaDecl.getResource();
15 years, 6 months
JBoss Tools SVN: r16044 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: mozilla and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-06-18 11:01:29 -0400 (Thu, 18 Jun 2009)
New Revision: 16044
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4429, toolbar was moved to the fixed vertical left position.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2009-06-18 14:57:06 UTC (rev 16043)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2009-06-18 15:01:29 UTC (rev 16044)
@@ -13,12 +13,14 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import org.eclipse.compare.Splitter;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.jface.action.IAction;
@@ -44,6 +46,7 @@
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorSite;
@@ -121,8 +124,15 @@
/** default web-browser */
private MozillaPreview previewWebBrowser = null;
- /** preview content */
+ /*
+ * VPE visual components.
+ */
+ private Composite sourceContent = null;
+ private Composite visualContent = null;
private Composite previewContent = null;
+ private Splitter verticalToolbarSplitter = null;
+ private Composite verticalToolbarEmpty = null;
+ private ToolBar toolBar = null;
public StructuredTextEditor getSourceEditor() {
return sourceEditor;
@@ -362,13 +372,11 @@
}
}
- Composite sourceContent = null;
- Composite visualContent = null;
-
public void setVisualMode(int type) {
switch (type) {
case VISUALSOURCE_MODE:
selectionBar.setVisible(selectionBar.getAlwaysVisibleOption());
+ setVerticalToolbarVisible(true);
/*
* Fixes https://jira.jboss.org/jira/browse/JBIDE-3140
* author Denis Maliarevich.
@@ -396,6 +404,7 @@
case SOURCE_MODE:
selectionBar.setVisible(selectionBar.getAlwaysVisibleOption());
+ setVerticalToolbarVisible(false);
if (sourceContent != null) {
sourceContent.setVisible(true);
/*
@@ -427,6 +436,7 @@
if (selectionBar != null) {
selectionBar.setVisible(false);
}
+ setVerticalToolbarVisible(false);
/*
* Fixes https://jira.jboss.org/jira/browse/JBIDE-3140
* author Denis Maliarevich.
@@ -462,17 +472,39 @@
public int getVisualMode() {
return visualMode;
}
-
+
+ /**
+ * Sets the visibility of the vertical toolbar for visual editor part.
+ *
+ * @param visible if visible
+ */
+ public void setVerticalToolbarVisible(boolean visible) {
+ if ((null == verticalToolbarSplitter) || (null == verticalToolbarEmpty)
+ || (null == toolBar)) {
+ return;
+ }
+ if (visible) {
+ verticalToolbarSplitter.setVisible(toolBar, true);
+ verticalToolbarSplitter.setVisible(verticalToolbarEmpty, false);
+ } else {
+ verticalToolbarSplitter.setVisible(toolBar, false);
+ verticalToolbarSplitter.setVisible(verticalToolbarEmpty, true);
+ }
+ verticalToolbarSplitter.getParent().layout(true, true);
+ }
+
public void createPartControl(final Composite parent) {
+
controlCount++;
if (controlCount > 1)
return;
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IVpeHelpContextIds.VISUAL_PAGE_EDITOR);
- // //////////////////////////////////////////////////////////////
-
+ /*
+ * Container composite for editor part
+ */
Composite cmpEdTl = new Composite(parent, SWT.NONE);
- GridLayout layoutEdTl = new GridLayout(1, false);
+ GridLayout layoutEdTl = new GridLayout(2, false);
layoutEdTl.verticalSpacing = 0;
layoutEdTl.marginHeight = 0;
layoutEdTl.marginBottom = 3;
@@ -480,7 +512,36 @@
cmpEdTl.setLayout(layoutEdTl);
cmpEdTl.setLayoutData(new GridData(GridData.FILL_BOTH));
- cmpEd = new Composite(cmpEdTl, SWT.NATIVE);
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-4429
+ * Composite for the left vertical toolbar
+ */
+ verticalToolbarSplitter = new Splitter(cmpEdTl, SWT.NONE);
+ GridLayout layout = new GridLayout(1,false);
+ layout.marginHeight = 2;
+ layout.marginWidth = 0;
+ layout.verticalSpacing = 0;
+ layout.horizontalSpacing = 0;
+ verticalToolbarSplitter.setLayout(layout);
+ verticalToolbarSplitter.setLayoutData(new GridData(SWT.CENTER, SWT.TOP | SWT.FILL, false, true, 1, 2));
+
+ /*
+ * The empty vertical toolbar component
+ */
+ verticalToolbarEmpty = new Composite(verticalToolbarSplitter, SWT.NONE) {
+ public Point computeSize(int wHint, int hHint, boolean changed) {
+ Point point = super.computeSize(wHint, hHint, changed);
+ point.x = 1;
+ return point;
+ }
+ };
+ verticalToolbarEmpty.setLayoutData(new GridData(GridData.FILL_VERTICAL));
+ verticalToolbarEmpty.setVisible(true);
+
+ /*
+ * The Visual Page Editor itself
+ */
+ cmpEd = new Composite(cmpEdTl, SWT.BORDER);
GridLayout layoutEd = new GridLayout(1, false);
layoutEd.marginBottom = 0;
layoutEd.marginHeight = 1;
@@ -490,8 +551,13 @@
layoutEd.verticalSpacing = 0;
layoutEd.horizontalSpacing = 0;
cmpEd.setLayout(layoutEd);
- cmpEd.setLayoutData(new GridData(GridData.FILL_BOTH));
- // /////////////////////////////////////////////////////////////////
+ cmpEd.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+
+ /*
+ * Creating selection bar at the bottom of the editor
+ */
+ selectionBar.createToolBarComposite(cmpEdTl, true);
+
//container = new SashForm(cmpEd, SWT.VERTICAL);
/*
* https://jira.jboss.org/jira/browse/JBIDE-4152
@@ -525,10 +591,6 @@
//previewContent.setLayout(new FillLayout());
previewContent.setLayout(new GridLayout());
- // ////////////////////////////////////////////////////
-
- selectionBar.createToolBarComposite(cmpEdTl, true);
- // ///////////////////////////////////////////////////
if (sourceEditor == null)
sourceEditor = new StructuredTextEditor() {
public void safelySanityCheckState(IEditorInput input) {
@@ -869,9 +931,10 @@
createShowSelectionBarMenuItem();
visualEditor.getController().init(sourceEditor, visualEditor);
}
-
});
- visualEditor.createPartControl(visualContent);
+
+ toolBar = visualEditor.createVisualToolbar(verticalToolbarSplitter);
+ visualEditor.createPartControl(visualContent);
}
/**
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2009-06-18 14:57:06 UTC (rev 16043)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2009-06-18 15:01:29 UTC (rev 16044)
@@ -153,6 +153,7 @@
*/
private nsIEditor editor;
private VpeDropDownMenu dropDownMenu = null;
+ private ToolBar verBar = null;
public void doSave(IProgressMonitor monitor) {
}
@@ -184,106 +185,11 @@
formatControllerManager.setVpeController(controller);
controller.setToolbarFormatControllerManager(formatControllerManager);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
- */
- @Override
- public void createPartControl(final Composite parent) {
-
- //Setting Layout for the parent Composite
- parent.setLayout(new FillLayout());
-
- /*
- * https://jira.jboss.org/jira/browse/JBIDE-4062
- * Creating scrollable eclipse element.
- */
- ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- sc.setLayout(new FillLayout());
- Composite composite = new Composite(sc, SWT.NATIVE);
-
- GridLayout layout = new GridLayout(2,false);
- layout.marginHeight = 0;
- layout.marginWidth = 2;
- layout.verticalSpacing = 2;
- layout.horizontalSpacing = 2;
- layout.marginBottom = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- // Composite for the left Vertical toolbar
- Composite cmpVerticalToolbar = new Composite(composite, SWT.NONE);
- layout = new GridLayout(1,false);
- layout.marginHeight = 2;
- layout.marginWidth = 0;
- layout.verticalSpacing = 0;
- cmpVerticalToolbar.setLayout(layout);
- cmpVerticalToolbar.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
-
- // Editors and Toolbar composite
- Composite cmpEdTl = new Composite(composite, SWT.NONE);
- GridLayout layoutEdTl = new GridLayout(1, false);
- layoutEdTl.verticalSpacing = 0;
- layoutEdTl.marginHeight = 0;
- layoutEdTl.marginBottom = 3;
- layoutEdTl.marginWidth = 0;
- cmpEdTl.setLayout(layoutEdTl);
- cmpEdTl.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-
- ToolBar verBar = new ToolBar(cmpVerticalToolbar, SWT.VERTICAL|SWT.FLAT);
+
+ public ToolBar createVisualToolbar(Composite parent) {
+ verBar = new ToolBar(parent, SWT.VERTICAL|SWT.FLAT);
verBar.setLayoutData(new GridData(GridData.FILL_VERTICAL));
- dropDownMenu = new VpeDropDownMenu(verBar, VpeUIMessages.MENU);
-
- // Use vpeToolBarManager to create a horizontal toolbar.
- vpeToolBarManager = new VpeToolBarManager(dropDownMenu
- .getDropDownMenu());
- if (vpeToolBarManager != null) {
- vpeToolBarManager.createToolBarComposite(cmpEdTl);
- vpeToolBarManager.addToolBar(new TextFormattingToolBar(
- formatControllerManager));
- }
-
- // add Invisible tags support to menu
-
- // create menu item
- MenuItem menuItem = new MenuItem(dropDownMenu.getDropDownMenu(),
- SWT.PUSH);
-
- // get default value of flag
- boolean showInvisibleTags = Constants.YES_STRING
- .equals(VpePreference.SHOW_INVISIBLE_TAGS.getValue());
-
- // set text
- menuItem.setText(showInvisibleTags ? VpeUIMessages.HIDE_NON_VISUAL_TAGS
- : VpeUIMessages.SHOW_NON_VISUAL_TAGS);
-
- // add listener
- menuItem.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- MenuItem selectedItem = (MenuItem) e.widget;
-
- // get current value of flag
- boolean showInvisibleTags = !controller.getVisualBuilder()
- .isShowInvisibleTags();
-
- // change text
- selectedItem
- .setText((showInvisibleTags ? VpeUIMessages.HIDE
- : VpeUIMessages.SHOW)
- + Constants.WHITE_SPACE
- + VpeUIMessages.NON_VISUAL_TAGS);
-
- // change flag
- controller.getVisualBuilder().setShowInvisibleTags(
- showInvisibleTags);
- // update vpe
- controller.visualRefresh();
- }
- });
-
ToolItem item = null;
item = createToolItem(verBar, SWT.BUTTON1, ICON_PREFERENCE,
ICON_PREFERENCE_DISABLED, VpeUIMessages.PREFERENCES, true);
@@ -385,7 +291,100 @@
});
verBar.pack();
+ return verBar;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createPartControl(final Composite parent) {
+ //Setting Layout for the parent Composite
+ parent.setLayout(new FillLayout());
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-4062
+ * Creating scrollable eclipse element.
+ */
+ ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ sc.setLayout(new FillLayout());
+ Composite composite = new Composite(sc, SWT.NATIVE);
+
+ GridLayout layout = new GridLayout(2,false);
+ layout.marginHeight = 0;
+ layout.marginWidth = 2;
+ layout.verticalSpacing = 2;
+ layout.horizontalSpacing = 2;
+ layout.marginBottom = 0;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+
+ // Editors and Toolbar composite
+ Composite cmpEdTl = new Composite(composite, SWT.NONE);
+ GridLayout layoutEdTl = new GridLayout(1, false);
+ layoutEdTl.verticalSpacing = 0;
+ layoutEdTl.marginHeight = 0;
+ layoutEdTl.marginBottom = 3;
+ layoutEdTl.marginWidth = 0;
+ cmpEdTl.setLayout(layoutEdTl);
+ cmpEdTl.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-4429
+ * Toolbar was moved to VpeEditorPart.
+ * 'verBar' should be created in createVisualToolbar(..) in VpeEditorPart
+ * and only after that MozillaEditor should be created itself.
+ */
+ if (null != verBar) {
+ dropDownMenu = new VpeDropDownMenu(verBar, VpeUIMessages.MENU);
+ // add Invisible tags support to menu
+ // create menu item
+ MenuItem menuItem = new MenuItem(dropDownMenu.getDropDownMenu(), SWT.PUSH);
+ // get default value of flag
+ boolean showInvisibleTags = Constants.YES_STRING
+ .equals(VpePreference.SHOW_INVISIBLE_TAGS.getValue());
+
+ // set text
+ menuItem.setText(showInvisibleTags ? VpeUIMessages.HIDE_NON_VISUAL_TAGS
+ : VpeUIMessages.SHOW_NON_VISUAL_TAGS);
+
+ // add listener
+ menuItem.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ MenuItem selectedItem = (MenuItem) e.widget;
+
+ // get current value of flag
+ boolean showInvisibleTags = !controller.getVisualBuilder()
+ .isShowInvisibleTags();
+
+ // change text
+ selectedItem
+ .setText((showInvisibleTags ? VpeUIMessages.HIDE
+ : VpeUIMessages.SHOW)
+ + Constants.WHITE_SPACE
+ + VpeUIMessages.NON_VISUAL_TAGS);
+
+ // change flag
+ controller.getVisualBuilder().setShowInvisibleTags(
+ showInvisibleTags);
+ // update vpe
+ controller.visualRefresh();
+ }
+ });
+ // Use vpeToolBarManager to create a horizontal toolbar.
+ vpeToolBarManager = new VpeToolBarManager(dropDownMenu
+ .getDropDownMenu());
+ if (vpeToolBarManager != null) {
+ vpeToolBarManager.createToolBarComposite(cmpEdTl);
+ vpeToolBarManager.addToolBar(new TextFormattingToolBar(formatControllerManager));
+ }
+ }
+
+
+
//Create a composite to the Editor
Composite cmpEd = new Composite (cmpEdTl, SWT.NATIVE);
GridLayout layoutEd = new GridLayout(1, false);
15 years, 6 months
JBoss Tools SVN: r16043 - trunk/hibernatetools/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-06-18 10:57:06 -0400 (Thu, 18 Jun 2009)
New Revision: 16043
Modified:
trunk/hibernatetools/docs/reference/en/modules/plugins.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-762 - added more details about the HQL and Hibernate Criteria editors to 4.9.2. Prototyping Queries section;
Modified: trunk/hibernatetools/docs/reference/en/modules/plugins.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en/modules/plugins.xml 2009-06-18 14:56:06 UTC (rev 16042)
+++ trunk/hibernatetools/docs/reference/en/modules/plugins.xml 2009-06-18 14:57:06 UTC (rev 16043)
@@ -1723,25 +1723,47 @@
<section>
<title>Prototyping Queries</title>
- <para>Queries can be prototyped by entering them in the <property>HQL</property> or
- <property>Criteria Editor</property>. The query editors are opened by right-clicking the
- <property>Console Configuration</property> and selecting either <property>HQL
- Editor</property> or <property>Hibernate Criteria Editor</property>. The editors
- automatically detect the chosen configuration.</para>
-
- <para>If the menu item is disabled then you need at first to create a <property>Session
+ <para>Queries can be prototyped by entering them into the <property>HQL</property> or
+ <property>Criteria Editor</property>. To execute a query you should click the green run button in the editor toolbar or press <emphasis>
+ <property>Ctrl+Enter</property>
+ </emphasis>.</para>
+
+ <section id="hql_and_criteria_editors">
+ <title>HQL Editor and Hibernate Criteria Editor</title>
+ <para>To open the query editors right-click your project
+ <property>Console Configuration</property> and select <property>HQL
+ Editor</property> (or <property>Hibernate Criteria Editor</property>).</para>
+
+ <figure>
+ <title>Opening HQL Editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/plugins/prototypingQueries.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <tip><title>Tip:</title>
+ <para>If the context menu items are disabled then you need at first to create a <property>Session
Factory</property>. That is done by simply expanding the <property>Session
Factory</property> node.</para>
-
- <para>By brining up the context menu for a chosen entity or property in the <property>Console
- Configuration</property> and opening <emphasis>
+ </tip>
+ <para>When open the editors they should automatically detect the chosen Console Configuration.</para>
+
+ <para>To get a prefill query for any entity (or any entity child node) listed in the
+ <emphasis>
+ <property>Session Factory</property></emphasis> you should double-click it. This will open the
+ <property>HQL Editor</property> with the associated query.</para>
+
+ <para>Choosing <emphasis>
<property>HQL Editor</property>
- </emphasis> or <emphasis>
+ </emphasis> in the context menu for any entity (or any entity child node) will also open the HQL editor
+ with the associated query. If you choose <emphasis>
<property>Hibernate Criteria Editor</property>
- </emphasis> you'll get a prefill query.</para>
+ </emphasis> in the context menu, it will open <property>Hibernate Criteria Editor</property> with the associated cretaria.</para>
- <figure>
- <title>Entering Simple Queries</title>
+ <figure>
+ <title>Generating Simple Queries</title>
<mediaobject>
<imageobject role="fo">
<imagedata align="center" scale="80" fileref="images/plugins/plugins_19.png"
@@ -1753,36 +1775,38 @@
</imageobject>
</mediaobject>
</figure>
- <para>To copy a portion of code from .java file into a HQL or Criteria editor, make use of the
- Quick Fix option (Ctrl + 1).</para>
- <figure>
+ <para>It's also possible to copy a portion of code from <emphasis>
+ <property>.java</property></emphasis> file into the <property>HQL</property> or
+ <property>Criteria editor</property>. To do this make use of the
+ Quick Fix option (<emphasis>
+ <property>Ctrl + 1</property>)</emphasis>.</para>
+
+ <figure>
<title>Quick Fix Option Demonstration</title>
-
<mediaobject>
<imageobject>
<imagedata fileref="images/plugins/plugins_19_b.png"/>
</imageobject>
</mediaobject>
</figure>
+
<para>You can also update the original java code according to changes in the HQL or Criteria
editor. For that you should save your HQL/Criteria query and submit the replacing in
appeared confirmation dialog.</para>
<figure>
<title>Updating Java Code</title>
-
<mediaobject>
<imageobject>
<imagedata fileref="images/plugins/plugins_19_c.png"/>
</imageobject>
</mediaobject>
</figure>
+ </section>
- <para>Executing the query is done by clicking the green run button in the toolbar or pressing <emphasis>
- <property>Ctrl+Enter</property>
- </emphasis>.</para>
-
+ <section>
+ <title>Error Handling</title>
<para>Errors during creation of the <property>Session Factory</property> or running the
queries (e.g. if your configuration or query is incorrect) will be shown in a message dialog
or inclined in the view that detected the error, you may get more information about the
@@ -1800,7 +1824,7 @@
out of memory. To avoid this you can put a value in the Max results field to reduce the
number of elements returned.</para>
</note>
-
+ </section>
<section>
<title>Dynamic Query Translator</title>
15 years, 6 months