JBoss Tools SVN: r9278 - tags.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2008-07-24 15:11:30 -0400 (Thu, 24 Jul 2008)
New Revision: 9278
Removed:
tags/jbosstools-3.0.0.Alpha1/
Log:
retagging 3.0.0.Alpha1
16 years, 5 months
JBoss Tools SVN: r9277 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: template and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-07-24 14:30:45 -0400 (Thu, 24 Jul 2008)
New Revision: 9277
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/template/SelectionManager.java
Log:
JBIDE-2505
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 2008-07-24 18:28:52 UTC (rev 9276)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-07-24 18:30:45 UTC (rev 9277)
@@ -760,7 +760,7 @@
selectionManager.refreshVisualSelection();
} catch (Exception ex) {
- VpePlugin.reportProblem(ex);
+ VpePlugin.getPluginLog().logError(ex);
}
// VpeTemplate template = TemplateManagingUtil
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java 2008-07-24 18:28:52 UTC (rev 9276)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java 2008-07-24 18:30:45 UTC (rev 9277)
@@ -239,6 +239,11 @@
IStructuredModel model = null;
try {
+ //checks for null, for case when we close editor and background update job is running
+ if(getSourceEditor().getTextViewer()==null) {
+
+ return;
+ }
//gets source model for read, model should be released see JBIDE-2219
model = StructuredModelManager.getModelManager()
.getExistingModelForRead(getSourceEditor().getTextViewer().getDocument());
@@ -313,9 +318,16 @@
NodeImpl targetSourceNode = (NodeImpl)nodeData.getSourceNode();
String sourceNodeValue = nodeData.getSourceNode().getNodeValue();
ITextRegion valueRegion = targetSourceNode.getValueRegion();
+ if(valueRegion==null) {
+ return;
+ }
ITextRegion nameRegion = targetSourceNode.getNameRegion();
int offcetReferenceToSourceNode = focusOffcetInSourceDocument-valueRegion.getStart()-targetSourceNode.getStartOffset()+nameRegion.getStart()-1;
- selectionController.getSelection(nsISelectionController.SELECTION_NORMAL).collapse(visualNode, offcetReferenceToSourceNode);
+
+ if(offcetReferenceToSourceNode<visualNode.getNodeValue().length()){
+
+ selectionController.getSelection(nsISelectionController.SELECTION_NORMAL).collapse(visualNode, offcetReferenceToSourceNode);
+ }
}
}
/**
16 years, 5 months
JBoss Tools SVN: r9276 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-07-24 14:28:52 -0400 (Thu, 24 Jul 2008)
New Revision: 9276
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2434, catch block for stack overflow error was removed, was replaced by list in which we look for coincidences to prevent stack overflow error.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java 2008-07-24 17:52:35 UTC (rev 9275)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java 2008-07-24 18:28:52 UTC (rev 9276)
@@ -53,11 +53,11 @@
*/
public static String getDoctype(IEditorInput editorInput) {
- try{
+
// if opened file is located in eclipse workspace
if (editorInput instanceof IFileEditorInput) {
IFile f = ((IFileEditorInput) editorInput).getFile();
- return (f == null || !f.exists()) ? null : getDoctype(f);
+ return (f == null || !f.exists()) ? null : getDoctype(f,null);
}
// if opened file is not located in eclipse workspace
else if (editorInput instanceof ILocationProvider) {
@@ -66,11 +66,6 @@
return null;
return getDoctype(path.toFile());
}
- }catch(StackOverflowError stackOverflowError) {
- //Fix For JBIDE-2434
- VpePlugin.getPluginLog().logInfo(stackOverflowError.toString());
- return ""; //$NON-NLS-1$
- }
return null;
}
@@ -81,7 +76,7 @@
* @param file
* @return
*/
- private static String getDoctype(IFile file) {
+ private static String getDoctype(IFile file, List<IFile> previousFiles) {
String docTypeValue = null;
@@ -133,7 +128,17 @@
IFile templateFile = FileUtil.getFile(fileName, file);
if (templateFile != null)
- docTypeValue = getDoctype(templateFile);
+ //if it's was first call of DOCTYPE function
+ if(previousFiles==null) {
+
+ previousFiles = new ArrayList<IFile>();
+ }
+ //Added by Max Areshkau JBIDE-2434
+ if(!previousFiles.contains(templateFile)) {
+
+ previousFiles.add(templateFile);
+ docTypeValue = getDoctype(templateFile,previousFiles);
+ }
}
@@ -227,11 +232,15 @@
// get model
model = (IDOMModel) StructuredModelManager
- .getModelManager().getExistingModelForRead(file);
+ .getModelManager().getModelForRead(file);
if (model != null)
document = model.getDocument();
+ } catch (IOException e) {
+ VpePlugin.getPluginLog().logError(e);
+ } catch (CoreException e) {
+ VpePlugin.getPluginLog().logError(e);
} finally {
//see JBIDE-2219
if(model!=null) {
16 years, 5 months
JBoss Tools SVN: r9275 - trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-07-24 13:52:35 -0400 (Thu, 24 Jul 2008)
New Revision: 9275
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/ImportJSFWarOperation.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/JSFProjectAdoptOperation.java
Log:
Cleanup JSF code:
1. Unnecessary catch(Exception ex) blocks were removed;
2. Catch(Exception ex) blocks were converted to catch particular exception(s) where it was possible
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/ImportJSFWarOperation.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/ImportJSFWarOperation.java 2008-07-24 17:51:26 UTC (rev 9274)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/ImportJSFWarOperation.java 2008-07-24 17:52:35 UTC (rev 9275)
@@ -18,6 +18,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.jsf.ui.JsfUiPlugin;
import org.jboss.tools.jst.web.context.IImportWebProjectContext;
@@ -39,7 +40,7 @@
super.createWebNature();
}
- protected void execute() throws Exception {
+ protected void execute() throws XModelException {
((ImportWebWarContext)context).prepareModules();
super.execute();
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/JSFProjectAdoptOperation.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/JSFProjectAdoptOperation.java 2008-07-24 17:51:26 UTC (rev 9274)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/JSFProjectAdoptOperation.java 2008-07-24 17:52:35 UTC (rev 9275)
@@ -13,6 +13,7 @@
import java.io.File;
import org.jboss.tools.common.model.XModelConstants;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.util.FileUtil;
@@ -30,7 +31,7 @@
super(context);
}
- protected void execute() throws Exception {
+ protected void execute() throws XModelException {
AdoptJSFProjectFinisher finisher = new AdoptJSFProjectFinisher();
finisher.setContext(model, context);
finisher.execute();
16 years, 5 months
JBoss Tools SVN: r9274 - in trunk/jst/plugins: org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-07-24 13:51:26 -0400 (Thu, 24 Jul 2008)
New Revision: 9274
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletsHtmlContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPTextJspKbConnector.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebProjectAdoptOperation.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebProjectCreationOperation.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/ImportWebProjectContext.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/ImportWebWarContext.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/RegisterServerContext.java
Log:
Cleanup JST code:
1. Unnecessary catch(Exception ex) blocks were removed;
2. Catch(Exception ex) blocks were converted to catch particular exception(s) where it was possible
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java 2008-07-24 16:22:57 UTC (rev 9273)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java 2008-07-24 17:51:26 UTC (rev 9274)
@@ -15,6 +15,7 @@
import java.util.Iterator;
import java.util.List;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
@@ -95,7 +96,7 @@
int lastOpenTag = text.lastIndexOf('<');
int lastCloseTag = text.lastIndexOf('>');
dontOpenTag = lastCloseTag<lastOpenTag;
- } catch (Exception e) {
+ } catch (BadLocationException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
@@ -260,7 +261,7 @@
return;
}
}
- } catch (Exception x) {
+ } catch (KbException x) {
JspEditorPlugin.getPluginLog().logError("", x);
}
super.generateTag(parent, elementDecl, buffer);
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletsHtmlContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletsHtmlContentAssistProcessor.java 2008-07-24 16:22:57 UTC (rev 9273)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletsHtmlContentAssistProcessor.java 2008-07-24 17:51:26 UTC (rev 9274)
@@ -49,6 +49,7 @@
import org.jboss.tools.common.kb.AttributeDescriptor;
import org.jboss.tools.common.kb.KbConnectorFactory;
import org.jboss.tools.common.kb.KbConnectorType;
+import org.jboss.tools.common.kb.KbException;
import org.jboss.tools.common.kb.KbProposal;
import org.jboss.tools.common.kb.KbQuery;
import org.jboss.tools.common.kb.KbTldResource;
@@ -150,7 +151,7 @@
Collection kbProposals = null;
try {
kbProposals = getWtpKbConnector().getProposals(request);
- } catch(Exception e) {
+ } catch(KbException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
for (Iterator iter = kbProposals.iterator(); iter.hasNext();) {
@@ -250,7 +251,7 @@
Collection kbProposals = null;
try {
kbProposals = getWtpKbConnector().getProposals(request);
- } catch(Exception e) {
+ } catch(KbException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
if(kbProposals!=null) {
@@ -308,7 +309,7 @@
Collection kbProposals = null;
try {
kbProposals = getWtpKbConnector().getProposals(request);
- } catch(Exception e) {
+ } catch(KbException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
for (Iterator iter = kbProposals.iterator(); iter.hasNext();) {
@@ -400,7 +401,7 @@
AttributeDescriptor ad = null;
try {
ad = getWtpKbConnector().getAttributeInformation(query);
- } catch(Exception e) {
+ } catch(KbException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
if(ad!=null) {
@@ -428,7 +429,7 @@
Collection kbProposals = null;
try {
kbProposals = getWtpKbConnector().getProposals(request);
- } catch(Exception e) {
+ } catch(KbException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
if(kbProposals!=null) {
@@ -483,9 +484,13 @@
jspActiveCAP.setKbConnector(wtpKbConnector);
FaceletsJsfCResource fsfCResource = new FaceletsJsfCResource(wtpKbConnector);
wtpKbConnector.registerResource(fsfCResource);
- } catch(Exception e) {
+ } catch(ClassNotFoundException e) {
JspEditorPlugin.getPluginLog().logError(e);
- }
+ } catch (InstantiationException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ }
}
return wtpKbConnector;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-07-24 16:22:57 UTC (rev 9273)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-07-24 17:51:26 UTC (rev 9274)
@@ -61,6 +61,7 @@
import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.eclipse.wst.sse.ui.internal.contentoutline.ConfigurableContentOutlinePage;
import org.jboss.tools.common.core.resources.XModelObjectEditorInput;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.event.XModelTreeEvent;
import org.jboss.tools.common.model.event.XModelTreeListener;
@@ -161,7 +162,7 @@
selectedPageIndex = qi;
}
- } catch (Exception e) {
+ } catch (CoreException e) {
JspEditorPlugin.getPluginLog().logError(e);
selectedPageIndex = 0;
}
@@ -233,12 +234,8 @@
&& sourceEditor.getEditorInput() != getEditorInput()
&& sourceEditor.getEditorInput() != null) {
if (sourceEditor instanceof AbstractTextEditor) {
- try {
((AbstractTextEditor) sourceEditor)
.setInput(getEditorInput());
- } catch (Exception exc) {
- JspEditorPlugin.getPluginLog().logError(exc);
- }
}
visualEditor.setInput(getEditorInput());
updateTitle();
@@ -498,7 +495,7 @@
try {
if (old.isModified())
new DiscardFileHandler().executeHandler(old, new Properties());
- } catch (Exception e) {
+ } catch (XModelException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
}
@@ -559,7 +556,7 @@
if (o != null && o.isModified() && o.isActive()) {
try {
((FolderImpl) o.getParent()).discardChildFile(o);
- } catch (Exception e) {
+ } catch (XModelException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
}
@@ -811,12 +808,8 @@
if (e.getJspEditor() != null
&& e.getJspEditor().getEditorInput() != e
.getEditorInput()) {
- try {
((AbstractTextEditor) e.getJspEditor())
.setInput(e2);
- } catch (Exception exc) {
- JspEditorPlugin.getPluginLog().logError(exc);
- }
}
((XModelObjectEditorInput) ei).synchronize();
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-07-24 16:22:57 UTC (rev 9273)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-07-24 17:51:26 UTC (rev 9274)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.jst.jsp.jspeditor;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Properties;
@@ -140,61 +141,61 @@
*
*/
public class JSPTextEditor extends StructuredTextEditor implements
- ITextListener, IJSPTextEditor, ITextFormatter,
- IOccurrencePreferenceProvider {
- private IStructuredTextOccurrenceStructureProvider fOccurrenceModelUpdater;
+ ITextListener, IJSPTextEditor, ITextFormatter,
+ IOccurrencePreferenceProvider {
+ private IStructuredTextOccurrenceStructureProvider fOccurrenceModelUpdater;
- TextEditorDrop dnd = new TextEditorDrop();
+ TextEditorDrop dnd = new TextEditorDrop();
- JSPMultiPageEditor parentEditor;
+ JSPMultiPageEditor parentEditor;
- long timeStamp = -1;
+ long timeStamp = -1;
- long savedTimeStamp = -1;
+ long savedTimeStamp = -1;
- IVisualController vpeController;
- // Added By Max Areshkau
- // Fix for JBIDE-788
- protected SourceEditorPageContext pageContext = null;
+ IVisualController vpeController;
+ // Added By Max Areshkau
+ // Fix for JBIDE-788
+ protected SourceEditorPageContext pageContext = null;
- private TextEditorDropProviderImpl textEditorDropProvider;
+ private TextEditorDropProviderImpl textEditorDropProvider;
- private static final String SHOW_IN_MENU = "JSPMultiPageEditor.ContextMenu.ShowInMenu"; //$NON-NLS-1$
+ private static final String SHOW_IN_MENU = "JSPMultiPageEditor.ContextMenu.ShowInMenu"; //$NON-NLS-1$
- public JSPTextEditor(JSPMultiPageEditor parentEditor) {
- JspEditorPlugin.getDefault().initDefaultPluginPreferences();
- textEditorDropProvider = new TextEditorDropProviderImpl();
- dnd.setTextEditorDropProvider(textEditorDropProvider);
- this.parentEditor = parentEditor;
- super.setSourceViewerConfiguration(new JSPTextViewerConfiguration());
- }
+ public JSPTextEditor(JSPMultiPageEditor parentEditor) {
+ JspEditorPlugin.getDefault().initDefaultPluginPreferences();
+ textEditorDropProvider = new TextEditorDropProviderImpl();
+ dnd.setTextEditorDropProvider(textEditorDropProvider);
+ this.parentEditor = parentEditor;
+ super.setSourceViewerConfiguration(new JSPTextViewerConfiguration());
+ }
- protected void setSourceViewerConfiguration(SourceViewerConfiguration config) {
- if (config instanceof StructuredTextViewerConfigurationJSP) {
- if (!(config instanceof JSPTextViewerConfiguration)) {
- config = new JSPTextViewerConfiguration();
- }
- } else if (config instanceof StructuredTextViewerConfigurationHTML) {
- if (!(config instanceof HTMLTextViewerConfiguration)) {
- config = new HTMLTextViewerConfiguration();
- }
- } else {
- config = new JSPTextViewerConfiguration();
+ protected void setSourceViewerConfiguration(SourceViewerConfiguration config) {
+ if (config instanceof StructuredTextViewerConfigurationJSP) {
+ if (!(config instanceof JSPTextViewerConfiguration)) {
+ config = new JSPTextViewerConfiguration();
+ }
+ } else if (config instanceof StructuredTextViewerConfigurationHTML) {
+ if (!(config instanceof HTMLTextViewerConfiguration)) {
+ config = new HTMLTextViewerConfiguration();
+ }
+ } else {
+ config = new JSPTextViewerConfiguration();
+ }
+ super.setSourceViewerConfiguration(config);
}
- super.setSourceViewerConfiguration(config);
- }
- /**
- * This is *only* for allowing unit tests to access the source
- * configuration.
- */
- public SourceViewerConfiguration getSourceViewerConfigurationForTest() {
- return getSourceViewerConfiguration();
- }
+ /**
+ * This is *only* for allowing unit tests to access the source
+ * configuration.
+ */
+ public SourceViewerConfiguration getSourceViewerConfigurationForTest() {
+ return getSourceViewerConfiguration();
+ }
- // Added By Max Areshkau
- // Fix for JBIDE-788
- public IVisualContext getPageContext() {
+ // Added By Max Areshkau
+ // Fix for JBIDE-788
+ public IVisualContext getPageContext() {
if (pageContext == null) {
pageContext = new SourceEditorPageContext(parentEditor);
@@ -222,443 +223,446 @@
return pageContext;
}
- protected void initializeDrop(ITextViewer textViewer) {
+ protected void initializeDrop(ITextViewer textViewer) {
- Composite c = textViewer.getTextWidget();
- Label l = new Label(c, SWT.NONE);
- l.dispose();
- }
+ Composite c = textViewer.getTextWidget();
+ Label l = new Label(c, SWT.NONE);
+ l.dispose();
+ }
- private ConfigurableContentOutlinePage fOutlinePage = null;
+ private ConfigurableContentOutlinePage fOutlinePage = null;
- private OutlinePageListener fOutlinePageListener = null;
+ private OutlinePageListener fOutlinePageListener = null;
- private IPropertySheetPage fPropertySheetPage;
+ private IPropertySheetPage fPropertySheetPage;
- public Object getAdapter(Class adapter) {
- if (ISourceViewer.class.equals(adapter)) {
- return JSPTextEditor.this.getSourceViewer();
- } else if (IContentOutlinePage.class.equals(adapter)) {
- if (fOutlinePage == null || fOutlinePage.getControl() == null
- || fOutlinePage.getControl().isDisposed()) {
- IStructuredModel internalModel = getModel();
- ContentOutlineConfiguration cfg = new JSPContentOutlineConfiguration(
- this);
- if (cfg != null) {
- ConfigurableContentOutlinePage outlinePage = new ConfigurableContentOutlinePage();
- outlinePage.setConfiguration(cfg);
- if (internalModel != null) {
- outlinePage.setInputContentTypeIdentifier(internalModel
- .getContentTypeIdentifier());
- outlinePage.setInput(internalModel);
- }
+ public Object getAdapter(Class adapter) {
+ if (ISourceViewer.class.equals(adapter)) {
+ return JSPTextEditor.this.getSourceViewer();
+ } else if (IContentOutlinePage.class.equals(adapter)) {
+ if (fOutlinePage == null || fOutlinePage.getControl() == null
+ || fOutlinePage.getControl().isDisposed()) {
+ IStructuredModel internalModel = getModel();
+ ContentOutlineConfiguration cfg = new JSPContentOutlineConfiguration(
+ this);
+ if (cfg != null) {
+ ConfigurableContentOutlinePage outlinePage = new ConfigurableContentOutlinePage();
+ outlinePage.setConfiguration(cfg);
+ if (internalModel != null) {
+ outlinePage.setInputContentTypeIdentifier(internalModel
+ .getContentTypeIdentifier());
+ outlinePage.setInput(internalModel);
+ }
- if (fOutlinePageListener == null) {
- fOutlinePageListener = new OutlinePageListener();
- }
+ if (fOutlinePageListener == null) {
+ fOutlinePageListener = new OutlinePageListener();
+ }
- outlinePage
- .addSelectionChangedListener(fOutlinePageListener);
- outlinePage.addDoubleClickListener(fOutlinePageListener);
+ outlinePage
+ .addSelectionChangedListener(fOutlinePageListener);
+ outlinePage.addDoubleClickListener(fOutlinePageListener);
- fOutlinePage = outlinePage;
+ fOutlinePage = outlinePage;
+ }
+ }
+ return fOutlinePage;
+ } else if (IPropertySheetPage.class == adapter) {
+ if (fPropertySheetPage == null
+ || fPropertySheetPage.getControl() == null
+ || fPropertySheetPage.getControl().isDisposed()) {
+ JSPPropertySheetConfiguration cfg = new JSPPropertySheetConfiguration();
+ if (cfg != null) {
+ ConfigurablePropertySheetPage propertySheetPage = new ConfigurablePropertySheetPage();
+ propertySheetPage.setConfiguration(cfg);
+ fPropertySheetPage = propertySheetPage;
+ setSorter(cfg.getSorter(), propertySheetPage);
+ }
+ }
+ return fPropertySheetPage;
}
- }
- return fOutlinePage;
- } else if (IPropertySheetPage.class == adapter) {
- if (fPropertySheetPage == null
- || fPropertySheetPage.getControl() == null
- || fPropertySheetPage.getControl().isDisposed()) {
- JSPPropertySheetConfiguration cfg = new JSPPropertySheetConfiguration();
- if (cfg != null) {
- ConfigurablePropertySheetPage propertySheetPage = new ConfigurablePropertySheetPage();
- propertySheetPage.setConfiguration(cfg);
- fPropertySheetPage = propertySheetPage;
- setSorter(cfg.getSorter(), propertySheetPage);
+ return super.getAdapter(adapter);
+ }
+
+ private void setSorter(PropertySheetSorter sorter,
+ ConfigurablePropertySheetPage sheet) {
+ try {
+ Method method = PropertySheetPage.class.getDeclaredMethod(
+ "setSorter", new Class[] { PropertySheetSorter.class });
+ method.setAccessible(true);
+ method.invoke(sheet, new Object[] { sorter });
+ } catch (InvocationTargetException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ } catch (SecurityException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ } catch (NoSuchMethodException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ } catch (IllegalArgumentException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
}
- }
- return fPropertySheetPage;
}
- return super.getAdapter(adapter);
- }
- private void setSorter(PropertySheetSorter sorter,
- ConfigurablePropertySheetPage sheet) {
- try {
- Method method = PropertySheetPage.class.getDeclaredMethod(
- "setSorter", new Class[] { PropertySheetSorter.class });
- method.setAccessible(true);
- method.invoke(sheet, new Object[] { sorter });
- } catch (Exception e) {
- JspEditorPlugin.getPluginLog().logError(e);
+ public String getEditorId() {
+ return JSPUIPlugin.ID;
}
- }
- public String getEditorId() {
- return JSPUIPlugin.ID;
- }
+ public IStructuredTextOccurrenceStructureProvider getOccurrencePreferenceProvider() {
+ return fOccurrenceModelUpdater;
+ }
- public IStructuredTextOccurrenceStructureProvider getOccurrencePreferenceProvider() {
- return fOccurrenceModelUpdater;
- }
+ public void createPartControl(Composite parent) {
+ super.createPartControl(parent);
- public void createPartControl(Composite parent) {
- super.createPartControl(parent);
+ StructuredTextOccurrenceStructureProviderRegistry registry = XmlEditorPlugin
+ .getDefault().getOccurrenceStructureProviderRegistry(
+ JspEditorPlugin.PLUGIN_ID);
+ fOccurrenceModelUpdater = registry
+ .getCurrentOccurrenceProvider(JspEditorPlugin.PLUGIN_ID);
- StructuredTextOccurrenceStructureProviderRegistry registry = XmlEditorPlugin
- .getDefault().getOccurrenceStructureProviderRegistry(
- JspEditorPlugin.PLUGIN_ID);
- fOccurrenceModelUpdater = registry
- .getCurrentOccurrenceProvider(JspEditorPlugin.PLUGIN_ID);
+ if (fOccurrenceModelUpdater != null)
+ fOccurrenceModelUpdater.install(this, getTextViewer());
- if (fOccurrenceModelUpdater != null)
- fOccurrenceModelUpdater.install(this, getTextViewer());
+ installActivePropmtSupport();
- installActivePropmtSupport();
+ createDrop();
+ setModified(false);
+ getSourceViewer().removeTextListener(this);
+ getSourceViewer().addTextListener(this);
- createDrop();
- setModified(false);
- getSourceViewer().removeTextListener(this);
- getSourceViewer().addTextListener(this);
+ Object dtid = getSourceViewer().getTextWidget().getData("DropTarget");
+ if (dtid != null) {
+ if (dtid instanceof DropTarget) {
+ DropTarget dropTarget = (DropTarget) dtid;
+ dropTarget.addDropListener(new DropTargetAdapter() {
+ private FreeCaretStyledText getFreeCaretControl(
+ Object sourceOrTarget) {
+ if (sourceOrTarget == null)
+ return null;
- Object dtid = getSourceViewer().getTextWidget().getData("DropTarget");
- if (dtid != null) {
- if (dtid instanceof DropTarget) {
- DropTarget dropTarget = (DropTarget) dtid;
- dropTarget.addDropListener(new DropTargetAdapter() {
- private FreeCaretStyledText getFreeCaretControl(
- Object sourceOrTarget) {
- if (sourceOrTarget == null)
- return null;
+ Object control = null;
- Object control = null;
+ if (sourceOrTarget instanceof DropTarget) {
+ control = ((DropTarget) sourceOrTarget)
+ .getControl();
+ } else if (sourceOrTarget instanceof DragSource) {
+ control = ((DragSource) sourceOrTarget)
+ .getControl();
+ } else
+ return null;
- if (sourceOrTarget instanceof DropTarget) {
- control = ((DropTarget) sourceOrTarget)
- .getControl();
- } else if (sourceOrTarget instanceof DragSource) {
- control = ((DragSource) sourceOrTarget)
- .getControl();
- } else
- return null;
+ if (control instanceof FreeCaretStyledText)
+ return (FreeCaretStyledText) control;
+ return null;
+ }
- if (control instanceof FreeCaretStyledText)
- return (FreeCaretStyledText) control;
- return null;
- }
+ public void dragEnter(DropTargetEvent event) {
+ getFreeCaretControl(event.widget).enableFreeCaret(true);
+ }
- public void dragEnter(DropTargetEvent event) {
- getFreeCaretControl(event.widget).enableFreeCaret(true);
- }
+ public void dragLeave(DropTargetEvent event) {
+ getFreeCaretControl(event.widget)
+ .enableFreeCaret(false);
+ }
- public void dragLeave(DropTargetEvent event) {
- getFreeCaretControl(event.widget)
- .enableFreeCaret(false);
- }
+ public void dragOperationChanged(DropTargetEvent event) {
+ getFreeCaretControl(event.widget)
+ .enableFreeCaret(false);
+ }
- public void dragOperationChanged(DropTargetEvent event) {
- getFreeCaretControl(event.widget)
- .enableFreeCaret(false);
- }
+ public void dragOver(DropTargetEvent event) {
+ FreeCaretStyledText fcst = getFreeCaretControl(event.widget);
+ int pos = getPosition(fcst, event.x, event.y);
+ Point p = fcst.getLocationAtOffset(pos);
+ fcst.myRedraw(p.x, p.y);
+ }
- public void dragOver(DropTargetEvent event) {
- FreeCaretStyledText fcst = getFreeCaretControl(event.widget);
- int pos = getPosition(fcst, event.x, event.y);
- Point p = fcst.getLocationAtOffset(pos);
- fcst.myRedraw(p.x, p.y);
- }
+ public void drop(DropTargetEvent event) {
+ getFreeCaretControl(event.widget)
+ .enableFreeCaret(false);
+ }
+ });
+ }
+ }
+ }
- public void drop(DropTargetEvent event) {
- getFreeCaretControl(event.widget)
- .enableFreeCaret(false);
- }
- });
- }
+ protected ISourceViewer createSourceViewer(Composite parent,
+ IVerticalRuler ruler, int styles) {
+ ISourceViewer sv = super.createSourceViewer(parent, ruler, styles);
+ sv.getTextWidget().addFocusListener(new TextFocusListener());
+ return sv;
}
- }
- protected ISourceViewer createSourceViewer(Composite parent,
- IVerticalRuler ruler, int styles) {
- ISourceViewer sv = super.createSourceViewer(parent, ruler, styles);
- sv.getTextWidget().addFocusListener(new TextFocusListener());
- return sv;
- }
+ protected StructuredTextViewer createStructedTextViewer(Composite parent,
+ IVerticalRuler verticalRuler, int styles) {
+ return new JSPStructuredTextViewer(parent, verticalRuler,
+ getOverviewRuler(), isOverviewRulerVisible(), styles,
+ parentEditor, this);
+ }
- protected StructuredTextViewer createStructedTextViewer(Composite parent,
- IVerticalRuler verticalRuler, int styles) {
- return new JSPStructuredTextViewer(parent, verticalRuler,
- getOverviewRuler(), isOverviewRulerVisible(), styles,
- parentEditor, this);
- }
+ class TextFocusListener extends FocusAdapter {
+ public void focusLost(FocusEvent e) {
+ if (JSPTextEditor.super.isDirty()) {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ try {
+ Thread.sleep(200);
+ } catch (InterruptedException exc) {
+ JspEditorPlugin.getPluginLog().logError(exc);
+ }
+ save();
+ }
+ });
+ }
+ }
+ }
- class TextFocusListener extends FocusAdapter {
- public void focusLost(FocusEvent e) {
- if (JSPTextEditor.super.isDirty()) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
+ public void save() {
+ if (!lock && isModified()) {
+ lock = true;
try {
- Thread.sleep(200);
- } catch (InterruptedException exc) {
- JspEditorPlugin.getPluginLog().logError(exc);
+ FileAnyImpl f = (FileAnyImpl) getModelObject();
+ if (f != null)
+ f.edit(getSourceViewer().getDocument().get());
+ } catch (XModelException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ } finally {
+ setModified(false);
+ lock = false;
}
- save();
- }
- });
- }
+ }
}
- }
- public void save() {
- if (!lock && isModified()) {
- lock = true;
- try {
- FileAnyImpl f = (FileAnyImpl) getModelObject();
- if (f != null)
- f.edit(getSourceViewer().getDocument().get());
- } catch (Exception e) {
- JspEditorPlugin.getPluginLog().logError(e);
- } finally {
- setModified(false);
- lock = false;
- }
+ boolean modified = false;
+
+ public void setModified(boolean set) {
+ if (this.modified != set) {
+ this.modified = set;
+ if (set) {
+ XModelObject o = getModelObject();
+ if (o != null)
+ o.setModified(true);
+ }
+ super.firePropertyChange(IEditorPart.PROP_DIRTY);
+ }
}
- }
- boolean modified = false;
+ public void updateModification() {
+ // added by Max Areshkau
+ // Fix for JBIDE-788
+ getPageContext().refreshBundleValues();
- public void setModified(boolean set) {
- if (this.modified != set) {
- this.modified = set;
- if (set) {
- XModelObject o = getModelObject();
- if (o != null)
- o.setModified(true);
- }
- super.firePropertyChange(IEditorPart.PROP_DIRTY);
+ XModelObject object = getModelObject();
+ if (object != null && !object.isModified() && isModified()) {
+ setModified(false);
+ } else {
+ firePropertyChange(ITextEditor.PROP_DIRTY);
+ }
}
- }
- public void updateModification() {
- // added by Max Areshkau
- // Fix for JBIDE-788
- getPageContext().refreshBundleValues();
-
- XModelObject object = getModelObject();
- if (object != null && !object.isModified() && isModified()) {
- setModified(false);
- } else {
- firePropertyChange(ITextEditor.PROP_DIRTY);
+ public boolean isModified() {
+ return modified;
}
- }
- public boolean isModified() {
- return modified;
- }
-
- protected void doSetInput(IEditorInput input) throws CoreException {
- super.doSetInput(XModelObjectEditorInput.checkInput(input));
- if (getSourceViewer() != null
- && getSourceViewer().getDocument() != null) {
- getSourceViewer().removeTextListener(this);
- getSourceViewer().addTextListener(this);
+ protected void doSetInput(IEditorInput input) throws CoreException {
+ super.doSetInput(XModelObjectEditorInput.checkInput(input));
+ if (getSourceViewer() != null
+ && getSourceViewer().getDocument() != null) {
+ getSourceViewer().removeTextListener(this);
+ getSourceViewer().addTextListener(this);
+ }
+ if (listener != null)
+ listener.dispose();
+ listener = null;
+ XModelObject o = getModelObject();
+ if (o instanceof FileAnyImpl) {
+ listener = new BodyListenerImpl((FileAnyImpl) o);
+ }
}
- if (listener != null)
- listener.dispose();
- listener = null;
- XModelObject o = getModelObject();
- if (o instanceof FileAnyImpl) {
- listener = new BodyListenerImpl((FileAnyImpl) o);
- }
- }
- boolean lock = false;
+ boolean lock = false;
- public boolean isDirty() {
- if (getEditorInput() instanceof IModelObjectEditorInput) {
- XModelObject o = getModelObject();
- if (o != null && o.isModified())
- return true;
- else {
- return isModified();
- }
- } else {
- return super.isDirty();
+ public boolean isDirty() {
+ if (getEditorInput() instanceof IModelObjectEditorInput) {
+ XModelObject o = getModelObject();
+ if (o != null && o.isModified())
+ return true;
+ else {
+ return isModified();
+ }
+ } else {
+ return super.isDirty();
+ }
}
- }
- public void doSave(IProgressMonitor monitor) {
- XModelObject o = getModelObject();
- super.doSave(monitor);
- if (o != null && (monitor == null || !monitor.isCanceled())) {
- if (o != null)
- save();
- if (getEditorInput() instanceof ILocationProvider) {
- XModelObject p = o.getParent();
- if (p instanceof FolderImpl) {
- try {
- ((FolderImpl) p).saveChild(o);
- } catch (XModelException e) {
- ModelPlugin.getPluginLog().logError(e);
+ public void doSave(IProgressMonitor monitor) {
+ XModelObject o = getModelObject();
+ super.doSave(monitor);
+ if (o != null && (monitor == null || !monitor.isCanceled())) {
+ if (o != null)
+ save();
+ if (getEditorInput() instanceof ILocationProvider) {
+ XModelObject p = o.getParent();
+ if (p instanceof FolderImpl) {
+ try {
+ ((FolderImpl) p).saveChild(o);
+ } catch (XModelException e) {
+ ModelPlugin.getPluginLog().logError(e);
+ }
+ }
+ } else {
+ o.setModified(false);
+ XModelObjectLoaderUtil.updateModifiedOnSave(o);
}
+ super.firePropertyChange(IEditorPart.PROP_DIRTY);
}
- } else {
- o.setModified(false);
- XModelObjectLoaderUtil.updateModifiedOnSave(o);
- }
- super.firePropertyChange(IEditorPart.PROP_DIRTY);
}
- }
- public void firePropertyChangeDirty() {
- super.firePropertyChange(IEditorPart.PROP_DIRTY);
- }
+ public void firePropertyChangeDirty() {
+ super.firePropertyChange(IEditorPart.PROP_DIRTY);
+ }
- public XModelObject getModelObject() {
- if (getEditorInput() instanceof IModelObjectEditorInput) {
- return ((IModelObjectEditorInput) getEditorInput())
- .getXModelObject();
+ public XModelObject getModelObject() {
+ if (getEditorInput() instanceof IModelObjectEditorInput) {
+ return ((IModelObjectEditorInput) getEditorInput())
+ .getXModelObject();
+ }
+ return null;
}
- return null;
- }
- class TextEditorDropProviderImpl implements TextEditorDropProvider {
+ class TextEditorDropProviderImpl implements TextEditorDropProvider {
- public ISourceViewer getSourceViewer() {
- return JSPTextEditor.this.getSourceViewer();
- }
+ public ISourceViewer getSourceViewer() {
+ return JSPTextEditor.this.getSourceViewer();
+ }
- public XModelObject getModelObject() {
- return JSPTextEditor.this.getModelObject();
+ public XModelObject getModelObject() {
+ return JSPTextEditor.this.getModelObject();
+ }
+
+ public void insert(Properties p) {
+ PaletteInsertHelper.insertIntoEditor(getSourceViewer(), p);
+ }
+
}
- public void insert(Properties p) {
- PaletteInsertHelper.insertIntoEditor(getSourceViewer(), p);
+ public void textChanged(TextEvent event) {
+ if (event.getDocumentEvent() != null) {
+ setModified(true);
+ }
}
- }
-
- public void textChanged(TextEvent event) {
- if (event.getDocumentEvent() != null) {
- setModified(true);
+ public void doRevertToSaved() {
+ save();
+ XModelObject o = getModelObject();
+ if (o == null) {
+ super.doRevertToSaved();
+ return;
+ }
+ Properties p = new Properties();
+ XActionInvoker.invoke("DiscardActions.Discard", o, p);
+ if (!"true".equals(p.getProperty("done")))
+ return;
+ super.doRevertToSaved();
+ if (o.isModified())
+ o.setModified(false);
+ modified = false;
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ updatePartControl(getEditorInput());
}
- }
- public void doRevertToSaved() {
- save();
- XModelObject o = getModelObject();
- if (o == null) {
- super.doRevertToSaved();
- return;
+ public IAnnotationModel getAnnotationModel() {
+ return getSourceViewer().getAnnotationModel();
}
- Properties p = new Properties();
- XActionInvoker.invoke("DiscardActions.Discard", o, p);
- if (!"true".equals(p.getProperty("done")))
- return;
- super.doRevertToSaved();
- if (o.isModified())
- o.setModified(false);
- modified = false;
- firePropertyChange(IEditorPart.PROP_DIRTY);
- updatePartControl(getEditorInput());
- }
- public IAnnotationModel getAnnotationModel() {
- return getSourceViewer().getAnnotationModel();
- }
+ private WTPTextJspKbConnector wtpTextJspKbConnector;
- private WTPTextJspKbConnector wtpTextJspKbConnector;
+ private void installActivePropmtSupport() {
+ IDocument document = getTextViewer().getDocument();
+ IStructuredModel model = null;
+ if (getDocumentProvider() instanceof IModelProvider) {
+ model = ((IModelProvider) getDocumentProvider())
+ .getModel(getEditorInput());
+ } else {
+ if (document instanceof IStructuredDocument) {
+ model = getModel();
+ }
+ }
+ if (wtpTextJspKbConnector == null
+ && model != null
+ && (getContentType().toLowerCase().indexOf("jsp") != -1 || getContentType()
+ .toLowerCase().indexOf("html") != -1)) {
+ wtpTextJspKbConnector = new WTPTextJspKbConnector(getEditorInput(),
+ document, model);
+ wtpTextJspKbConnector.setTaglibManagerProvider(parentEditor);
+ }
+ }
- private void installActivePropmtSupport() {
- try {
- IDocument document = getTextViewer().getDocument();
- IStructuredModel model = null;
- if (getDocumentProvider() instanceof IModelProvider) {
- model = ((IModelProvider) getDocumentProvider())
- .getModel(getEditorInput());
- } else {
- if (document instanceof IStructuredDocument) {
- model = getModel();
+ private String getContentType() {
+ String type = null;
+ try {
+ type = getModel().getContentTypeIdentifier();
+ } finally {
+ if (type == null)
+ type = "";
}
- }
- if (wtpTextJspKbConnector == null
- && model != null
- && (getContentType().toLowerCase().indexOf("jsp") != -1 || getContentType()
- .toLowerCase().indexOf("html") != -1)) {
- wtpTextJspKbConnector = new WTPTextJspKbConnector(
- getEditorInput(), document, model);
- wtpTextJspKbConnector.setTaglibManagerProvider(parentEditor);
- }
- } catch (Exception x) {
- JspEditorPlugin.getPluginLog().logError(
- "Error while installing active prpmpting support", x);
+ return type;
}
- }
- private String getContentType() {
- String type = null;
- try {
- type = getModel().getContentTypeIdentifier();
- } finally {
- if (type == null)
- type = "";
+ public WTPTextJspKbConnector getWTPTextJspKbConnector() {
+ return wtpTextJspKbConnector;
}
- return type;
- }
- public WTPTextJspKbConnector getWTPTextJspKbConnector() {
- return wtpTextJspKbConnector;
- }
+ public static class JSPStructuredTextViewer extends StructuredTextViewer
+ implements VpeTaglibManagerProvider, IIgnoreSelection {
- public static class JSPStructuredTextViewer extends StructuredTextViewer
- implements VpeTaglibManagerProvider, IIgnoreSelection {
+ boolean insertFromPallete = false;
- boolean insertFromPallete = false;
+ private VpeTaglibManagerProvider provider;
- private VpeTaglibManagerProvider provider;
+ private JSPTextEditor editor;
- private JSPTextEditor editor;
+ private boolean ignore = false;
- private boolean ignore = false;
+ public JSPStructuredTextViewer(Composite parent,
+ IVerticalRuler verticalRuler, int styles) {
+ super(parent, verticalRuler, null, false, styles);
+ }
- public JSPStructuredTextViewer(Composite parent,
- IVerticalRuler verticalRuler, int styles) {
- super(parent, verticalRuler, null, false, styles);
- }
+ public JSPStructuredTextViewer(Composite parent,
+ IVerticalRuler verticalRuler, IOverviewRuler overviewRuler,
+ boolean showAnnotationsOverview, int styles,
+ VpeTaglibManagerProvider provider, JSPTextEditor editor) {
+ super(parent, verticalRuler, overviewRuler,
+ showAnnotationsOverview, styles);
+ this.provider = provider;
+ this.editor = editor;
+ }
- public JSPStructuredTextViewer(Composite parent,
- IVerticalRuler verticalRuler, IOverviewRuler overviewRuler,
- boolean showAnnotationsOverview, int styles,
- VpeTaglibManagerProvider provider, JSPTextEditor editor) {
- super(parent, verticalRuler, overviewRuler,
- showAnnotationsOverview, styles);
- this.provider = provider;
- this.editor = editor;
- }
+ protected StyledText createTextWidget(Composite parent, int styles) {
+ return new FreeCaretStyledText(parent, styles);
+ }
- protected StyledText createTextWidget(Composite parent, int styles) {
- return new FreeCaretStyledText(parent, styles);
- }
+ public VpeTaglibManager getTaglibManager() {
+ // added by Max Areshkau
+ // Fix for JBIDE-788
+ if (getEditor() != null) {
+ if (getEditor().getPageContext() instanceof VpeTaglibManager)
- public VpeTaglibManager getTaglibManager() {
- // added by Max Areshkau
- // Fix for JBIDE-788
- if (getEditor() != null) {
- if (getEditor().getPageContext() instanceof VpeTaglibManager)
+ return (VpeTaglibManager) getEditor().getPageContext();
+ }
+ return null;
+ }
- return (VpeTaglibManager) getEditor().getPageContext();
- }
- return null;
- }
+ public boolean doesIgnore() {
+ return ignore;
+ }
- public boolean doesIgnore() {
- return ignore;
- }
+ public void setIgnore(boolean ignore) {
+ this.ignore = ignore;
+ }
- public void setIgnore(boolean ignore) {
- this.ignore = ignore;
- }
-
- public void doOperation(int operation) {
+ public void doOperation(int operation) {
if (operation == UNDO || operation == REDO
|| operation == FORMAT_DOCUMENT
|| operation == FORMAT_ACTIVE_ELEMENTS) {
@@ -666,15 +670,8 @@
editor.getVPEController().preLongOperation();
}
}
- /*
- * Fixes http://jira.jboss.com/jira/browse/JBIDE-2030
- * Stops ActiveEditorSwitcher in any case.
- * Author: dmaliarevich
- */
try {
super.doOperation(operation);
- } catch (Exception e) {
- JspEditorPlugin.getPluginLog().logError(e);
} finally {
if (operation == UNDO || operation == REDO
|| operation == FORMAT_DOCUMENT
@@ -686,604 +683,603 @@
}
}
- protected void handleDispose() {
- if (editor != null && editor.getSourceViewer() != null
- && editor.getSourceViewer().getTextWidget() != null
- && editor.getVPEController() != null) {
- StyledText widget = editor.getSourceViewer().getTextWidget();
- widget.removeSelectionListener(editor.getVPEController());
- }
- super.handleDispose();
- editor = null;
- provider = null;
+ protected void handleDispose() {
+ if (editor != null && editor.getSourceViewer() != null
+ && editor.getSourceViewer().getTextWidget() != null
+ && editor.getVPEController() != null) {
+ StyledText widget = editor.getSourceViewer().getTextWidget();
+ widget.removeSelectionListener(editor.getVPEController());
+ }
+ super.handleDispose();
+ editor = null;
+ provider = null;
+ }
+
+ /**
+ * @return the editor
+ */
+ // Added By Max Areshkau
+ // Fix for JBIDE-788
+ public JSPTextEditor getEditor() {
+ return editor;
+ }
+
+ /**
+ * @param editor
+ * the editor to set
+ */
+ // Added By Max Areshkau
+ // Fix for JBIDE-788
+ public void setEditor(JSPTextEditor editor) {
+ this.editor = editor;
+ }
+
}
- /**
- * @return the editor
- */
- // Added By Max Areshkau
- // Fix for JBIDE-788
- public JSPTextEditor getEditor() {
- return editor;
+ public JSPMultiPageEditor getParentEditor() {
+ return parentEditor;
}
- /**
- * @param editor
- * the editor to set
- */
- // Added By Max Areshkau
- // Fix for JBIDE-788
- public void setEditor(JSPTextEditor editor) {
- this.editor = editor;
+ public void setVPEController(IVisualController c) {
+ vpeController = c;
}
- }
+ public IVisualController getVPEController() {
+ return vpeController;
+ }
- public JSPMultiPageEditor getParentEditor() {
- return parentEditor;
- }
+ public void runDropCommand(final String flavor, final String data) {
+ XModelBuffer b = XModelTransferBuffer.getInstance().getBuffer();
+ final XModelObject o = b == null ? null : b.source();
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ if (o != null
+ && !XModelTransferBuffer.getInstance().isEnabled()) {
+ XModelTransferBuffer.getInstance().enable();
+ XModelTransferBuffer.getInstance().getBuffer().addSource(o);
+ }
+ try {
+ DropData dropData = new DropData(flavor, data,
+ getEditorInput(), getSourceViewer(),
+ getSelectionProvider());
+ dropData.setAttributeName(dropContext.getAttributeName());
+ IDropCommand dropCommand = DropCommandFactory.getInstance()
+ .getDropCommand(flavor,
+ JSPTagProposalFactory.getInstance());
- public void setVPEController(IVisualController c) {
- vpeController = c;
- }
+ boolean promptAttributes = "yes"
+ .equals(VpePreference.ALWAYS_REQUEST_FOR_ATTRIBUTE
+ .getValue());
+ dropCommand
+ .getDefaultModel()
+ .setPromptForTagAttributesRequired(promptAttributes);
+ dropCommand.execute(dropData);
+ } finally {
+ XModelTransferBuffer.getInstance().disable();
+ }
+ }
+ });
+ }
- public IVisualController getVPEController() {
- return vpeController;
- }
+ private void createDrop() {
+ DropTarget target = new DropTarget(getSourceViewer().getTextWidget(),
+ DND.DROP_MOVE | DND.DROP_COPY);
+ Transfer[] types = new Transfer[] { ModelTransfer.getInstance(),
+ HTMLTransfer.getInstance(), TextTransfer.getInstance(),
+ FileTransfer.getInstance() };
+ target.setTransfer(types);
+ target.addDropListener(new DTL());
+ }
- public void runDropCommand(final String flavor, final String data) {
- XModelBuffer b = XModelTransferBuffer.getInstance().getBuffer();
- final XModelObject o = b == null ? null : b.source();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (o != null
- && !XModelTransferBuffer.getInstance().isEnabled()) {
- XModelTransferBuffer.getInstance().enable();
- XModelTransferBuffer.getInstance().getBuffer().addSource(o);
+ DropContext dropContext = new DropContext();
+
+ class DTL implements DropTargetListener {
+ int lastpos = -1;
+
+ int lastdetail = -1;
+
+ public void dragEnter(DropTargetEvent event) {
+ lastpos = -1;
}
- try {
- DropData dropData = new DropData(flavor, data,
- getEditorInput(), getSourceViewer(),
- getSelectionProvider());
- dropData.setAttributeName(dropContext.getAttributeName());
- IDropCommand dropCommand = DropCommandFactory.getInstance()
- .getDropCommand(flavor,
- JSPTagProposalFactory.getInstance());
- boolean promptAttributes = "yes"
- .equals(VpePreference.ALWAYS_REQUEST_FOR_ATTRIBUTE
- .getValue());
- dropCommand
- .getDefaultModel()
- .setPromptForTagAttributesRequired(promptAttributes);
- dropCommand.execute(dropData);
- } finally {
- XModelTransferBuffer.getInstance().disable();
+ public void dragLeave(DropTargetEvent event) {
+ lastpos = -1;
}
- }
- });
- }
- private void createDrop() {
- DropTarget target = new DropTarget(getSourceViewer().getTextWidget(),
- DND.DROP_MOVE | DND.DROP_COPY);
- Transfer[] types = new Transfer[] {
- ModelTransfer.getInstance(),
- HTMLTransfer.getInstance(), TextTransfer.getInstance(),
- FileTransfer.getInstance() };
- target.setTransfer(types);
- target.addDropListener(new DTL());
- }
+ public void dragOperationChanged(DropTargetEvent event) {
+ }
- DropContext dropContext = new DropContext();
+ public void dragOver(DropTargetEvent event) {
+ if (!isEditable()
+ || (getModelObject() != null && !getModelObject()
+ .isObjectEditable())) {
+ event.detail = DND.DROP_NONE;
+ return;
+ }
+ dropContext.setDropTargetEvent(event);
+ if (dropContext.getFlavor() == null) {
+ event.detail = DND.DROP_NONE;
+ return;
+ }
+ // Drop from VPE to Source is forbidden
+ if (dropContext.getFlavor().equals("text/html")) {
+ if (InnerDragBuffer.object != null) {
+ event.detail = DND.DROP_NONE;
+ }
+ return;
+ }
+ int pos = getPosition(event.x, event.y);
+ if (lastpos == pos && pos >= 0) {
+ pos = lastpos;
+ event.detail = lastdetail;
+ return;
+ }
+ lastpos = pos;
+ dropContext.clean();
+ getSourceViewer().getDocument();
+ IndexedRegion region = getModel().getIndexedRegion(pos);
+ if (region instanceof ElementImpl) {
+ ElementImpl jspElement = (ElementImpl) region;
+ NamedNodeMap attributes = jspElement.getAttributes();
+ if (pos == jspElement.getStartOffset()
+ || pos == jspElement.getEndStartOffset()) {
+ event.detail = lastdetail = DND.DROP_MOVE;
+ return;
+ }
+ for (int i = 0; i < attributes.getLength(); i++) {
+ Node attribute = attributes.item(i);
+ if (attribute instanceof AttrImpl) {
+ AttrImpl jspAttr = (AttrImpl) attribute;
+ ITextRegion valueRegion = jspAttr.getValueRegion();
+ if (valueRegion == null) {
+ event.detail = lastdetail = DND.DROP_NONE;
+ return;
+ }
+ int startPos = jspElement.getStartOffset()
+ + valueRegion.getStart();
+ int endPos = jspElement.getStartOffset()
+ + valueRegion.getTextEnd();
+ if (pos > startPos && pos < endPos) {
+ dropContext.setOverAttributeValue(true);
+ dropContext.setAttributeName(jspAttr.getNodeName());
+ event.detail = lastdetail = DND.DROP_MOVE;
+ return;
+ }
+ }
+ }
+ event.detail = lastdetail = DND.DROP_NONE;
+ } else if (region instanceof Text
+ && isInsideResponseRedirect((Text) region, pos
+ - region.getStartOffset())) {
+ dropContext.setOverAttributeValue(true);
+ event.detail = lastdetail = DND.DROP_MOVE;
+ } else if (region instanceof Text) {
+ event.detail = lastdetail = DND.DROP_MOVE;
+ } else if (region instanceof DocumentType) {
+ event.detail = lastdetail = DND.DROP_NONE;
+ } else if (region == null) {
+ // new place
+ event.detail = lastdetail = DND.DROP_MOVE;
+ }
+ }
- class DTL implements DropTargetListener {
- int lastpos = -1;
+ public void drop(DropTargetEvent event) {
+ int offset = getPosition(event.x, event.y);
+ selectAndReveal(offset, 0);
+ dropContext.runDropCommand(JSPTextEditor.this, event);
+ }
- int lastdetail = -1;
+ public void dropAccept(DropTargetEvent event) {
+ }
- public void dragEnter(DropTargetEvent event) {
- lastpos = -1;
}
- public void dragLeave(DropTargetEvent event) {
- lastpos = -1;
+ private int getPosition(int x, int y) {
+ ISourceViewer v = getSourceViewer();
+ return v == null ? 0 : getPosition(v.getTextWidget(), x, y);
}
- public void dragOperationChanged(DropTargetEvent event) {
- }
-
- public void dragOver(DropTargetEvent event) {
- if (!isEditable()
- || (getModelObject() != null && !getModelObject()
- .isObjectEditable())) {
- event.detail = DND.DROP_NONE;
- return;
- }
- dropContext.setDropTargetEvent(event);
- if (dropContext.getFlavor() == null) {
- event.detail = DND.DROP_NONE;
- return;
- }
- // Drop from VPE to Source is forbidden
- if (dropContext.getFlavor().equals("text/html")) {
- if (InnerDragBuffer.object != null) {
- event.detail = DND.DROP_NONE;
- }
- return;
- }
- int pos = getPosition(event.x, event.y);
- if (lastpos == pos && pos >= 0) {
- pos = lastpos;
- event.detail = lastdetail;
- return;
- }
- lastpos = pos;
- dropContext.clean();
- getSourceViewer().getDocument();
- IndexedRegion region = getModel().getIndexedRegion(pos);
- if (region instanceof ElementImpl) {
- ElementImpl jspElement = (ElementImpl) region;
- NamedNodeMap attributes = jspElement.getAttributes();
- if (pos == jspElement.getStartOffset()
- || pos == jspElement.getEndStartOffset()) {
- event.detail = lastdetail = DND.DROP_MOVE;
- return;
- }
- for (int i = 0; i < attributes.getLength(); i++) {
- Node attribute = attributes.item(i);
- if (attribute instanceof AttrImpl) {
- AttrImpl jspAttr = (AttrImpl) attribute;
- ITextRegion valueRegion = jspAttr.getValueRegion();
- if (valueRegion == null) {
- event.detail = lastdetail = DND.DROP_NONE;
- return;
+ private int getPosition(StyledText t, int x, int y) {
+ if (t == null || t.isDisposed())
+ return 0;
+ Point pp = t.toControl(x, y);
+ x = pp.x;
+ y = pp.y;
+ int lineIndex = (t.getTopPixel() + y) / t.getLineHeight();
+ if (lineIndex >= t.getLineCount()) {
+ return t.getCharCount();
+ } else {
+ int c = 0;
+ try {
+ c = t.getOffsetAtLocation(new Point(x, y));
+ if (c < 0)
+ c = 0;
+ } catch (IllegalArgumentException ex) {
+ // do not log, catching that exception is
+ // the way to know that we are out of line.
+ if (lineIndex + 1 >= t.getLineCount()) {
+ return t.getCharCount();
+ }
+ c = t.getOffsetAtLine(lineIndex + 1)
+ - (t.getLineDelimiter() == null ? 0 : t
+ .getLineDelimiter().length());
}
- int startPos = jspElement.getStartOffset()
- + valueRegion.getStart();
- int endPos = jspElement.getStartOffset()
- + valueRegion.getTextEnd();
- if (pos > startPos && pos < endPos) {
- dropContext.setOverAttributeValue(true);
- dropContext.setAttributeName(jspAttr.getNodeName());
- event.detail = lastdetail = DND.DROP_MOVE;
- return;
- }
- }
+ return c;
}
- event.detail = lastdetail = DND.DROP_NONE;
- } else if (region instanceof Text
- && isInsideResponseRedirect((Text) region, pos
- - region.getStartOffset())) {
- dropContext.setOverAttributeValue(true);
- event.detail = lastdetail = DND.DROP_MOVE;
- } else if (region instanceof Text) {
- event.detail = lastdetail = DND.DROP_MOVE;
- } else if (region instanceof DocumentType) {
- event.detail = lastdetail = DND.DROP_NONE;
- } else if (region == null) {
- // new place
- event.detail = lastdetail = DND.DROP_MOVE;
- }
}
- public void drop(DropTargetEvent event) {
- int offset = getPosition(event.x, event.y);
- selectAndReveal(offset, 0);
- dropContext.runDropCommand(JSPTextEditor.this, event);
+ public String[] getConfigurationPoints() {
+ String contentTypeIdentifierID = null;
+ if (getModel() != null)
+ contentTypeIdentifierID = getModel().getContentTypeIdentifier();
+ return ConfigurationPointCalculator.getConfigurationPoints(this,
+ contentTypeIdentifierID, ConfigurationPointCalculator.SOURCE,
+ StructuredTextEditor.class);
}
- public void dropAccept(DropTargetEvent event) {
- }
+ public void formatTextRegion(IDocument document, IRegion region) {
+ SourceViewerConfiguration conf = getSourceViewerConfiguration();
- }
-
- private int getPosition(int x, int y) {
- ISourceViewer v = getSourceViewer();
- return v == null ? 0 : getPosition(v.getTextWidget(), x, y);
- }
-
- private int getPosition(StyledText t, int x, int y) {
- if (t == null || t.isDisposed())
- return 0;
- Point pp = t.toControl(x, y);
- x = pp.x;
- y = pp.y;
- int lineIndex = (t.getTopPixel() + y) / t.getLineHeight();
- if (lineIndex >= t.getLineCount()) {
- return t.getCharCount();
- } else {
- int c = 0;
- try {
- c = t.getOffsetAtLocation(new Point(x, y));
- if (c < 0)
- c = 0;
- } catch (IllegalArgumentException ex) {
- // do not log, catching that exception is
- // the way to know that we are out of line.
- if (lineIndex + 1 >= t.getLineCount()) {
- return t.getCharCount();
+ if (conf instanceof StructuredTextViewerConfiguration) {
+ StructuredTextViewerConfiguration stvc = (StructuredTextViewerConfiguration) conf;
+ IContentFormatter f = stvc.getContentFormatter(getSourceViewer());
+ f.format(document, region);
}
- c = t.getOffsetAtLine(lineIndex + 1)
- - (t.getLineDelimiter() == null ? 0 : t
- .getLineDelimiter().length());
- }
- return c;
}
- }
- public String[] getConfigurationPoints() {
- String contentTypeIdentifierID = null;
- if (getModel() != null)
- contentTypeIdentifierID = getModel().getContentTypeIdentifier();
- return ConfigurationPointCalculator.getConfigurationPoints(this,
- contentTypeIdentifierID, ConfigurationPointCalculator.SOURCE,
- StructuredTextEditor.class);
- }
+ Point storedSelection = new Point(0, 0);
- public void formatTextRegion(IDocument document, IRegion region) {
- SourceViewerConfiguration conf = getSourceViewerConfiguration();
-
- if (conf instanceof StructuredTextViewerConfiguration) {
- StructuredTextViewerConfiguration stvc = (StructuredTextViewerConfiguration) conf;
- IContentFormatter f = stvc.getContentFormatter(getSourceViewer());
- f.format(document, region);
- }
- }
-
- Point storedSelection = new Point(0, 0);
-
- protected void handleCursorPositionChanged() {
- super.handleCursorPositionChanged();
- ISelection selection = getSelectionProvider().getSelection();
- Point p = getTextViewer().getTextWidget().getSelection();
- if (storedSelection == null || !storedSelection.equals(p)) {
- storedSelection = p;
- if (selection instanceof ITextSelection) {
- ITextSelection ts = (ITextSelection) selection;
- if (ts.getLength() == 0) {
- if (vpeController != null) {
- vpeController
- .selectionChanged(new SelectionChangedEvent(
- getSelectionProvider(),
- getSelectionProvider().getSelection()));
- }
+ protected void handleCursorPositionChanged() {
+ super.handleCursorPositionChanged();
+ ISelection selection = getSelectionProvider().getSelection();
+ Point p = getTextViewer().getTextWidget().getSelection();
+ if (storedSelection == null || !storedSelection.equals(p)) {
+ storedSelection = p;
+ if (selection instanceof ITextSelection) {
+ ITextSelection ts = (ITextSelection) selection;
+ if (ts.getLength() == 0) {
+ if (vpeController != null) {
+ vpeController
+ .selectionChanged(new SelectionChangedEvent(
+ getSelectionProvider(),
+ getSelectionProvider().getSelection()));
+ }
+ }
+ }
}
- }
}
- }
- static int firingSelectionFailedCount = 0;
+ static int firingSelectionFailedCount = 0;
- private class OutlinePageListener implements IDoubleClickListener,
- ISelectionChangedListener {
- public void doubleClick(DoubleClickEvent event) {
- if (event.getSelection().isEmpty())
- return;
+ private class OutlinePageListener implements IDoubleClickListener,
+ ISelectionChangedListener {
+ public void doubleClick(DoubleClickEvent event) {
+ if (event.getSelection().isEmpty())
+ return;
- int start = -1;
- int length = 0;
- if (event.getSelection() instanceof IStructuredSelection) {
- ISelection currentSelection = getSelectionProvider()
- .getSelection();
- if (currentSelection instanceof IStructuredSelection) {
- Object current = ((IStructuredSelection) currentSelection)
- .toArray();
- Object newSelection = ((IStructuredSelection) event
- .getSelection()).toArray();
- if (!current.equals(newSelection)) {
- IStructuredSelection selection = (IStructuredSelection) event
- .getSelection();
- Object o = selection.getFirstElement();
- if (o instanceof IndexedRegion) {
- start = ((IndexedRegion) o).getStartOffset();
- length = ((IndexedRegion) o).getEndOffset() - start;
- } else if (o instanceof ITextRegion) {
- start = ((ITextRegion) o).getStart();
- length = ((ITextRegion) o).getEnd() - start;
- } else if (o instanceof IRegion) {
- start = ((ITextRegion) o).getStart();
- length = ((ITextRegion) o).getLength();
+ int start = -1;
+ int length = 0;
+ if (event.getSelection() instanceof IStructuredSelection) {
+ ISelection currentSelection = getSelectionProvider()
+ .getSelection();
+ if (currentSelection instanceof IStructuredSelection) {
+ Object current = ((IStructuredSelection) currentSelection)
+ .toArray();
+ Object newSelection = ((IStructuredSelection) event
+ .getSelection()).toArray();
+ if (!current.equals(newSelection)) {
+ IStructuredSelection selection = (IStructuredSelection) event
+ .getSelection();
+ Object o = selection.getFirstElement();
+ if (o instanceof IndexedRegion) {
+ start = ((IndexedRegion) o).getStartOffset();
+ length = ((IndexedRegion) o).getEndOffset() - start;
+ } else if (o instanceof ITextRegion) {
+ start = ((ITextRegion) o).getStart();
+ length = ((ITextRegion) o).getEnd() - start;
+ } else if (o instanceof IRegion) {
+ start = ((ITextRegion) o).getStart();
+ length = ((ITextRegion) o).getLength();
+ }
+ }
+ }
+ } else if (event.getSelection() instanceof ITextSelection) {
+ start = ((ITextSelection) event.getSelection()).getOffset();
+ length = ((ITextSelection) event.getSelection()).getLength();
}
- }
+ if (start > -1) {
+ getSourceViewer().setRangeIndication(start, length, false);
+ selectAndReveal(start, length);
+ }
}
- } else if (event.getSelection() instanceof ITextSelection) {
- start = ((ITextSelection) event.getSelection()).getOffset();
- length = ((ITextSelection) event.getSelection()).getLength();
- }
- if (start > -1) {
- getSourceViewer().setRangeIndication(start, length, false);
- selectAndReveal(start, length);
- }
- }
- public void selectionChanged(SelectionChangedEvent event) {
- if (event.getSelection().isEmpty() || isFiringSelection())
- return;
+ public void selectionChanged(SelectionChangedEvent event) {
+ if (event.getSelection().isEmpty() || isFiringSelection())
+ return;
- boolean ignoreSelection = false;
- if (getSourceViewer() != null
- && getSourceViewer() instanceof IIgnoreSelection) {
- IIgnoreSelection is = ((IIgnoreSelection) getSourceViewer());
- ignoreSelection = is.doesIgnore();
- }
- if (getSourceViewer() != null
- && getSourceViewer().getTextWidget() != null
- && !getSourceViewer().getTextWidget().isDisposed()
- && !getSourceViewer().getTextWidget().isFocusControl()
- && !ignoreSelection) {
- int start = -1;
- int length = 0;
- if (event.getSelection() instanceof IStructuredSelection) {
- ISelection current = getSelectionProvider().getSelection();
- if (current instanceof IStructuredSelection) {
- Object[] currentSelection = ((IStructuredSelection) current)
- .toArray();
- Object[] newSelection = ((IStructuredSelection) event
- .getSelection()).toArray();
- if (!Arrays.equals(currentSelection, newSelection)) {
- if (newSelection.length > 0) {
- /*
- * No ordering is guaranteed for multiple
- * selection
- */
- Object o = newSelection[0];
- if (o instanceof IndexedRegion) {
- start = ((IndexedRegion) o)
- .getStartOffset();
- int end = ((IndexedRegion) o)
- .getEndOffset();
- if (newSelection.length > 1) {
- for (int i = 1; i < newSelection.length; i++) {
- start = Math
- .min(
- start,
- ((IndexedRegion) newSelection[i])
- .getStartOffset());
- end = Math
- .max(
- end,
- ((IndexedRegion) newSelection[i])
- .getEndOffset());
+ boolean ignoreSelection = false;
+ if (getSourceViewer() != null
+ && getSourceViewer() instanceof IIgnoreSelection) {
+ IIgnoreSelection is = ((IIgnoreSelection) getSourceViewer());
+ ignoreSelection = is.doesIgnore();
+ }
+ if (getSourceViewer() != null
+ && getSourceViewer().getTextWidget() != null
+ && !getSourceViewer().getTextWidget().isDisposed()
+ && !getSourceViewer().getTextWidget().isFocusControl()
+ && !ignoreSelection) {
+ int start = -1;
+ int length = 0;
+ if (event.getSelection() instanceof IStructuredSelection) {
+ ISelection current = getSelectionProvider().getSelection();
+ if (current instanceof IStructuredSelection) {
+ Object[] currentSelection = ((IStructuredSelection) current)
+ .toArray();
+ Object[] newSelection = ((IStructuredSelection) event
+ .getSelection()).toArray();
+ if (!Arrays.equals(currentSelection, newSelection)) {
+ if (newSelection.length > 0) {
+ /*
+ * No ordering is guaranteed for multiple
+ * selection
+ */
+ Object o = newSelection[0];
+ if (o instanceof IndexedRegion) {
+ start = ((IndexedRegion) o)
+ .getStartOffset();
+ int end = ((IndexedRegion) o)
+ .getEndOffset();
+ if (newSelection.length > 1) {
+ for (int i = 1; i < newSelection.length; i++) {
+ start = Math
+ .min(
+ start,
+ ((IndexedRegion) newSelection[i])
+ .getStartOffset());
+ end = Math
+ .max(
+ end,
+ ((IndexedRegion) newSelection[i])
+ .getEndOffset());
+ }
+ length = end - start;
+ }
+ } else if (o instanceof ITextRegion) {
+ start = ((ITextRegion) o).getStart();
+ int end = ((ITextRegion) o).getEnd();
+ if (newSelection.length > 1) {
+ for (int i = 1; i < newSelection.length; i++) {
+ start = Math
+ .min(
+ start,
+ ((ITextRegion) newSelection[i])
+ .getStart());
+ end = Math
+ .max(
+ end,
+ ((ITextRegion) newSelection[i])
+ .getEnd());
+ }
+ length = end - start;
+ }
+ } else if (o instanceof IRegion) {
+ start = ((IRegion) o).getOffset();
+ int end = start + ((IRegion) o).getLength();
+ if (newSelection.length > 1) {
+ for (int i = 1; i < newSelection.length; i++) {
+ start = Math.min(start,
+ ((IRegion) newSelection[i])
+ .getOffset());
+ end = Math
+ .max(
+ end,
+ ((IRegion) newSelection[i])
+ .getOffset()
+ + ((IRegion) newSelection[i])
+ .getLength());
+ }
+ length = end - start;
+ }
+ }
+ }
+ }
}
- length = end - start;
- }
- } else if (o instanceof ITextRegion) {
- start = ((ITextRegion) o).getStart();
- int end = ((ITextRegion) o).getEnd();
- if (newSelection.length > 1) {
- for (int i = 1; i < newSelection.length; i++) {
- start = Math
- .min(
- start,
- ((ITextRegion) newSelection[i])
- .getStart());
- end = Math
- .max(
- end,
- ((ITextRegion) newSelection[i])
- .getEnd());
- }
- length = end - start;
- }
- } else if (o instanceof IRegion) {
- start = ((IRegion) o).getOffset();
- int end = start + ((IRegion) o).getLength();
- if (newSelection.length > 1) {
- for (int i = 1; i < newSelection.length; i++) {
- start = Math.min(start,
- ((IRegion) newSelection[i])
- .getOffset());
- end = Math
- .max(
- end,
- ((IRegion) newSelection[i])
- .getOffset()
- + ((IRegion) newSelection[i])
- .getLength());
- }
- length = end - start;
- }
+ } else if (event.getSelection() instanceof ITextSelection) {
+ start = ((ITextSelection) event.getSelection()).getOffset();
}
- }
+ if (start > -1) {
+ updateRangeIndication0(event.getSelection());
+ selectAndReveal(start, length);
+ }
}
- }
- } else if (event.getSelection() instanceof ITextSelection) {
- start = ((ITextSelection) event.getSelection()).getOffset();
}
- if (start > -1) {
- updateRangeIndication0(event.getSelection());
- selectAndReveal(start, length);
+
+ Method m = null;
+
+ private boolean isFiringSelection() {
+ if (getSelectionProvider() == null)
+ return false;
+ if (firingSelectionFailedCount > 0)
+ return false;
+ try {
+ if (m == null) {
+ Class c = getSelectionProvider().getClass();
+ m = c.getDeclaredMethod("isFiringSelection", new Class[0]);
+ m.setAccessible(true);
+ }
+ Boolean b = (Boolean) m.invoke(getSelectionProvider(),
+ new Object[0]);
+ return b.booleanValue();
+ } catch (Exception e) {
+ firingSelectionFailedCount++;
+ JspEditorPlugin.getPluginLog().logError(e);
+ }
+ return false;
}
- }
}
- Method m = null;
-
- private boolean isFiringSelection() {
- if (getSelectionProvider() == null)
- return false;
- if (firingSelectionFailedCount > 0)
- return false;
- try {
- if (m == null) {
- Class c = getSelectionProvider().getClass();
- m = c.getDeclaredMethod("isFiringSelection", new Class[0]);
- m.setAccessible(true);
+ private void updateRangeIndication0(ISelection selection) {
+ if (selection instanceof IStructuredSelection
+ && !((IStructuredSelection) selection).isEmpty()) {
+ Object[] objects = ((IStructuredSelection) selection).toArray();
+ if (objects.length > 0) {
+ int start = ((IndexedRegion) objects[0]).getStartOffset();
+ int end = ((IndexedRegion) objects[objects.length - 1])
+ .getEndOffset();
+ getSourceViewer().setRangeIndication(start, end - start, false);
+ } else {
+ getSourceViewer().removeRangeIndication();
+ }
+ } else {
+ if (selection instanceof ITextSelection) {
+ getSourceViewer().setRangeIndication(
+ ((ITextSelection) selection).getOffset(),
+ ((ITextSelection) selection).getLength(), false);
+ } else {
+ getSourceViewer().removeRangeIndication();
+ }
}
- Boolean b = (Boolean) m.invoke(getSelectionProvider(),
- new Object[0]);
- return b.booleanValue();
- } catch (Exception e) {
- firingSelectionFailedCount++;
- JspEditorPlugin.getPluginLog().logError(e);
- }
- return false;
}
- }
- private void updateRangeIndication0(ISelection selection) {
- if (selection instanceof IStructuredSelection
- && !((IStructuredSelection) selection).isEmpty()) {
- Object[] objects = ((IStructuredSelection) selection).toArray();
- if (objects.length > 0) {
- int start = ((IndexedRegion) objects[0]).getStartOffset();
- int end = ((IndexedRegion) objects[objects.length - 1])
- .getEndOffset();
- getSourceViewer().setRangeIndication(start, end - start, false);
- } else {
- getSourceViewer().removeRangeIndication();
- }
- } else {
- if (selection instanceof ITextSelection) {
- getSourceViewer().setRangeIndication(
- ((ITextSelection) selection).getOffset(),
- ((ITextSelection) selection).getLength(), false);
- } else {
- getSourceViewer().removeRangeIndication();
- }
+ protected IExtendedAction createExtendedAction(String actionID) {
+ if (StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT
+ .equals(actionID)
+ || ITextEditorActionConstants.UNDO.equals(actionID)
+ || ITextEditorActionConstants.REDO.equals(actionID)) {
+ return new ExtendedFormatAction(this, actionID);
+ }
+ return null;
}
- }
- protected IExtendedAction createExtendedAction(String actionID) {
- if (StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT
- .equals(actionID)
- || ITextEditorActionConstants.UNDO.equals(actionID)
- || ITextEditorActionConstants.REDO.equals(actionID)) {
- return new ExtendedFormatAction(this, actionID);
+ protected void initializeEditor() {
+ super.initializeEditor();
+ getPreferenceStore();
}
- return null;
- }
- protected void initializeEditor() {
- super.initializeEditor();
- getPreferenceStore();
- }
+ public void dispose() {
+ // some things in the configuration need to clean
+ // up after themselves
+ if (dnd != null) {
+ dnd.setTextEditorDropProvider(null);
+ dnd = null;
+ }
+ textEditorDropProvider = null;
+ getSourceViewer().removeTextListener(this);
+ if (fOutlinePage != null) {
+ if (fOutlinePage instanceof ConfigurableContentOutlinePage
+ && fOutlinePageListener != null) {
+ ((ConfigurableContentOutlinePage) fOutlinePage)
+ .removeDoubleClickListener(fOutlinePageListener);
+ }
+ if (fOutlinePageListener != null) {
+ fOutlinePage
+ .removeSelectionChangedListener(fOutlinePageListener);
+ }
+ }
+ fOutlinePage = null;
+ fOutlinePageListener = null;
+ if (fOccurrenceModelUpdater != null) {
+ fOccurrenceModelUpdater.uninstall();
+ fOccurrenceModelUpdater = null;
+ }
+ fPropertySheetPage = null;
+ if (pageContext != null) {
+ pageContext.dispose();
+ pageContext = null;
+ }
- public void dispose() {
- // some things in the configuration need to clean
- // up after themselves
- if (dnd != null) {
- dnd.setTextEditorDropProvider(null);
- dnd = null;
+ if (wtpTextJspKbConnector != null) {
+ wtpTextJspKbConnector.setTaglibManagerProvider(null);
+ wtpTextJspKbConnector.dispose();
+ wtpTextJspKbConnector = null;
+ }
+ super.dispose();
+ if (listener != null)
+ listener.dispose();
+ listener = null;
+ ISelectionProvider provider = getSelectionProvider();
+ if (provider != null) {
+ provider
+ .removeSelectionChangedListener(getSelectionChangedListener());
+ }
}
- textEditorDropProvider = null;
- getSourceViewer().removeTextListener(this);
- if (fOutlinePage != null) {
- if (fOutlinePage instanceof ConfigurableContentOutlinePage
- && fOutlinePageListener != null) {
- ((ConfigurableContentOutlinePage) fOutlinePage)
- .removeDoubleClickListener(fOutlinePageListener);
- }
- if (fOutlinePageListener != null) {
- fOutlinePage
- .removeSelectionChangedListener(fOutlinePageListener);
- }
- }
- fOutlinePage = null;
- fOutlinePageListener = null;
- if (fOccurrenceModelUpdater != null) {
- fOccurrenceModelUpdater.uninstall();
- fOccurrenceModelUpdater = null;
- }
- fPropertySheetPage = null;
- if (pageContext != null) {
- pageContext.dispose();
- pageContext = null;
- }
- if (wtpTextJspKbConnector != null) {
- wtpTextJspKbConnector.setTaglibManagerProvider(null);
- wtpTextJspKbConnector.dispose();
- wtpTextJspKbConnector = null;
- }
- super.dispose();
- if (listener != null)
- listener.dispose();
- listener = null;
- ISelectionProvider provider = getSelectionProvider();
- if (provider != null) {
- provider
- .removeSelectionChangedListener(getSelectionChangedListener());
- }
- }
+ BodyListenerImpl listener = null;
- BodyListenerImpl listener = null;
+ class BodyListenerImpl implements FileAnyImpl.BodyListener {
+ FileAnyImpl file;
- class BodyListenerImpl implements FileAnyImpl.BodyListener {
- FileAnyImpl file;
+ BodyListenerImpl(FileAnyImpl file) {
+ this.file = file;
+ file.addListener(this);
+ }
- BodyListenerImpl(FileAnyImpl file) {
- this.file = file;
- file.addListener(this);
- }
+ public void bodyChanged(String body) {
+ setText(body);
+ }
- public void bodyChanged(String body) {
- setText(body);
+ public void dispose() {
+ file.removeListener(this);
+ }
}
- public void dispose() {
- file.removeListener(this);
+ public void setText(String text) {
+ if (getSourceViewer() == null
+ || getSourceViewer().getDocument() == null)
+ return;
+ String txt = getSourceViewer().getDocument().get();
+ if (txt != null && txt.length() > 0) {
+ if (!TextMerge.replace(getSourceViewer().getDocument(), text)) {
+ getSourceViewer().getDocument().set(text);
+ }
+ } else {
+ getSourceViewer().getDocument().set(text);
+ }
}
- }
- public void setText(String text) {
- if (getSourceViewer() == null
- || getSourceViewer().getDocument() == null)
- return;
- String txt = getSourceViewer().getDocument().get();
- if (txt != null && txt.length() > 0) {
- if (!TextMerge.replace(getSourceViewer().getDocument(), text)) {
- getSourceViewer().getDocument().set(text);
- }
- } else {
- getSourceViewer().getDocument().set(text);
- }
- }
-
- boolean isInsideResponseRedirect(Text textNode, int off) {
- if (off < 0)
- return false;
- String START = "response.sendRedirect(\"";
- String END = "\")";
- String text = textNode.getNodeValue();
- int i = 0;
- while (i < text.length() && i < off) {
- int i1 = text.indexOf(START, i);
- if (i1 < 0 || i1 + START.length() > off)
+ boolean isInsideResponseRedirect(Text textNode, int off) {
+ if (off < 0)
+ return false;
+ String START = "response.sendRedirect(\"";
+ String END = "\")";
+ String text = textNode.getNodeValue();
+ int i = 0;
+ while (i < text.length() && i < off) {
+ int i1 = text.indexOf(START, i);
+ if (i1 < 0 || i1 + START.length() > off)
+ return false;
+ int i2 = text.indexOf(END, i1 + START.length());
+ if (i2 < 0 || i2 >= off)
+ return true;
+ i = i2 + END.length();
+ }
return false;
- int i2 = text.indexOf(END, i1 + START.length());
- if (i2 < 0 || i2 >= off)
- return true;
- i = i2 + END.length();
}
- return false;
- }
- @Override
- public void editorContextMenuAboutToShow(IMenuManager menu) {
+ @Override
+ public void editorContextMenuAboutToShow(IMenuManager menu) {
- super.editorContextMenuAboutToShow(menu);
+ super.editorContextMenuAboutToShow(menu);
- /*
- * added by Dmitrovich Sergey JBIDE-1373 so as StructuredTextEditor
- * create context menu by hard code. The easiest way to add "show in"
- * menu is insert to prepared by
- * StructuredTextEditorStructuredTextEditor
- */
+ /*
+ * added by Dmitrovich Sergey JBIDE-1373 so as StructuredTextEditor
+ * create context menu by hard code. The easiest way to add "show in"
+ * menu is insert to prepared by
+ * StructuredTextEditorStructuredTextEditor
+ */
- MenuManager showInSubMenu = new MenuManager(getShowInMenuLabel());
- showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN
- .create(getEditorSite().getWorkbenchWindow()));
- menu.insertBefore(ITextEditorActionConstants.GROUP_COPY, new Separator(
- ITextEditorActionConstants.GROUP_SHOW_IN));
- menu.appendToGroup(ITextEditorActionConstants.GROUP_SHOW_IN,
- showInSubMenu);
+ MenuManager showInSubMenu = new MenuManager(getShowInMenuLabel());
+ showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN
+ .create(getEditorSite().getWorkbenchWindow()));
+ menu.insertBefore(ITextEditorActionConstants.GROUP_COPY, new Separator(
+ ITextEditorActionConstants.GROUP_SHOW_IN));
+ menu.appendToGroup(ITextEditorActionConstants.GROUP_SHOW_IN,
+ showInSubMenu);
- }
+ }
- private String getShowInMenuLabel() {
+ private String getShowInMenuLabel() {
- return JSPEditorMessages.getString(SHOW_IN_MENU);
- }
+ return JSPEditorMessages.getString(SHOW_IN_MENU);
+ }
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPTextJspKbConnector.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPTextJspKbConnector.java 2008-07-24 16:22:57 UTC (rev 9273)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPTextJspKbConnector.java 2008-07-24 17:51:26 UTC (rev 9274)
@@ -131,8 +131,12 @@
registerResource(fTaglibResource);
}
invokeDelayedUpdateKnownTagLists();
- } catch(Exception e) {
+ } catch(ClassNotFoundException e) {
JspEditorPlugin.getPluginLog().logError(e);
+ } catch (InstantiationException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
}
}
@@ -276,12 +280,8 @@
NodeList children = (NodeContainer)dom.getChildNodes();
if (element != null) {
for (int i = 0; children != null && i < children.getLength(); i++) {
- try {
- IDOMNode xmlnode = (IDOMNode)children.item(i);
- update((IDOMNode)xmlnode);
- } catch (Exception x) {
- JspEditorPlugin.getPluginLog().logError("Error while updating known tag lists", x);
- }
+ IDOMNode xmlnode = (IDOMNode)children.item(i);
+ update((IDOMNode)xmlnode);
}
}
}
@@ -331,27 +331,23 @@
}
private void registerKbResourceForNode(IDOMNode node) {
- try {
- if (node == null) return;
- String name = node.getNodeName();
- if (name == null) return;
- if (!name.endsWith("loadBundle")) return;
- if (name.indexOf(':') == -1) return;
- String prefix = name.substring(0, name.indexOf(':'));
+ if (node == null) return;
+ String name = node.getNodeName();
+ if (name == null) return;
+ if (!name.endsWith("loadBundle")) return;
+ if (name.indexOf(':') == -1) return;
+ String prefix = name.substring(0, name.indexOf(':'));
- if (!trackers.containsKey(prefix)) return;
+ if (!trackers.containsKey(prefix)) return;
- NamedNodeMap attributes = node.getAttributes();
- if (attributes == null) return;
- String basename = (attributes.getNamedItem("basename") == null ? null : attributes.getNamedItem("basename").getNodeValue());
- String var = (attributes.getNamedItem("var") == null ? null : attributes.getNamedItem("var").getNodeValue());
- if (basename == null || basename.length() == 0 ||
- var == null || var.length() == 0) return;
+ NamedNodeMap attributes = node.getAttributes();
+ if (attributes == null) return;
+ String basename = (attributes.getNamedItem("basename") == null ? null : attributes.getNamedItem("basename").getNodeValue());
+ String var = (attributes.getNamedItem("var") == null ? null : attributes.getNamedItem("var").getNodeValue());
+ if (basename == null || basename.length() == 0 ||
+ var == null || var.length() == 0) return;
- loadedBundles.put(var, new LoadBundleInfo(node, basename, var));
- } catch (Exception x) {
- JspEditorPlugin.getPluginLog().logError("Error while registering kb resource", x);
- }
+ loadedBundles.put(var, new LoadBundleInfo(node, basename, var));
}
public void dispose() {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/ImportWebProjectContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/ImportWebProjectContext.java 2008-07-24 16:22:57 UTC (rev 9273)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/ImportWebProjectContext.java 2008-07-24 17:51:26 UTC (rev 9274)
@@ -226,7 +226,7 @@
File f = new File(location);
long last = f.isFile() ? f.lastModified() : -1;
return webXMLTimeStamp == last;
- } catch (Exception e) {
+ } catch (SecurityException e) {
WebModelPlugin.getPluginLog().logError(e);
return webXMLTimeStamp == -1;
}
@@ -237,16 +237,12 @@
if(entity == null || !entity.startsWith("FileWebApp")) { //$NON-NLS-1$
throw new XModelException(NLS.bind(WebUIMessages.FILE_ISNOT_RECOGNIZED, location));
}
- try {
- webxml = getTarget().getModel().createModelObject(entity, null);
- webxml.setAttributeValue("name", "web"); //$NON-NLS-1$ //$NON-NLS-2$
- XModelObjectLoaderUtil.setTempBody(webxml, body);
- XModelObjectLoaderUtil.getObjectLoader(webxml).load(webxml);
- webxml.getChildren();
- } catch (Exception e) {
- String webXMLErrorMessage = NLS.bind(WebUIMessages.CANNOT_LOAD_WEBDESCRIPTOR,location);
- throw new XModelException(webXMLErrorMessage);
- }
+ webxml = getTarget().getModel().createModelObject(entity, null);
+ webxml.setAttributeValue("name", "web"); //$NON-NLS-1$ //$NON-NLS-2$
+ XModelObjectLoaderUtil.setTempBody(webxml, body);
+ XModelObjectLoaderUtil.getObjectLoader(webxml).load(webxml);
+ webxml.getChildren();
+
if("yes".equals(webxml.getAttributeValue("isIncorrect"))) { //$NON-NLS-1$ //$NON-NLS-2$
String[] errors = ((AbstractXMLFileImpl)webxml).getErrors();
String error = (errors == null || errors.length == 0) ? "" : ": " + errors[0]; //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/ImportWebWarContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/ImportWebWarContext.java 2008-07-24 16:22:57 UTC (rev 9273)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/ImportWebWarContext.java 2008-07-24 17:51:26 UTC (rev 9274)
@@ -11,6 +11,7 @@
package org.jboss.tools.jst.web.context;
import java.io.File;
+import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.HashSet;
@@ -18,6 +19,7 @@
import java.util.Set;
import java.util.StringTokenizer;
import java.util.zip.ZipEntry;
+import java.util.zip.ZipException;
import java.util.zip.ZipFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -26,6 +28,7 @@
import org.eclipse.osgi.util.NLS;
import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
@@ -74,16 +77,20 @@
try {
zip = new ZipFile(f);
loadEntries();
- } catch (Exception e) {
+ } catch (ZipException e) {
WebModelPlugin.getPluginLog().logError(e);
warError = NLS.bind(WebUIMessages.FILE_ISNOT_CORRECT,location);
return;
+ } catch (IOException e) {
+ WebModelPlugin.getPluginLog().logError(e);
+ warError = NLS.bind(WebUIMessages.FILE_ISNOT_CORRECT,location);
+ return;
}
ZipEntry entry = null;
try {
entry = zip.getEntry("WEB-INF/web.xml");
- } catch (Exception e) {
- //ignore and check entry == null later
+ } catch (IllegalStateException e) {
+ WebModelPlugin.getPluginLog().logError(e);
}
if(entry == null) {
warError = NLS.bind(WebUIMessages.FILE_DOESNOT_CONTAIN_WEBXML,location);
@@ -93,14 +100,18 @@
try {
InputStream s = zip.getInputStream(entry);
body = FileUtil.readStream(s);
- } catch (Exception e) {
+ } catch (ZipException e) {
WebModelPlugin.getPluginLog().logError(e);
warError = NLS.bind(WebUIMessages.CANNOT_READ_WEBXML, location); //$NON-NLS-2$
return;
+ } catch (IOException e) {
+ WebModelPlugin.getPluginLog().logError(e);
+ warError = NLS.bind(WebUIMessages.CANNOT_READ_WEBXML, location); //$NON-NLS-2$
+ return;
}
try {
loadWebXML(body, "WEB-INF/web.xml"); //$NON-NLS-1$
- } catch (Exception e) {
+ } catch (XModelException e) {
WebModelPlugin.getPluginLog().logError(e);
warError = e.getMessage();
return;
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/RegisterServerContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/RegisterServerContext.java 2008-07-24 16:22:57 UTC (rev 9273)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/RegisterServerContext.java 2008-07-24 17:51:26 UTC (rev 9274)
@@ -194,7 +194,7 @@
String t = st.nextToken().trim();
try {
Integer.parseInt(t);
- } catch (Exception e) {
+ } catch (NumberFormatException e) {
WebModelPlugin.getPluginLog().logError(e);
return false;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java 2008-07-24 16:22:57 UTC (rev 9273)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java 2008-07-24 17:51:26 UTC (rev 9274)
@@ -332,7 +332,7 @@
private void createLockFile() {
try {
getProject().setSessionProperty(WatcherLoader.LOCK, "true");
- } catch (Exception e) {
+ } catch (CoreException e) {
WebUiPlugin.getPluginLog().logError(e);
}
}
@@ -349,7 +349,7 @@
Watcher.getInstance(model).forceUpdate();
}
}
- } catch (Exception e) {
+ } catch (CoreException e) {
WebUiPlugin.getPluginLog().logError(e);
}
}
@@ -360,25 +360,13 @@
private void updateJavaNature() throws CoreException {
// JavaCore.create(getProject());
EclipseResourceUtil.addNatureToProject(getProject(), JavaCore.NATURE_ID);
- try {
- SpecialWizard w = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.project.ClassPathUpdateWizard");
- Properties p = new Properties();
- p.put("model", model);
- p.put("classes", new Path(getProperty(JAVA_CLASSES_LOCATION_ID)));
- //webInfLocation.append("classes"));
- w.setObject(p);
- w.execute();
- } catch (Exception t) {
- try {
- EclipseResourceUtil.removeNatureFromProject(getProject(), getNatureID());
- EclipseResourceUtil.removeNatureFromProject(getProject(), JavaCore.NATURE_ID);
- getProject().delete(true, null);
- } catch (Exception e) {
- WebUiPlugin.getPluginLog().logError(e);
- }
- throw (t instanceof CoreException) ? (CoreException)t
- : new CoreException(new org.eclipse.core.runtime.Status(IStatus.ERROR, getNatureID(), org.eclipse.core.runtime.IStatus.ERROR, "" + t.getMessage(), t));
- }
+ SpecialWizard w = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.project.ClassPathUpdateWizard");
+ Properties p = new Properties();
+ p.put("model", model);
+ p.put("classes", new Path(getProperty(JAVA_CLASSES_LOCATION_ID)));
+ //webInfLocation.append("classes"));
+ w.setObject(p);
+ w.execute();
}
/**
@@ -387,7 +375,7 @@
* @throws CoreException
*/
protected AbstractOperation createWTPNature(IProgressMonitor monitor) throws CoreException {
- try {
+
boolean exists = getProject().exists();
String projectName = getProperty(PROJECT_NAME_ID);
String projectLocation = getProperty(PROJECT_LOCATION_ID);
@@ -464,10 +452,6 @@
} else {
return null;
}
-
- } catch (Exception e) {
- throw new CoreException(new Status(Status.ERROR,WebUiPlugin.PLUGIN_ID,0,"No message",e));
- }
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=119066
@@ -495,7 +479,7 @@
return (projectLocation.replace('\\','/') + "/").startsWith(root + "/" + getProject().getName() + "/");
}
- private String createLinks(String projectLocation) throws Exception {
+ private String createLinks(String projectLocation) throws CoreException {
IProject project = getProject();
String root = ModelPlugin.getWorkspace().getRoot().getLocation().toString().replace('\\', '/');
if((projectLocation.replace('\\','/') + "/").startsWith(root + "/" + project.getName() + "/")) return projectLocation;
@@ -514,7 +498,7 @@
IClasspathEntry entry = new ClassPathUpdate().createNewClasspathEntry(project.getFullPath().append("src"), IClasspathEntry.CPE_SOURCE);
try {
jp.setRawClasspath(new IClasspathEntry[]{entry}, project.getFullPath().append("classes"), null);
- } catch (Exception e) {
+ } catch (CoreException e) {
WebUiPlugin.getPluginLog().logError(e);
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebProjectAdoptOperation.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebProjectAdoptOperation.java 2008-07-24 16:22:57 UTC (rev 9273)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebProjectAdoptOperation.java 2008-07-24 17:51:26 UTC (rev 9274)
@@ -12,6 +12,7 @@
import java.io.File;
import java.io.FileWriter;
+import java.io.IOException;
import java.text.MessageFormat;
import java.util.Properties;
import java.util.ResourceBundle;
@@ -25,6 +26,7 @@
import org.w3c.dom.Element;
import org.jboss.tools.common.model.ServiceDialog;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.project.IModelNature;
@@ -83,7 +85,7 @@
String sv = context.getServletVersion();
if(sv == null || sv.length() == 0) sv = getDefaultServletVersion();
model.changeObjectAttribute(model.getByPath("Web"), "servlet version", sv);
- } catch (Exception ex) {
+ } catch (XModelException ex) {
WebUiPlugin.getPluginLog().logError(ex);
}
}
@@ -98,7 +100,7 @@
return "";
}
- protected abstract void execute() throws Exception;
+ protected abstract void execute() throws XModelException;
void setWorkspaceHome(String path) {
String relativePath = FileUtil.getRelativePath(getProject().getLocation().toString(), path);
@@ -117,12 +119,12 @@
XMLSerializer ser = new XMLSerializer(fileWriter, format);
ser.asDOMSerializer();
ser.serialize(element);
- } catch (Exception ex) {
+ } catch (IOException ex) {
WebUiPlugin.getPluginLog().logError(ex);
} finally {
try {
if (fileWriter != null) fileWriter.close();
- } catch (Exception ex) {
+ } catch (IOException ex) {
WebUiPlugin.getPluginLog().logError(ex);
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebProjectCreationOperation.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebProjectCreationOperation.java 2008-07-24 16:22:57 UTC (rev 9273)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebProjectCreationOperation.java 2008-07-24 17:51:26 UTC (rev 9274)
@@ -11,6 +11,7 @@
package org.jboss.tools.jst.web.ui.operation;
import java.io.File;
+import java.io.IOException;
import java.text.MessageFormat;
import java.util.Properties;
import java.util.ResourceBundle;
@@ -130,7 +131,7 @@
}
}
- protected void createTemplateModel() throws Exception {
+ protected void createTemplateModel() {
if(templateModel != null) return;
String templateLocation = getTemplateLocation();
Properties p = new Properties();
@@ -142,13 +143,13 @@
templateModel = XModelFactory.getModel(p);
}
- protected String getTemplateLocation() throws Exception {
+ protected String getTemplateLocation() {
String fileName = template.getProjectTemplatesLocation(
getProperty(TEMPLATE_VERSION_ID)) + "/" +
getProperty(TEMPLATE_ID) + "/";
try {
return new File(fileName).getCanonicalPath();
- } catch (Exception e) {
+ } catch (IOException e) {
WebUiPlugin.getPluginLog().logError("Cannot find folder '" + fileName + "'", null);
return fileName;
}
16 years, 5 months
JBoss Tools SVN: r9273 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-07-24 12:22:57 -0400 (Thu, 24 Jul 2008)
New Revision: 9273
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java
Log:
fix compilation error
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java 2008-07-24 16:09:09 UTC (rev 9272)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java 2008-07-24 16:22:57 UTC (rev 9273)
@@ -594,12 +594,6 @@
// if (name.equalsIgnoreCase(HtmlComponentUtil.HTML_WIDTH_ATTR)) {
// String style = visualElement
// .getAttribute(HtmlComponentUtil.HTML_S // Append colspan of this column
- if (null != colspan
- && colspan.intValue() != Integer.MIN_VALUE) {
- currentLength += colspan.intValue();
- } else {
-
- }TYLE_ATTR);
// visualElement.removeAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
// style += "; " + HtmlComponentUtil.HTML_WIDTH_ATTR + " : "
// + DEFAULT_WIDTH + ";";
16 years, 5 months
JBoss Tools SVN: r9272 - in trunk/jsf/plugins: org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-07-24 12:09:09 -0400 (Thu, 24 Jul 2008)
New Revision: 9272
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/FacesConfigEditor.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/JSFEditor.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/commands/JSFCompoundCommand.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/JSFModel.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/Segment.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/perspective/JSFPerspectiveFactory.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/Activator.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/RichFacesTemplatesActivator.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataOrderedListTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInsertTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/JSFPageUpdateManager.java
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/project/capabilities/AddJSFCapabilitiesSupport.java
Log:
Cleanup VPE code:
1. Unnecessary catch(Exception ex) blocks were removed;
2. Catch(Exception ex) blocks were converted to catch particular exception(s) where it was possible
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/JSFPageUpdateManager.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/JSFPageUpdateManager.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/JSFPageUpdateManager.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -147,11 +147,7 @@
}
if(stopped) break;
if(!isLocked()) {
- try {
- updateAll();
- } catch (Exception t) {
- JSFModelPlugin.log("Error while running page update", t);
- }
+ updateAll();
}
}
}
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 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFPromptingProvider.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -44,7 +44,7 @@
public List<Object> getList(XModel model, String id, String prefix, Properties properties) {
try {
return getListInternal(model, id, prefix, properties);
- } catch (Exception e) {
+ } catch (CoreException e) {
if(properties != null) {
String message = e.getMessage();
if(message==null) {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/AddJSFCapabilitiesSupport.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/AddJSFCapabilitiesSupport.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/AddJSFCapabilitiesSupport.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -12,6 +12,7 @@
import java.lang.reflect.InvocationTargetException;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.*;
import org.jboss.tools.common.meta.action.impl.*;
@@ -98,10 +99,10 @@
}
monitor.worked(getTaskCount(items[i], 0));
}
- } catch (Exception e) {
+ } catch (CoreException e) {
exception = e;
monitor.setCanceled(true);
- } finally {
+ }finally {
monitor.done();
added = (String[])context.changeList.toArray(new String[0]);
cancelled = monitor.isCanceled();
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/FacesConfigEditor.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/FacesConfigEditor.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/FacesConfigEditor.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -17,6 +17,7 @@
import org.eclipse.gef.ui.actions.ActionRegistry;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
@@ -79,7 +80,7 @@
selectionProvider.setHost(guiEditor.getSelectionProvider());
guiEditor.addErrorSelectionListener(createErrorSelectionListener());
selectionProvider.addHost("guiEditor", guiEditor.getSelectionProvider());
- } catch(Exception ex) {
+ } catch(PartInitException ex) {
JsfUiPlugin.getPluginLog().logError(ex);
}
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/JSFEditor.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/JSFEditor.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/JSFEditor.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -81,6 +81,7 @@
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.graphics.GC;
@@ -599,7 +600,7 @@
Exception ex = null;
try {
printer.getDPI();
- } catch (Exception ee) {
+ } catch (SWTException ee) {
ex = ee;
printer.dispose();
d = null;
@@ -607,10 +608,8 @@
"org.jboss.tools.jsf.ui", 0, WizardKeys
.getString("PRN_ERROR"), ee);
ProblemReportingHelper.reportProblem(status);
- }
- if (ex == null) {
- d
- .setPages(new Pages(viewer, new PageFormat(printer,
+
+ d.setPages(new Pages(viewer, new PageFormat(printer,
this.getWorkbenchPart().getSite().getShell()
.getDisplay())));
String result = d.open();
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/commands/JSFCompoundCommand.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/commands/JSFCompoundCommand.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/commands/JSFCompoundCommand.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -34,16 +34,10 @@
XModelObject[] objects = (XModelObject[])elements.toArray(new XModelObject[]{});
XModelObject object= objects[0];
if(elements.size() == 1) objects = null;
- try{
- XAction action = DnDUtil.getEnabledAction(object, objects, actionName);
- if(action != null) return true;
- else return false;
- }catch(Exception ex){
- JsfUiPlugin.getPluginLog().logError(ex);
- return false;
- }
-
- }else return false;
+ XAction action = DnDUtil.getEnabledAction(object, objects, actionName);
+ if(action != null) return true;
+ }
+ return false;
}
public boolean canUndo() {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/JSFModel.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/JSFModel.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/JSFModel.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -309,25 +309,21 @@
}
public void nodeChanged(XModelTreeEvent event) {
- try {
- fireProcessChanged(false);
- if (map == null || event == null)
- return;
- IJSFElement element = (JSFElement) map.get(event.getInfo());
- if (element != null
- && !event.getModelObject().getPath()
- .equals(event.getInfo())) {
- updateCash((String) event.getInfo());
- }
- String path = event.getModelObject().getPath();
- element = (path == null) ? null : (IJSFElement) map.get(path);
- if (element == null) {
- return;
- }
- element.nodeChanged(event);
- } catch (Exception exc) {
- JsfUiPlugin.getPluginLog().logError("Error in processing model event", exc);
+ fireProcessChanged(false);
+ if (map == null || event == null)
+ return;
+ IJSFElement element = (JSFElement) map.get(event.getInfo());
+ if (element != null
+ && !event.getModelObject().getPath()
+ .equals(event.getInfo())) {
+ updateCash((String) event.getInfo());
}
+ String path = event.getModelObject().getPath();
+ element = (path == null) ? null : (IJSFElement) map.get(path);
+ if (element == null) {
+ return;
+ }
+ element.nodeChanged(event);
}
public void structureChanged(XModelTreeEvent event) {
@@ -341,16 +337,12 @@
if (element == null) {
return;
}
- try {
- if (event.kind() == XModelTreeEvent.STRUCTURE_CHANGED) {
- element.structureChanged(event);
- } else if (event.kind() == XModelTreeEvent.CHILD_ADDED) {
- element.nodeAdded(event);
- } else if (event.kind() == XModelTreeEvent.CHILD_REMOVED) {
- element.nodeRemoved(event);
- }
- } catch (Exception exc) {
- JsfUiPlugin.getPluginLog().logError("Error in processing model event", exc);
+ if (event.kind() == XModelTreeEvent.STRUCTURE_CHANGED) {
+ element.structureChanged(event);
+ } else if (event.kind() == XModelTreeEvent.CHILD_ADDED) {
+ element.nodeAdded(event);
+ } else if (event.kind() == XModelTreeEvent.CHILD_REMOVED) {
+ element.nodeRemoved(event);
}
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/Segment.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/Segment.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/Segment.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -34,7 +34,7 @@
}
} catch(PropertyVetoException exception) {
length = 0;
- } catch(Exception exception) {
+ } catch(NumberFormatException exception) {
length = 0;
JsfUiPlugin.getPluginLog().logError(exception);
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/perspective/JSFPerspectiveFactory.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/perspective/JSFPerspectiveFactory.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/perspective/JSFPerspectiveFactory.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -24,7 +24,6 @@
public JSFPerspectiveFactory() {}
public void createInitialLayout(IPageLayout layout) {
- try {
String editorArea = layout.getEditorArea();
IFolderLayout leftTop = layout.createFolder("leftTop", IPageLayout.LEFT, 0.24f, editorArea);
leftTop.addView(JavaUI.ID_PACKAGES);
@@ -36,10 +35,6 @@
bottom.addView(IPageLayout.ID_PROBLEM_VIEW);
bottom.addView(IPageLayout.ID_TASK_LIST);
IFolderLayout rightTop = layout.createFolder("rightTop", IPageLayout.RIGHT, 0.84f, editorArea);
- rightTop.addView(PaletteViewPart.VIEW_ID);
- } catch (Exception ex) {
- JsfUiPlugin.getPluginLog().logError(ex);
- }
+ rightTop.addView(PaletteViewPart.VIEW_ID);
}
-
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/Activator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/Activator.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/Activator.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.ajax4jsf;
+import java.io.IOException;
import java.net.URL;
import org.eclipse.core.runtime.FileLocator;
@@ -65,7 +66,7 @@
URL url = null;
try {
url = bundle == null ? null : FileLocator.resolve(bundle.getEntry("/resources"));
- } catch (Exception e) {
+ } catch (IOException e) {
url = bundle.getEntry("/resources");
}
return (url == null) ? null : url.getPath();
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/RichFacesTemplatesActivator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/RichFacesTemplatesActivator.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/RichFacesTemplatesActivator.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces;
+import java.io.IOException;
import java.net.URL;
import org.eclipse.core.runtime.FileLocator;
@@ -68,7 +69,7 @@
URL url = null;
try {
url = bundle == null ? null : FileLocator.resolve(bundle.getEntry("/resources"));
- } catch (Exception e) {
+ } catch (IOException e) {
url = bundle.getEntry("/resources");
}
return (url == null) ? null : url.getPath();
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -558,22 +558,18 @@
array = HEADER_CONTENT_ON_POPUP;
}
- SimpleDateFormat sdf = new SimpleDateFormat();
+ SimpleDateFormat sdf = new SimpleDateFormat(DEFAULT_DATE_PATTERN);
Date date = getCalendarWithLocale().getTime();
- String dateStr = "";
+
if (attrPresents(datePattern)) {
try {
sdf.applyPattern(datePattern);
- dateStr = sdf.format(date);
- } catch (Exception e) {
- sdf.applyPattern(DEFAULT_DATE_PATTERN);
- dateStr = sdf.format(date);
+ } catch (IllegalArgumentException e) {
+ // DEFAULT_DATE_PATTERN is used in this case
}
- } else {
- sdf.applyPattern(DEFAULT_DATE_PATTERN);
- dateStr = sdf.format(date);
}
- array[2] = dateStr;
+
+ array[2] = sdf.format(date);
nsIDOMElement table = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -146,34 +146,24 @@
protected int getColumnsCount(Element sourceElement) {
int count = 0;
// check for exact value in component
- Integer span = null;
try {
- span = Integer.valueOf(sourceElement.getAttribute("columns"));
- } catch (Exception e) {
- // Ignore bad attribute
+ int span = Integer.parseInt(sourceElement.getAttribute("columns"));
+ count = span > 0 ? span : 0;
+ } catch (NumberFormatException e) {
+ // Ignore wrong formatted attribute
}
- if (null != span && span.intValue() >0) {
- count = span.intValue();
- }
return count;
}
protected int getElementsCount(Element sourceElement, int columnCount) {
int elements = 0;
// check for exact value in component
- Integer span = null;
try {
- span = Integer.valueOf(sourceElement.getAttribute("elements"));
- } catch (Exception e) {
- // Ignore bad attribute
- }
- if (null != span && span.intValue()>0) {
- elements = span.intValue();
- } else {
- // default rows = 3;
+ int span = Integer.parseInt(sourceElement.getAttribute("elements"));
+ elements = span>0 ? span : columnCount * defaultRows;
+ } catch (NumberFormatException e) {
elements = columnCount * defaultRows;
}
-
return elements;
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataOrderedListTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataOrderedListTemplate.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataOrderedListTemplate.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -44,14 +44,14 @@
VpeCreationData creatorInfo = new VpeCreationData(orderedList);
- int rows = -1;
+ int rows = 3;
try {
- rows = Integer.valueOf(sourceElement.getAttribute(HtmlComponentUtil.HTML_ROW_ATTR));
- } catch (Exception x) {
- rows = -1;
+ rows = Integer.parseInt(sourceElement.getAttribute(HtmlComponentUtil.HTML_ROW_ATTR));
+ } catch (NumberFormatException x) {
+ rows = 3;
}
- for (int i = 0; i < (rows == -1 ? 3 : rows); i++) {
+ for (int i = 0; i < rows; i++) {
nsIDOMElement listItem = visualDocument.createElement("li");
listItem.setAttribute("class", "dr-list-item rich-list-item");
orderedList.appendChild(listItem);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -291,16 +291,9 @@
protected int getColumnsCount(Element sourceElement, ArrayList<Element> columns) {
int count = 0;
// check for exact value in component
- Integer span = null;
try {
- span = Integer.valueOf(sourceElement.getAttribute("columns"));
- } catch (Exception e) {
- // Ignore bad attribute
- }
- if (null != span && span.intValue() != Integer.MIN_VALUE) {
- count = span.intValue();
- } else {
- // calculate max html columns count for all columns/rows children.
+ count = Integer.parseInt(sourceElement.getAttribute("columns"));
+ } catch (NumberFormatException e) {
count = calculateRowColumns(sourceElement, columns);
}
return count;
@@ -316,59 +309,33 @@
for (Element column : columns) {
if (ComponentUtil.isRendered(column)) {
if (column.getNodeName().endsWith(":columnGroup")) {
- // Store max calculated value of previsous rows.
- if (currentLength > count) {
- count = currentLength;
- }
+ // Store max calculated value of previous rows.
+ count = Math.max(currentLength,count);
// Calculate number of columns in row.
currentLength = calculateRowColumns(sourceElement, getColumns(column));
// Store max calculated value
- if (currentLength > count) {
- count = currentLength;
- }
+ count = Math.max(currentLength,count);
currentLength = 0;
} else if (column.getNodeName().equals(sourceElement.getPrefix() + ":column")) {
- String breakBeforeStr = column.getAttribute("breakBefore");
- boolean breakBefore = false;
- if(breakBeforeStr!=null) {
- try {
- breakBefore = Boolean.getBoolean(breakBeforeStr);
- } catch (Exception e) {
- // Ignore bad attribute
- }
- }
- // For new row, save length of previsous.
- if (breakBefore) {
- if (currentLength > count) {
- count = currentLength;
- }
+ // For new row, save length of previous.
+ if (Boolean.getBoolean(column.getAttribute("breakBefore"))) {
+ count = Math.max(currentLength,count);
currentLength = 0;
}
String colspanStr = column.getAttribute("colspan");
Integer colspan = null;
try {
- colspan = Integer.valueOf(colspanStr);
+ currentLength += Integer.parseInt(colspanStr);
} catch (NumberFormatException e) {
- // Ignore
- }
- // Append colspan of this column
- if (null != colspan
- && colspan.intValue() != Integer.MIN_VALUE) {
- currentLength += colspan.intValue();
- } else {
currentLength++;
}
} else if (column.getNodeName().endsWith(":column")) {
// UIColumn always have colspan == 1.
currentLength++;
}
-
}
}
- if (currentLength > count) {
- count = currentLength;
- }
- return count;
+ return Math.max(currentLength,count);
}
@Override
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInsertTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInsertTemplate.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInsertTemplate.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -21,6 +21,7 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.core.resources.IFile;
import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
@@ -36,6 +37,7 @@
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
+import org.xml.sax.SAXException;
import com.uwyn.jhighlight.renderer.Renderer;
import com.uwyn.jhighlight.renderer.XhtmlRendererFactory;
@@ -113,7 +115,7 @@
while ((buf = br.readLine()) != null)
finalStr += buf + "\n"; //$NON-NLS-1$
- } catch (Exception e) {
+ } catch (IOException e) {
div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, ERROR_MESSAGE_STYLE);
nsIDOMText text = visualDocument.createTextNode(RESOURCE_READING_ERROR_MESSAGE);
div.appendChild(text);
@@ -208,8 +210,12 @@
builder = fact.newDocumentBuilder();
doc = builder.parse(new StringBufferInputStream(transformString));
node = doc.getElementsByTagName("code").item(0); //$NON-NLS-1$
- } catch (Exception e) {
+ } catch (IOException e) {
return node;
+ } catch (SAXException e) {
+ return node;
+ } catch (ParserConfigurationException e) {
+ return node;
}
return node;
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -495,18 +495,12 @@
ArrayList<Element> columns) {
int count = 0;
// check for exact value in component
- Integer span = null;
try {
- span = Integer.valueOf(sourceElement.getAttribute("columns"));
- } catch (Exception e) {
- // Ignore bad attribute
+ int span = Integer.parseInt(sourceElement.getAttribute("columns"));
+ count = count > 0 ? span : calculateRowColumns(sourceElement, columns);
+ } catch (NumberFormatException e) {
+ count = count = calculateRowColumns(sourceElement, columns);
}
- if (null != span && span.intValue() != Integer.MIN_VALUE) {
- count = span.intValue();
- } else {
- // calculate max html columns count for all columns/rows children.
- count = calculateRowColumns(sourceElement, columns);
- }
return count;
}
@@ -536,16 +530,8 @@
} else if (column.getNodeName().equals(
sourceElement.getPrefix() + ":column")) {
String breakBeforeStr = column.getAttribute("breakBefore");
- boolean breakBefore = false;
- if (breakBeforeStr != null) {
- try {
- breakBefore = Boolean.getBoolean(breakBeforeStr);
- } catch (Exception e) {
- // Ignore bad attribute
- }
- }
// For new row, save length of previsous.
- if (breakBefore) {
+ if (Boolean.getBoolean(breakBeforeStr)) {
if (currentLength > count) {
count = currentLength;
}
@@ -553,17 +539,10 @@
}
String colspanStr = column
.getAttribute(HtmlComponentUtil.HTML_TABLE_COLSPAN);
- Integer colspan = null;
try {
- colspan = Integer.valueOf(colspanStr);
- } catch (Exception e) {
- // Ignore
- }
- // Append colspan of this column
- if (null != colspan
- && colspan.intValue() != Integer.MIN_VALUE) {
- currentLength += colspan.intValue();
- } else {
+ int colspan = Integer.parseInt(colspanStr);
+ currentLength += colspan > 0 ? colspan : 1;
+ } catch (NumberFormatException e) {
currentLength++;
}
} else if (column.getNodeName().endsWith(":column")) {
@@ -614,7 +593,13 @@
// .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
// if (name.equalsIgnoreCase(HtmlComponentUtil.HTML_WIDTH_ATTR)) {
// String style = visualElement
- // .getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
+ // .getAttribute(HtmlComponentUtil.HTML_S // Append colspan of this column
+ if (null != colspan
+ && colspan.intValue() != Integer.MIN_VALUE) {
+ currentLength += colspan.intValue();
+ } else {
+
+ }TYLE_ATTR);
// visualElement.removeAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
// style += "; " + HtmlComponentUtil.HTML_WIDTH_ATTR + " : "
// + DEFAULT_WIDTH + ";";
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java 2008-07-24 15:52:20 UTC (rev 9271)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java 2008-07-24 16:09:09 UTC (rev 9272)
@@ -74,18 +74,15 @@
} catch (TokenStreamException e) {
SeamTemplatesActivator.getPluginLog().logError(e);
}
- nsIDOMParser parserDom = null;
- try {
- parserDom = (nsIDOMParser)getComponentManager().
+
+ nsIDOMParser parserDom = parserDom = (nsIDOMParser)getComponentManager().
createInstanceByContractID(CID_DOMPARSER, null, nsIDOMParser.NS_IDOMPARSER_IID);
- } catch (Exception e) {
- SeamTemplatesActivator.getPluginLog().logError(e);
- }
+
String strDoc = "<HTML><BODY>" + parser.toString() + "</BODY></HTML>";
- nsIDOMDocument domDoc = null != parserDom ? parserDom.parseFromString(strDoc, "application/xhtml+xml") : null;
+ nsIDOMDocument domDoc = parserDom.parseFromString(strDoc, "application/xhtml+xml");
nsIDOMNode patronItem = null, nodeTmp = null;
nsIDOMNodeList list = null;
- if (null != domDoc && null != domDoc.getDocumentElement()) {
+ if ( null != domDoc.getDocumentElement()) {
list = domDoc.getDocumentElement().getChildNodes();
long i = 0;
for (; i < list.getLength(); i++) {
16 years, 5 months
JBoss Tools SVN: r9271 - trunk/documentation/jboss-tools-docs/index/en.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-07-24 11:52:20 -0400 (Thu, 24 Jul 2008)
New Revision: 9271
Modified:
trunk/documentation/jboss-tools-docs/index/en/master.xml
Log:
link to JSF guide on index page is corrected
Modified: trunk/documentation/jboss-tools-docs/index/en/master.xml
===================================================================
--- trunk/documentation/jboss-tools-docs/index/en/master.xml 2008-07-24 15:07:47 UTC (rev 9270)
+++ trunk/documentation/jboss-tools-docs/index/en/master.xml 2008-07-24 15:52:20 UTC (rev 9271)
@@ -73,7 +73,7 @@
<indexentry>
<primaryie>JSF Tools Reference Guide <ulink
- url="en/jsf_tools_ref_Guide/html/index.html">(html)</ulink>
+ url="en/jsf_tools_ref_guide/html/index.html">(html)</ulink>
<ulink url="en/jsf_tools_ref_guide/html_single/index.html">(html single)</ulink>
<ulink url="en/jsf_tools_ref_guide/pdf/JSF_Tools_Reference_Guide.pdf"
>(pdf)</ulink>
16 years, 5 months
JBoss Tools SVN: r9270 - in trunk/documentation/movies/index: en and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-07-24 11:07:47 -0400 (Thu, 24 Jul 2008)
New Revision: 9270
Modified:
trunk/documentation/movies/index/en/master.xml
trunk/documentation/movies/index/pom.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-348
Modified: trunk/documentation/movies/index/en/master.xml
===================================================================
--- trunk/documentation/movies/index/en/master.xml 2008-07-24 14:40:10 UTC (rev 9269)
+++ trunk/documentation/movies/index/en/master.xml 2008-07-24 15:07:47 UTC (rev 9270)
@@ -14,22 +14,34 @@
<title/>
<indexentry>
<primaryie>
- <ulink url="../../../../../../create_console_config/create_console_config.htm">Creating Console Configuration</ulink>
+ <ulink url="demos/create_console_config/create_console_config.htm">Creating Console Configuration</ulink>
</primaryie>
</indexentry>
<indexentry>
<primaryie>
- <ulink url="../../../../../../cust_tag_lib_to_pallete/cust_tag_lib_to_pallete.htm">Importing Custom Tag Library to Pallete</ulink>
+ <ulink url="demos/cust_tag_lib_to_pallete/cust_tag_lib_to_pallete.htm">Importing Custom Tag Library to Pallete</ulink>
</primaryie>
</indexentry>
<indexentry>
<primaryie>
- <ulink url="../../../../../../seam2_plus_ejb3/seam2_plus_ejb3.htm">Creating Seam2 + EJB3 EAR Project</ulink>
+ <ulink url="demos/seam2_plus_ejb3/seam2_plus_ejb3.htm">Creating Seam2 + EJB3 EAR Project</ulink>
</primaryie>
</indexentry>
+ <indexentry>
+ <primaryie>
+ <ulink url="demos/ootb_new_seam_project/ootb_new_seam_project.htm">New Seam Project</ulink>
+ </primaryie>
+ </indexentry>
+
+ <indexentry>
+ <primaryie>
+ <ulink url="demos/archiving/archiving.htm">Archiving</ulink>
+ </primaryie>
+ </indexentry>
+
<!--indexentry>
<primaryie>Visual Web Tools Reference Guide <ulink url="en/jsf/html/index.html"
>(html)</ulink>
Modified: trunk/documentation/movies/index/pom.xml
===================================================================
--- trunk/documentation/movies/index/pom.xml 2008-07-24 14:40:10 UTC (rev 9269)
+++ trunk/documentation/movies/index/pom.xml 2008-07-24 15:07:47 UTC (rev 9270)
@@ -8,7 +8,7 @@
<artifactId>all-guides-index</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jdocbook</packaging>
- <name>All_Userguides_index</name>
+ <name>All_movies_index</name>
<build>
<plugins>
@@ -66,7 +66,7 @@
</plugins>
</build>
- <distributionManagement>
+<distributionManagement>
<repository>
<!-- Copy the dist to the local checkout of the JBoss maven2 repo ${maven.repository.root} -->
<!-- It is anticipated that ${maven.repository.root} be set in user's settings.xml -->
@@ -79,8 +79,9 @@
<name>JBoss Snapshot Repository</name>
<url>dav:https://snapshots.jboss.org/maven2</url>
</snapshotRepository>
- </distributionManagement>
+</distributionManagement>
+
<properties>
<stylesdir>../../jbosstools-docbook-xslt/src/main/resources/</stylesdir>
<cssdir>../../jbosstools-jdocbook-style/src/main/org/css/</cssdir>
16 years, 5 months
JBoss Tools SVN: r9269 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-07-24 10:40:10 -0400 (Thu, 24 Jul 2008)
New Revision: 9269
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2572
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2008-07-24 13:42:39 UTC (rev 9268)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2008-07-24 14:40:10 UTC (rev 9269)
@@ -173,6 +173,10 @@
public void showEditorInput(IEditorInput editorInput) {
+ if (!(getEditorInput() instanceof CriteriaEditorInput)) {
+ super.showEditorInput( editorInput );
+ return;
+ }
CriteriaEditorInput hei = (CriteriaEditorInput)getEditorInput();
super.showEditorInput( editorInput );
IStorage storage = ((CriteriaEditorInput)editorInput).getStorage();
16 years, 5 months