Author: mareshkau
Date: 2009-06-23 14:44:15 -0400 (Tue, 23 Jun 2009)
New Revision: 16151
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/TextNodeSplitterImpl.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dnd/context/JSPViewerDropAdapter.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/BaseActionManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreationData.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableColumnCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDefineContainerTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeJspRootCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeLinkCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpePanelLayoutCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/dnd/VpeDnd.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/SplitToolBar.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/FormatControllerManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
Log:
Fixing PMD violation in VPE code
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -178,11 +178,8 @@
}
//sets possability to drop current element here
//Added by estherbin fix jbide-1046
- VpeController controller = null;
-
- if (editorDomEventListener instanceof VpeController) {
- controller = (VpeController) editorDomEventListener;
- }
+ VpeController controller = (VpeController) editorDomEventListener;
+
VpeSelectionController selectionController =
controller.getVisualSelectionController();
final VpeVisualCaretInfo visualCaretInfo =
controller.getSelectionBuilder().getVisualCaretInfo(event);
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/TextNodeSplitterImpl.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/TextNodeSplitterImpl.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/TextNodeSplitterImpl.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -23,17 +23,15 @@
*
*/
public class TextNodeSplitterImpl implements ITextNodeSplitter {
- private Point range;
private Text node;
private Node parent;
private IndexedRegion region;
private int offset1 = 0, offset2=0;
private boolean split1=true,split2=true;
- private boolean next=false;
+
public TextNodeSplitterImpl(Point range, Text node){
- this.range = range;
this.node = node;
parent = node.getParentNode();
region = (IndexedRegion)node;
@@ -57,11 +55,9 @@
public int getSplitIndex(int index) {
int nodeIndex = getIndex(parent, node);
if(nodeIndex == index){
- next = false;
if(split1)return index+1;
else return index;
}else if(nodeIndex == index+1){
- next = true;
if(split1 && split2) return index+1;
else return index;
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -685,34 +685,20 @@
if (sourceContent != null) {
sourceEditor.createPartControl(sourceContent);
- }
-
-
- /*if (previewWebBrowser != null) {
- previewWebBrowser
- .setEditorLoadWindowListener(new EditorLoadWindowListener() {
- public void load() {
- previewWebBrowser
- .setEditorLoadWindowListener(null);
- previewWebBrowser.buildDom();
+ sourceContent.addListener(SWT.Activate, new Listener() {
+ public void handleEvent(Event event) {
+ if (event.type == SWT.Activate) {
+ if (activeEditor != sourceEditor) {
+ activeEditor = sourceEditor;
+ setFocus();
}
- });
- previewWebBrowser.createPartControl(previewContent);
+ }
+ }
+ });
}
-*/
+
activeEditor = sourceEditor;
- sourceContent.addListener(SWT.Activate, new Listener() {
- public void handleEvent(Event event) {
- if (event.type == SWT.Activate) {
- if (activeEditor != sourceEditor) {
- activeEditor = sourceEditor;
- setFocus();
- }
- }
- }
- });
-
visualContent.addListener(SWT.Activate, new Listener() {
public void handleEvent(Event event) {
if (event.type == SWT.Activate) {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -34,8 +34,6 @@
* @author A. Yukhovich
*/
public class VpePreviewDomBuilder extends VpeVisualDomBuilder {
-
- boolean rebuildFlag = false;
/**
*
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceDomBuilder.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceDomBuilder.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceDomBuilder.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -54,7 +54,6 @@
public class VpeSourceDomBuilder extends VpeDomBuilder {
private StructuredTextViewer structuredTextViewer;
- private IContentOutlinePage outline;
private ISelectionProvider selectionManager;
IDOMModel model;
private Document sourceDocument;
@@ -65,8 +64,6 @@
super(domMapping, sorceAdapter);
this.sourceEditor = sourceEditor;
structuredTextViewer = sourceEditor.getTextViewer();
- outline = (IContentOutlinePage)sourceEditor.getAdapter(IContentOutlinePage.class);
-// selectionManager = sourceEditor.getViewerSelectionManager();
selectionManager = sourceEditor.getSelectionProvider();
model = (IDOMModel)sourceEditor.getModel();
if (model != null) {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -22,6 +22,7 @@
import java.util.MissingResourceException;
import java.util.Properties;
import java.util.ResourceBundle;
+import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -309,35 +310,34 @@
}
private void refreshUsedKeys(){
- UsedKey key;
- UsedKey[] array = new UsedKey[0];
- array = (UsedKey[])usedKeys.values().toArray(array);
+ UsedKey keyValue;
+ Set<String> usedKeysSet = this.usedKeys.keySet();
- for(int i=0; i<array.length;i++){
- key = (UsedKey)array[i];
- BundleEntry entry = getBundle(key.prefix);
+ for(String key:usedKeysSet){
+ keyValue =this.usedKeys.get(key);
+ BundleEntry entry = getBundle(keyValue.prefix);
if(entry != null){
String value;
try{
- value = (String)entry.bundle.getObject(key.key);
+ value = (String)entry.bundle.getObject(keyValue.key);
}catch(MissingResourceException ex){
value = null;
- fireBundleKeyChanged(key.prefix, key.key, value);
- usedKeys.remove(key);
+ fireBundleKeyChanged(keyValue.prefix, keyValue.key, value);
+ this.usedKeys.remove(key);
continue;
}
- if((value == null && key.value != null) || (value != null &&
key.value == null)){
- key.value = value;
- fireBundleKeyChanged(key.prefix, key.key, value);
+ if((value == null && keyValue.value != null) || (value != null &&
keyValue.value == null)){
+ keyValue.value = value;
+ fireBundleKeyChanged(keyValue.prefix, keyValue.key, value);
continue;
- }else if(value != null && key.value != null &&
!value.equals(key.value)){
- key.value = value;
- fireBundleKeyChanged(key.prefix, key.key, value);
+ }else if(value != null && keyValue.value != null &&
!value.equals(keyValue.value)){
+ keyValue.value = value;
+ fireBundleKeyChanged(keyValue.prefix, keyValue.key, value);
continue;
}
} else{
- key.value = null;
- fireBundleKeyChanged(key.prefix, key.key, null);
+ keyValue.value = null;
+ fireBundleKeyChanged(keyValue.prefix, keyValue.key, null);
}
}
}
@@ -363,7 +363,7 @@
ELInvocationExpression expr = (ELInvocationExpression)i.getExpression();
String[] values = getCall(expr);
if(values != null) {
- String value = (values == null) ? null : getBundleValue(values[0], values[1]);
+ String value = getBundleValue(values[0], values[1]);
if(value != null) {
sb.append(value);
index = i.getEndPosition();
@@ -457,7 +457,7 @@
public String propertyName;
}
- class BundleEntry{
+ class BundleEntry{
public ResourceBundle bundle;
public String uri;
public String prefix;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dnd/context/JSPViewerDropAdapter.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dnd/context/JSPViewerDropAdapter.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dnd/context/JSPViewerDropAdapter.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -31,7 +31,6 @@
import org.jboss.tools.common.model.ui.editors.dnd.context.DropContext;
import org.jboss.tools.common.model.ui.editors.dnd.context.InnerDragBuffer;
import org.jboss.tools.jst.jsp.editor.IJSPTextEditor;
-import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.dnd.context.xpl.DragNodeCommand2;
import org.w3c.dom.Attr;
import org.w3c.dom.Node;
@@ -42,11 +41,10 @@
*/
public class JSPViewerDropAdapter extends ViewerDropAdapter {
- Transfer sourceTransfer = null;
protected DropContext dropContext;
public JSPViewerDropAdapter(Transfer sourceTransfer, Viewer viewer, IJSPTextEditor
editor, Transfer transfer, DropContext dropContext) {
- super(viewer, new JSPDragAndDropManager(editor, transfer, dropContext));
+ super(viewer, new JSPDragAndDropManager(editor, dropContext));
this.dropContext = dropContext;
}
@@ -81,12 +79,10 @@
class JSPDragAndDropManager extends XMLDragAndDropManager {
IJSPTextEditor editor;
- Transfer sourceTransfer = null;
DropContext dropContext;
- public JSPDragAndDropManager(IJSPTextEditor editor, Transfer sourceTransfer, DropContext
dropContext) {
+ public JSPDragAndDropManager(IJSPTextEditor editor, DropContext dropContext) {
this.editor = editor;
- this.sourceTransfer = sourceTransfer;
this.dropContext = dropContext;
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/BaseActionManager.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/BaseActionManager.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/BaseActionManager.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -56,7 +56,6 @@
public static final String INSERT_TAG_MENU = "Insert Tag";
- private ActionHelper actionHelper;
static public void setTextNodeSplitter(ITextNodeSplitter splitter) {
textNodeSplitter = splitter;
@@ -65,7 +64,6 @@
protected BaseActionManager(IStructuredModel model, ModelQuery modelQuery) {
this.model = model;
this.modelQuery = modelQuery;
- this.actionHelper = new ActionHelper((ModelQueryImpl) modelQuery);
}
abstract protected Action createAddAttributeAction(Element parent,
CMAttributeDeclaration ad);
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreationData.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreationData.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreationData.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -107,35 +107,4 @@
this.elementData = elementData;
}
- /**
- * Added method for creation copy which will placed in cash to improve
- * perfomance of VPE Added by Max Areshkau JBIDE-675. Here copyed only
- * nsI****
- *
- * @return
- */
- public VpeCreationData createHashCopy() {
- nsIDOMNode node = null;
- if (this.node != null) {
- node = XmlUtil.createClone(this.node);
- } else {
- VpeDebugUtil.debugInfo("Node is Null");
- }
- if (node.getNodeType() != nsIDOMNode.ELEMENT_NODE) {
- VpeDebugUtil.debugInfo("It's Not Element");
- }
-
- VpeCreationData data = new VpeCreationData(node);
- if (this.childrenInfoList != null) {
- data.childrenInfoList = new ArrayList<VpeChildrenInfo>();
- for (VpeChildrenInfo childrenInfo : this.childrenInfoList) {
- data.childrenInfoList.add(childrenInfo.createCashCopy());
- }
- }
- data.illegalChildren = this.illegalChildren;
- data.data = this.data;
- data.elementData = this.elementData;
- return data;
- }
-
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableColumnCreator.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableColumnCreator.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableColumnCreator.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -27,10 +27,9 @@
import org.w3c.dom.NodeList;
public class VpeDataTableColumnCreator extends VpeAbstractCreator {
- private boolean caseSensitive;
+
VpeDataTableColumnCreator(Element element, VpeDependencyMap dependencyMap, boolean
caseSensitive) {
- this.caseSensitive = caseSensitive;
}
public VpeCreatorInfo create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument
visualDocument, nsIDOMElement visualElement, Map visualNodeMap) {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableCreator.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableCreator.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableCreator.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -42,10 +42,7 @@
public class VpeDataTableCreator extends VpeAbstractCreator {
private boolean caseSensitive;
- private VpeExpression headerClassExpr;
- private VpeExpression footerClassExpr;
- private VpeExpression rowClassesExpr;
- private VpeExpression columnClassesExpr;
+
private final String REDUNDANT_TEXT_SEPARATOR = "\n\n"; //$NON-NLS-1$
private final String EMPTY = ""; //$NON-NLS-1$
private final String NONE = "none"; //$NON-NLS-1$
@@ -84,7 +81,6 @@
VpeExpressionInfo info = VpeExpressionBuilder
.buildCompletedExpression(headerClassAttr.getValue(),
caseSensitive);
- headerClassExpr = info.getExpression();
dependencyMap.setCreator(this, info.getDependencySet());
} catch (VpeExpressionBuilderException e) {
VpePlugin.reportProblem(e);
@@ -98,7 +94,6 @@
VpeExpressionInfo info = VpeExpressionBuilder
.buildCompletedExpression(footerClassAttr.getValue(),
caseSensitive);
- footerClassExpr = info.getExpression();
dependencyMap.setCreator(this, info.getDependencySet());
} catch (VpeExpressionBuilderException e) {
VpePlugin.reportProblem(e);
@@ -112,7 +107,6 @@
VpeExpressionInfo info = VpeExpressionBuilder
.buildCompletedExpression(rowClassesAttr.getValue(),
caseSensitive);
- rowClassesExpr = info.getExpression();
dependencyMap.setCreator(this, info.getDependencySet());
} catch (VpeExpressionBuilderException e) {
VpePlugin.reportProblem(e);
@@ -126,7 +120,6 @@
VpeExpressionInfo info = VpeExpressionBuilder
.buildCompletedExpression(columnClassesAttr.getValue(),
caseSensitive);
- columnClassesExpr = info.getExpression();
dependencyMap.setCreator(this, info.getDependencySet());
} catch (VpeExpressionBuilderException e) {
VpePlugin.reportProblem(e);
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDefineContainerTemplate.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDefineContainerTemplate.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDefineContainerTemplate.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -41,7 +41,6 @@
import org.w3c.dom.NodeList;
public abstract class VpeDefineContainerTemplate extends VpeAbstractTemplate {
- int count = 0;
private static Set<Node> defineContainer = new HashSet<Node>();
@Override
@@ -254,11 +253,7 @@
TemplateFileInfo templateFileInfo = (TemplateFileInfo) creationData
.getData();
if (templateFileInfo != null) {
- VpeIncludeInfo includeInfo = pageContext.getVisualBuilder()
- .popIncludeStack();
- if (includeInfo != null) {
- // VpeCreatorUtil.releaseDocumentFromRead(includeInfo.getDocument());
- }
+ pageContext.getVisualBuilder().popIncludeStack();
}
defineContainer.remove(sourceNode);
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -13,21 +13,18 @@
import java.util.Map;
import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
-import org.mozilla.interfaces.nsIDOMNodeList;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
public class VpeFacetCreator extends VpeAbstractCreator {
- private boolean caseSensitive;
+
VpeFacetCreator(Element element, VpeDependencyMap dependencyMap, boolean caseSensitive)
{
- this.caseSensitive = caseSensitive;
}
@Override
@@ -47,34 +44,7 @@
if (isHeader || isFooter) {
Node sourceParent = sourceNode.getParentNode();
if (sourceParent != null) {
- nsIDOMNode visualParent = null;
- VpeDomMapping domMapping = pageContext.getDomMapping();
- if (sourceParent != null && domMapping != null) {
- visualParent = pageContext.getDomMapping().getVisualNode(sourceParent);
- }
- nsIDOMNode header = null;
- nsIDOMNode footer = null;
-
- if (visualParent != null &&
visualParent.getNodeName().equalsIgnoreCase("table")) {
- nsIDOMNodeList children = visualParent.getChildNodes();
- long count = children != null ? children.getLength() : 0;
- if (count > 0) {
- for (long i = 0; i < count; i++) {
- nsIDOMNode node = children.item(i);
- if (node.getNodeType() == nsIDOMNode.ELEMENT_NODE) {
- if (isHeader && HTML.TAG_THEAD.equalsIgnoreCase(node.getNodeName())) {
- header = node;
- break;
- } else if (isFooter &&
HTML.TAG_TFOOT.equalsIgnoreCase(node.getNodeName())) {
- footer = node;
- break;
- }
- }
- }
- }
- }
-
nsIDOMElement cell = null;
int columnsCount = getColumnsCount(sourceParent);
if (isHeader) {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeJspRootCreator.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeJspRootCreator.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeJspRootCreator.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.template;
-import java.util.List;
import java.util.Map;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.mozilla.interfaces.nsIDOMDocument;
@@ -19,10 +18,7 @@
import org.w3c.dom.Node;
public class VpeJspRootCreator extends VpeAbstractCreator {
- private static final String ATTR_PREFIX = "xmlns:";
- private List attrs;
-
VpeJspRootCreator(Element taglibElement, VpeDependencyMap dependencyMap) {
build(taglibElement, dependencyMap);
}
@@ -36,39 +32,4 @@
return null;
}
-// private void setTaglib(VpePageContext pageContext, Element sourceElement) {
-// attrs = new ArrayList();
-// NamedNodeMap attributes = sourceElement.getAttributes();
-// for (int i = 0; i < attributes.getLength(); i++) {
-// Attr attr = (Attr)attributes.item(i);
-// String name = attr.getNodeName();
-// if (name.indexOf(ATTR_PREFIX) == 0) {
-// String prefix = name.substring(6);
-// String uri = attr.getNodeValue();
-//// pageContext.setTaglib(attr.hashCode(), uri, prefix, true);
-// attrs.add(new AttrElement(attr.hashCode(), name));
-// }
-// }
-// }
-
- private int getAddress(String name) {
- for (int i = 0; i < attrs.size(); i++) {
- AttrElement item = (AttrElement)attrs.get(i);
- if (item.attrName.equals(name)) {
- return item.address;
- }
- }
- return -1;
- }
-
-
- private class AttrElement {
- private int address;
- private String attrName;
-
- private AttrElement(int address, String attrName) {
- this.address = address;
- this.attrName = attrName;
- }
- }
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeLinkCreator.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeLinkCreator.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeLinkCreator.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -30,12 +30,10 @@
public class VpeLinkCreator extends VpeAbstractCreator {
private boolean caseSensitive;
private VpeExpression hrefExpr;
- private VpeExpression relExpr;
private String hrefStr;
private String relStr;
- private Set dependencySet;
VpeLinkCreator(Element taglibElement, VpeDependencyMap dependencyMap, boolean
caseSensitive) {
this.caseSensitive = caseSensitive;
@@ -49,7 +47,6 @@
hrefStr = hrefAttr.getValue();
VpeExpressionInfo info = VpeExpressionBuilder.buildCompletedExpression(hrefStr,
caseSensitive);
hrefExpr = info.getExpression();
- dependencySet = info.getDependencySet();
dependencyMap.setCreator(this, info.getDependencySet());
} catch(VpeExpressionBuilderException e) {
VpePlugin.reportProblem(e);
@@ -61,7 +58,6 @@
try {
relStr = relAttr.getValue();
VpeExpressionInfo info = VpeExpressionBuilder.buildCompletedExpression(relStr,
caseSensitive);
- relExpr = info.getExpression();
} catch(VpeExpressionBuilderException e) {
VpePlugin.reportProblem(e);
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpePanelLayoutCreator.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpePanelLayoutCreator.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpePanelLayoutCreator.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -351,7 +351,6 @@
VpeCreatorInfo creatorInfo;
- Document sourceDocument;
public PanelLayoutTable(nsIDOMDocument visualDocument, Node source) {
@@ -364,7 +363,6 @@
right = tr.createCell();
tr = table.crateRow();
bottom = tr.createCell(2);
- sourceDocument = source.getOwnerDocument();
}
public void setTop(Node node, String[][] styleMap) {
@@ -493,11 +491,10 @@
}
public class Td extends DefaultNodeWrapper {
- nsIDOMElement cell = null;
+
public Td(nsIDOMElement cellNode) {
super(cellNode);
- cell = cellNode;
}
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/dnd/VpeDnd.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/dnd/VpeDnd.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/dnd/VpeDnd.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -38,7 +38,6 @@
private boolean isContainer = false;
private HashSet enabledTags = null;
- String tagName="";
public VpeDnd(){
@@ -49,12 +48,10 @@
this.dragEnabled = dragEnabled;
this.isContainer = isContainer;
enabledTags = null;
- tagName="Document";
}
public void setDndData(Element node){
enabledTags = null;
- tagName =
((Element)node.getParentNode().getParentNode()).getAttribute("name");
NodeList children = node.getChildNodes();
if (children != null) {
int len = children.getLength();
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/SplitToolBar.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/SplitToolBar.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/SplitToolBar.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -33,7 +33,7 @@
comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
final ToolBar horBar = new ToolBar(comp, SWT.FLAT);
- items = createItems(horBar);
+ createItems(horBar);
// final Button button = new Button(parent, SWT.FLAT|SWT.PUSH);
// button.setImage(ImageDescriptor.createFromFile(MozillaEditor.class,
"icons/arrow_more.gif").createImage());
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/FormatControllerManager.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/FormatControllerManager.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/FormatControllerManager.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -96,9 +96,10 @@
} else {
currentSelectedTagValue = null;
}
+ this.currentSelectedNode = newNodeInfo.getNode();
}
currentSelectedNodeInfo = newNodeInfo;
- currentSelectedNode = newNodeInfo.getNode();
+
currentSelectedElement = currentSelectedNode;
TextFormatingData textFormatingData = getFormatTemplateForSelectedNode();
if(textFormatingData!=null) {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2009-06-23
17:41:55 UTC (rev 16150)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2009-06-23
18:44:15 UTC (rev 16151)
@@ -93,7 +93,7 @@
// sets parameter position in absolute value
public static String setAbsolute(String styleString) {
- String style = new String(styleString);
+ String style = styleString;
if (style == null) {
style = EMPTY_STRING;
} else { // remove old sizes