JBoss Tools SVN: r3618 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-13 18:34:02 -0400 (Thu, 13 Sep 2007)
New Revision: 3618
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
Log:
Moved setServerStarting to directly before the launch
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2007-09-13 22:33:17 UTC (rev 3617)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2007-09-13 22:34:02 UTC (rev 3618)
@@ -95,14 +95,22 @@
throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, "Runtime not found"));
}
-
+ protected void preLaunch(ILaunchConfiguration configuration,
+ String mode, ILaunch launch, IProgressMonitor monitor) {
+ try {
+ JBossServerBehavior jbsBehavior = getServerBehavior(configuration);
+ jbsBehavior.serverStarting();
+ } catch( CoreException ce ) {
+ // report it
+ }
+ }
+
public void postLaunch(ILaunchConfiguration configuration, String mode,
ILaunch launch, IProgressMonitor monitor) {
try {
IProcess[] processes = launch.getProcesses();
JBossServerBehavior jbsBehavior = getServerBehavior(configuration);
jbsBehavior.setProcess(processes[0]);
- jbsBehavior.serverStarting();
} catch( CoreException ce ) {
// report
}
17 years, 4 months
JBoss Tools SVN: r3617 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-13 18:33:17 -0400 (Thu, 13 Sep 2007)
New Revision: 3617
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
Log:
transient was not needed
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2007-09-13 17:02:38 UTC (rev 3616)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2007-09-13 22:33:17 UTC (rev 3617)
@@ -38,7 +38,7 @@
public class JBossServerBehavior extends DeployableServerBehavior {
private PollThread pollThread = null;
- protected transient IProcess process;
+ protected IProcess process;
public JBossServerBehavior() {
super();
}
17 years, 4 months
JBoss Tools SVN: r3616 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2007-09-13 13:02:38 -0400 (Thu, 13 Sep 2007)
New Revision: 3616
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
Log:
http://jira.jboss.com/jira/browse/EXIN-337
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2007-09-13 16:47:11 UTC (rev 3615)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2007-09-13 17:02:38 UTC (rev 3616)
@@ -12,14 +12,12 @@
package org.jboss.tools.seam.ui.test.view;
import java.util.Iterator;
-import java.util.List;
import junit.framework.TestCase;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -38,7 +36,6 @@
import org.jboss.tools.jst.web.ui.RedHat4WebPerspectiveFactory;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamPackage;
-import org.jboss.tools.seam.core.ISeamScope;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.ui.ISeamUiConstants;
import org.jboss.tools.seam.ui.views.actions.ScopePresentationActionProvider;
@@ -58,6 +55,7 @@
@Override
protected void setUp() throws Exception {
super.setUp();
+ ScopePresentationActionProvider.setPackageStructureFlat(false);
WorkbenchUtils.getWorkbench().showPerspective(
RedHat4WebPerspectiveFactory.PERSPECTIVE_ID,
WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow());
@@ -73,8 +71,6 @@
}
public void testFlatSeamPackages(){
- ScopePresentationActionProvider.setPackageStructureFlat(true);
-
SeamCorePlugin.getSeamProject(project, true);
refreshProject(project);
@@ -99,27 +95,6 @@
" found",seamPackage!=null);
}
- public void testHierarchicalSeamPackages(){
- ScopePresentationActionProvider.setPackageStructureFlat(false);
-
- SeamCorePlugin.getSeamProject(project, true);
-
- refreshProject(project);
-
- CommonNavigator navigator = getSeamComponentsView();
-
- navigator.getCommonViewer().expandAll();
-
- Tree tree = navigator.getCommonViewer().getTree();
-
- updateTree(tree);
-
- ISeamPackage seamPackage = findSeamPackage(tree, "package1");
-
- assertTrue("Expected package 'package1' was not" +
- " found",seamPackage!=null);
- }
-
public void testAddComponentInXmlFile(){
SeamCorePlugin.getSeamProject(project, true);
@@ -441,6 +416,45 @@
assertTrue("Created Seam enabled project haven't been deleted from tree",0==content.getElements(ResourcesPlugin.getWorkspace().getRoot()).length);
}
+
+ public void testHierarchicalSeamPackages(){
+ SeamCorePlugin.getSeamProject(project, true);
+
+ refreshProject(project);
+
+ CommonNavigator navigator = getSeamComponentsView();
+
+ navigator.getCommonViewer().expandAll();
+// IActionBars bars = ((IViewSite)navigator.getSite()).getActionBars();
+// IMenuManager mm = bars.getMenuManager();
+// IContributionItem item = ((MenuManager)mm).find("Seam Packages");
+// IContributionItem item2 = ((MenuManager)item).find("package.hierarchical");
+
+ Tree tree = navigator.getCommonViewer().getTree();
+
+ updateTree(tree);
+
+ ISeamPackage seamPackage = findSeamPackage(tree, "package1");
+
+ assertTrue("Expected package 'package1' was not" +
+ " found",seamPackage!=null);
+
+ seamPackage = findSeamPackage(tree, "package1.package2");
+
+ assertTrue("Expected package 'package1.package2' was not" +
+ " found",seamPackage!=null);
+
+ seamPackage = findSeamPackage(tree, "package1.package2.package3");
+
+ assertTrue("Expected package 'package1.package2.package3' was not" +
+ " found",seamPackage!=null);
+
+ seamPackage = findSeamPackage(tree, "package1.package2.package3.package4");
+
+ assertTrue("Expected package 'package1.package2.package3.package4' was not" +
+ " found",seamPackage!=null);
+ }
+
private CommonNavigator getSeamComponentsView() {
IWorkbenchPage page = WorkbenchUtils.getWorkbenchActivePage();
CommonNavigator part = (CommonNavigator)page.findView(ISeamUiConstants.SEAM_COMPONENTS_VIEW_ID);
@@ -514,14 +528,13 @@
ISeamPackage pkg =(ISeamPackage)cur.getData();
//System.out.println("Searching: "+name+" found: "+pkg.getQualifiedName());
if(name.equals(pkg.getQualifiedName())) {
- seamPackage = pkg;
//System.out.println("Found!");
- break;
+ return pkg;
}
- }else {
- seamPackage = findSeamPackage(cur, name);
- if(seamPackage != null) return seamPackage;
}
+ seamPackage = findSeamPackage(cur, name);
+ if(seamPackage != null) return seamPackage;
+
}
return seamPackage;
17 years, 4 months
JBoss Tools SVN: r3615 - in branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: mozilla and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2007-09-13 12:47:11 -0400 (Thu, 13 Sep 2007)
New Revision: 3615
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaPreview.java
Log:
preview functionality was restored
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2007-09-13 15:53:20 UTC (rev 3614)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2007-09-13 16:47:11 UTC (rev 3615)
@@ -360,7 +360,7 @@
//Added by Max Areshkau
//was fixed bug(border which drawed by iflasher doesn't hide on MACOS when we swith
// to souce view)
- if(Platform.getOS().equals(Platform.OS_MACOSX)) {
+ if(Platform.getOS().equals(Platform.OS_MACOSX)&&controller!=null) {
controller.visualRefresh();
}
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java 2007-09-13 15:53:20 UTC (rev 3614)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java 2007-09-13 16:47:11 UTC (rev 3615)
@@ -10,15 +10,10 @@
******************************************************************************/
package org.jboss.tools.vpe.editor;
-import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
import org.jboss.tools.jst.jsp.preferences.VpePreference;
import org.jboss.tools.vpe.editor.context.VpePageContext;
@@ -30,11 +25,8 @@
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.TextUtil;
-import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
-import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
-import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -43,37 +35,12 @@
* @author A. Yukhovich
*/
public class VpePreviewDomBuilder extends VpeVisualDomBuilder {
- private static final String PSEUDO_ELEMENT = "br";
- private static final String PSEUDO_ELEMENT_ATTR = "vpe:pseudo-element";
- private static final String INIT_ELEMENT_ATTR = "vpe:init-element";
- private static final String MOZ_ANONCLASS_ATTR = "_MOZ_ANONCLASS";
- private static final String COMMENT_STYLE = "font-style:italic; color:green";
- private static final String COMMENT_PREFIX = "";
- private static final String COMMENT_SUFFIX = "";
- private static final String INCLUDE_ELEMENT_ATTR = "vpe:include-element";
- private static final int DRAG_AREA_WIDTH = 10;
- private static final int DRAG_AREA_HEIGHT = 10;
- private static final String ATTR_XMLNS = "xmlns";
-
- private MozillaEditor visualEditor;
- private XulRunnerEditor browser;
-// private MozillaBrowser browser;
- private nsIDOMDocument visualDocument;
- private nsIDOMElement visualContentArea;
- private VpePageContext pageContext;
- private nsIDOMNode headNode;
- private List includeStack;
+
+
boolean rebuildFlag = false;
+
- private static final String EMPTY_STRING = "";
-
- private static final String ATTR_VPE = "vpe";
- private static final String ATTR_VPE_INLINE_LINK_VALUE = "inlinelink";
-
- private static final String ATTR_REL_STYLESHEET_VALUE = "stylesheet";
-
private static final String YES_STRING = "yes";
- private static final String NO_STRING = "no";
/**
*
@@ -85,75 +52,34 @@
*/
public VpePreviewDomBuilder(VpeDomMapping domMapping, INodeAdapter sorceAdapter, VpeTemplateManager templateManager, MozillaEditor visualEditor, VpePageContext pageContext) {
super(domMapping, sorceAdapter, templateManager, visualEditor, pageContext);
- this.visualEditor = visualEditor;
- browser = visualEditor.getXulRunnerEditor();
- this.visualDocument = visualEditor.getDomDocument();
- this.visualContentArea = visualEditor.getContentArea();
- this.pageContext = pageContext;
- this.headNode = visualEditor.getHeadNode();
+
}
/**
*
- */
- public void buildDom(Document sourceDocument) {
- includeStack = new ArrayList();
- IEditorInput input = pageContext.getEditPart().getEditorInput();
- if (input instanceof IFileEditorInput) {
- IFile file = ((IFileEditorInput)input).getFile();
- if (file != null) {
- includeStack.add(new VpeIncludeInfo(null, file, pageContext.getSourceBuilder().getSourceDocument()));
- }
- }
- pageContext.refreshConnector();
- pageContext.installIncludeElements();
- addChildren(null, sourceDocument, visualContentArea);
- registerNodes(new VpeNodeMapping(sourceDocument, visualContentArea));
- }
-
- /**
- *
* @param sourceNode
- * @param visualNextNode
- * @param visualContainer
- * @return
- */
- private boolean addNode(Node sourceNode, nsIDOMNode visualNextNode, nsIDOMNode visualContainer) {
- nsIDOMNode visualNewNode = createNode(sourceNode, visualContainer);
- if (visualNewNode != null) {
- nsIDOMNode visualAddedNode = visualNextNode == null ?
- visualContainer.appendChild(visualNewNode) :
- visualContainer.insertBefore(visualNewNode, visualNextNode);
- return true;
- } else {
- return false;
- }
- }
-
- /**
- *
- * @param sourceNode
* @param visualOldContainer
* @return
*/
- private nsIDOMNode createNode(Node sourceNode, nsIDOMNode visualOldContainer) {
+ @Override
+ protected nsIDOMNode createNode(Node sourceNode, nsIDOMNode visualOldContainer) {
boolean registerFlag = isCurrentMainDocument();
switch (sourceNode.getNodeType()) {
case Node.ELEMENT_NODE:
Map xmlnsMap = createXmlns((Element)sourceNode);
Set ifDependencySet = new HashSet();
- pageContext.setCurrentVisualNode(visualOldContainer);
- VpeTemplate template = templateManager.getTemplate(pageContext, (Element)sourceNode, ifDependencySet);
+ getPageContext().setCurrentVisualNode(visualOldContainer);
+ VpeTemplate template = templateManager.getTemplate(getPageContext(), (Element)sourceNode, ifDependencySet);
VpeCreationData creationData;
if ( template.isHaveVisualPreview() ) {
- creationData = template.create(pageContext, sourceNode, visualDocument);
+ creationData = template.create(getPageContext(), sourceNode, getVisualDocument());
} else {
- nsIDOMElement tempHTMLElement = visualDocument.createElement(HTML.TAG_DIV);
+ nsIDOMElement tempHTMLElement = getVisualDocument().createElement(HTML.TAG_DIV);
creationData = new VpeCreationData(tempHTMLElement);
}
- pageContext.setCurrentVisualNode(null);
+ getPageContext().setCurrentVisualNode(null);
nsIDOMElement visualNewElement;
visualNewElement = (nsIDOMElement)creationData.getNode();
setTooltip((Element)sourceNode, visualNewElement);
@@ -163,25 +89,26 @@
}
if (template.isChildren()) {
- List childrenInfoList = creationData.getChildrenInfoList();
+ List<?> childrenInfoList = creationData.getChildrenInfoList();
if (childrenInfoList == null) {
addChildren(template, sourceNode, visualNewElement != null ? visualNewElement : visualOldContainer);
} else {
addChildren(template, sourceNode, visualOldContainer, childrenInfoList);
}
}
- pageContext.setCurrentVisualNode(visualOldContainer);
- template.validate(pageContext, (Element)sourceNode, visualDocument, creationData);
- pageContext.setCurrentVisualNode(null);
+ getPageContext().setCurrentVisualNode(visualOldContainer);
+ template.validate(getPageContext(), (Element)sourceNode, getVisualDocument(), creationData);
+ getPageContext().setCurrentVisualNode(null);
return visualNewElement;
case Node.TEXT_NODE:
+ //TODO Max Areshkau merge with old version
String sourceText = sourceNode.getNodeValue();
if (sourceText.trim().length() <= 0) {
registerNodes(new VpeNodeMapping(sourceNode, null));
return null;
}
String visualText = TextUtil.visualText(sourceText);
- nsIDOMNode visualNewTextNode = visualDocument.createTextNode(visualText);
+ nsIDOMNode visualNewTextNode = getVisualDocument().createTextNode(visualText);
if (registerFlag) {
registerNodes(new VpeNodeMapping(sourceNode, visualNewTextNode));
}
@@ -198,4 +125,5 @@
}
return null;
}
+
}
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-09-13 15:53:20 UTC (rev 3614)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-09-13 16:47:11 UTC (rev 3615)
@@ -92,7 +92,6 @@
private nsIDOMDocument visualDocument;
private nsIDOMElement visualContentArea;
private VpePageContext pageContext;
- // TODO Max Areshkau figure out with DnD
private VpeDnD dnd;
private nsIDOMNode headNode;
private List includeStack;
@@ -146,11 +145,9 @@
xulRunnerEditor = visualEditor.getXulRunnerEditor();
this.visualDocument = visualEditor.getDomDocument();
this.visualContentArea = visualEditor.getContentArea();
- // TODO Max Areshkau figure out
this.dnd = new VpeDnD();
this.pageContext = pageContext;
this.headNode = visualEditor.getHeadNode();
- // TODO Max Areshkau figure out
dropper = new VpeDnd();
dropper.setDndData(false, true);
}
@@ -291,7 +288,7 @@
return border;
}
- private nsIDOMNode createNode(Node sourceNode, nsIDOMNode visualOldContainer) {
+ protected nsIDOMNode createNode(Node sourceNode, nsIDOMNode visualOldContainer) {
boolean registerFlag = isCurrentMainDocument();
switch (sourceNode.getNodeType()) {
case Node.ELEMENT_NODE:
@@ -1633,4 +1630,32 @@
this.dnd = dnd;
}
+
+ /**
+ * @return the pageContext
+ */
+ protected VpePageContext getPageContext() {
+ return pageContext;
+ }
+
+ /**
+ * @param pageContext the pageContext to set
+ */
+ protected void setPageContext(VpePageContext pageContext) {
+ this.pageContext = pageContext;
+ }
+
+ /**
+ * @return the visualDocument
+ */
+ protected nsIDOMDocument getVisualDocument() {
+ return visualDocument;
+ }
+
+ /**
+ * @param visualDocument the visualDocument to set
+ */
+ protected void setVisualDocument(nsIDOMDocument visualDocument) {
+ this.visualDocument = visualDocument;
+ }
}
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2007-09-13 15:53:20 UTC (rev 3614)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2007-09-13 16:47:11 UTC (rev 3615)
@@ -83,6 +83,7 @@
private IVpeToolBarManager vpeToolBarManager;
private FormatControllerManager formatControllerManager = new FormatControllerManager();
private VpeController controller;
+ private Link link = null;
public void doSave(IProgressMonitor monitor) {
}
@@ -114,8 +115,6 @@
controller.setToolbarFormatControllerManager(formatControllerManager);
}
- Link link = null;
-
public void createPartControl(final Composite parent) {
vpeToolBarManager = new VpeToolBarManager();
//Setting Layout for the parent Composite
@@ -320,10 +319,6 @@
if (contentAreaEventListener != null) {
contentAreaEventListener.setEditorDomEventListener(listener);
}
- if (xulRunnerEditor != null) {
- // TODO Max Areshkau add context menu listener support
-// xulRunnerEditor.setContextMenuListener(listener);
- }
}
public nsIDOMDocument getDomDocument() {
@@ -332,10 +327,26 @@
}
return domDocument;
}
+
+ /**
+ * @param domDocument the domDocument to set
+ */
+ protected void setDomDocument(nsIDOMDocument domDocument) {
+
+ this.domDocument = domDocument;
+ }
public nsIDOMElement getContentArea() {
return contentArea;
}
+ /**
+ * Sets content area element
+ * @return
+ */
+ protected void setContentArea(nsIDOMElement element) {
+
+ this.contentArea=element;
+ }
public nsIDOMNode getHeadNode() {
return headNode;
@@ -349,16 +360,8 @@
return xulRunnerEditor.getBrowser();
}
- // TODO Max Areshkau add DnD support
-// public VpeDnD getLocalDnD() {
-// if (contentAreaEventListener != null) {
-// return contentAreaEventListener.getLocalDnD();
-// }
-// return null;
-// }
-
protected nsIDOMElement findContentArea() {
- nsIDOMElement area = null;
+ nsIDOMElement area = xulRunnerEditor.getDOMDocument().getDocumentElement();
nsIDOMNodeList nodeList = xulRunnerEditor.getDOMDocument().getElementsByTagName(HTML.TAG_BODY);
long length = nodeList.getLength();
for(long i=0; i<length; i++) {
@@ -372,7 +375,7 @@
break;
}
}
-// nsIDOMElement area = findContentArea(root);
+// area = findContentArea(root);
if (area == null) {
return null;
}
@@ -450,8 +453,6 @@
contentArea = findContentArea();
addDomEventListeners();
addSelectionListener();
- // TODO Max Areshkau figure out with clipboard drag drop hooks
-// addClipboardDragDropHooks();
if (editorLoadWindowListener != null) {
editorLoadWindowListener.load();
}
@@ -467,7 +468,7 @@
contentAreaEventTarget.addEventListener("click", contentAreaEventListener, false); //$NON-NLS-1$
contentAreaEventTarget.addEventListener("mousedown", contentAreaEventListener, false); //$NON-NLS-1$
contentAreaEventTarget.addEventListener("mouseup", contentAreaEventListener, false); //$NON-NLS-1$
- contentAreaEventTarget.addEventListener("mousemove", contentAreaEventListener, false); //$NON-NLS-1$
+ contentAreaEventTarget.addEventListener(MozillaDomEventListener.MOUSEMOVEEVENTTYPE, contentAreaEventListener, false); //$NON-NLS-1$
//context menu event handler(add by Max Areshkau)
contentAreaEventTarget.addEventListener(MozillaDomEventListener.CONTEXTMENUEVENTTYPE, contentAreaEventListener, false);
@@ -570,5 +571,34 @@
public XulRunnerEditor getXulRunnerEditor() {
return xulRunnerEditor;
}
+
+ /**
+ * @param xulRunnerEditor the xulRunnerEditor to set
+ */
+ protected void setXulRunnerEditor(XulRunnerEditor xulRunnerEditor) {
+ this.xulRunnerEditor = xulRunnerEditor;
+ }
+
+ /**
+ * @return the controller
+ */
+ protected VpeController getController() {
+ return controller;
+ }
+
+ /**
+ * @return the link
+ */
+ protected Link getLink() {
+ return link;
+ }
+
+ /**
+ * @param link the link to set
+ */
+ protected void setLink(Link link) {
+ this.link = link;
+ }
+
}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaPreview.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaPreview.java 2007-09-13 15:53:20 UTC (rev 3614)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaPreview.java 2007-09-13 16:47:11 UTC (rev 3615)
@@ -13,8 +13,6 @@
import java.net.MalformedURLException;
import java.net.URL;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.events.MouseEvent;
@@ -23,10 +21,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
@@ -34,7 +28,6 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.jboss.tools.vpe.VpePlugin;
-import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.VpeEditorPart;
import org.jboss.tools.vpe.editor.VpePreviewDomBuilder;
import org.jboss.tools.vpe.editor.VpeSourceDomBuilder;
@@ -45,76 +38,36 @@
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
import org.jboss.tools.vpe.messages.VpeUIMessages;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
-import org.mozilla.interfaces.nsIDOMDocument;
-import org.mozilla.interfaces.nsIDOMElement;
-import org.mozilla.interfaces.nsIDOMEventTarget;
-import org.mozilla.interfaces.nsIDOMNode;
-import org.w3c.dom.Element;
/**
- * a class implementation of mozilla previre
+ * a class implementation of mozilla preview
* @author A. Yukhovich
*/
public class MozillaPreview extends MozillaEditor {
- private XulRunnerEditor editor;
- private nsIDOMDocument domDocument;
- private nsIDOMEventTarget documentEventTarget;
- private nsIDOMElement contentArea;
- private nsIDOMNode headNode;
- private nsIDOMEventTarget contentAreaEventTarget;
- private MozillaDomEventListener contentAreaEventListener;
- private MozillaBaseEventListener baseEventListener;
+
private EditorLoadWindowListener editorLoadWindowListener;
private EditorDomEventListener editorDomEventListener;
- private VpeController controller;
- private Link link = null;
private VpeTemplateManager templateManager;
private VpePageContext pageContext;
- private BundleMap bundle;
private StructuredTextEditor sourceEditor;
private VpeEditorPart editPart;
- private VpeDomMapping domMapping;
private IDOMDocument sourceDocument;
public MozillaPreview(VpeEditorPart editPart, StructuredTextEditor sourceEditor) {
- templateManager = VpeTemplateManager.getInstance();
-
- this.sourceEditor = sourceEditor;
- this.editPart = editPart;
+ setTemplateManager(VpeTemplateManager.getInstance());
+ setSourceEditor(sourceEditor);
+ setEditPart(editPart);
}
- public void doSave(IProgressMonitor monitor) {
- }
- public void doSaveAs() {
- }
-
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- super.setInput(input);
- }
-
- public void setInput(IEditorInput input) {
- boolean isVisualRefreshRequired = (getEditorInput() != null && getEditorInput() != input && controller != null);
- super.setInput(input);
- if(isVisualRefreshRequired) controller.visualRefresh();
- }
-
- public boolean isDirty() {
- return false;
- }
-
- public boolean isSaveAsAllowed() {
- return false;
- }
-
-
/* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createPartControl(final Composite parent) {
try {
- editor = new XulRunnerEditor(parent) {
+ setXulRunnerEditor(new XulRunnerEditor(parent) {
public void onLoadWindow() {
super.onLoadWindow();
MozillaPreview.this.onLoadWindow();
@@ -130,21 +83,21 @@
editorDomEventListener.onHideTooltip();
}
}
- };
- editor.setURL(INIT_URL);
- editor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ });
+ getXulRunnerEditor().setURL(INIT_URL);
+ getXulRunnerEditor().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
} catch (Exception e) {
Label title = new Label(parent, SWT.WRAP);
title.setText(VpeUIMessages.MOZILLA_LOADING_ERROR);
title.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- link = new Link(parent, SWT.WRAP);
- link.setText(VpeUIMessages.MOZILLA_LOADING_ERROR_LINK_TEXT);
- link.setToolTipText(VpeUIMessages.MOZILLA_LOADING_ERROR_LINK);
- link.setForeground(link.getDisplay().getSystemColor(SWT.COLOR_BLUE));
- link.addMouseListener(new MouseListener() {
+ setLink(new Link(parent, SWT.WRAP));
+ getLink().setText(VpeUIMessages.MOZILLA_LOADING_ERROR_LINK_TEXT);
+ getLink().setToolTipText(VpeUIMessages.MOZILLA_LOADING_ERROR_LINK);
+ getLink().setForeground(getLink().getDisplay().getSystemColor(SWT.COLOR_BLUE));
+ getLink().addMouseListener(new MouseListener() {
public void mouseDown(org.eclipse.swt.events.MouseEvent e) {
- BusyIndicator.showWhile(link.getDisplay(), new Runnable() {
+ BusyIndicator.showWhile(getLink().getDisplay(), new Runnable() {
public void run() {
URL theURL=null;;
try {
@@ -168,157 +121,147 @@
public void mouseUp(MouseEvent e) {
}
});
- link.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ getLink().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label fill = new Label(parent, SWT.WRAP);
fill.setLayoutData(new GridData(GridData.FILL_BOTH));
}
}
- private ToolItem createToolItem(ToolBar parent, int type, String image, String toolTipText) {
- ToolItem item = new ToolItem(parent, type);
- item.setImage(ImageDescriptor.createFromFile(MozillaPreview.class, image).createImage());
- item.setToolTipText(toolTipText);
- return item;
- }
-
- public void setFocus() {
- if(editor!=null) {
- editor.setFocus();
- } else {
- //link.setFocus();
- }
- }
-
- public void dispose() {
- removeDomEventListeners();
-// removeClipboardDragDropHooks();
- super.dispose();
-
- if (contentArea != null) {
- contentArea = null;
- }
- if (domDocument != null) {
- domDocument = null;
- }
- if (editor != null) {
- editor.dispose();
- editor = null;
- }
- }
-
+ @Override
public void setEditorLoadWindowListener(EditorLoadWindowListener listener) {
editorLoadWindowListener = listener;
}
- public void setEditorDomEventListener(EditorDomEventListener listener) {
- editorDomEventListener = listener;
- if (contentAreaEventListener != null) {
- contentAreaEventListener.setEditorDomEventListener(listener);
- }
- // TODO Max Areshkau add Context Menu Listener
-// if (editor != null) {
-// editor.setContextMenuListener(listener);
-// }
- }
/**
*
*/
private void onLoadWindow() {
- contentArea = findContentArea();
- addDomEventListeners();
- addSelectionListener();
+
+ setContentArea(findContentArea());
if (editorLoadWindowListener != null) {
editorLoadWindowListener.load();
}
}
+ @Override
+ public void showResizer() {
+ }
- private void addDomEventListeners() {
- if (contentArea != null) {
- try {
- contentAreaEventListener = new MozillaDomEventListener();
- } catch (Exception e) {
- }
+ @Override
+ public void hideResizer() {
+ }
- if (contentAreaEventListener != null) {
- contentAreaEventListener.setVisualEditor(editor);
- contentAreaEventTarget = (nsIDOMEventTarget) contentArea.queryInterface(nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID);
- contentAreaEventTarget.addEventListener("click", contentAreaEventListener, false); //$NON-NLS-1$
- contentAreaEventTarget.addEventListener("mousedown", contentAreaEventListener, false); //$NON-NLS-1$
- contentAreaEventTarget.addEventListener("mouseup", contentAreaEventListener, false); //$NON-NLS-1$
- contentAreaEventTarget.addEventListener("mousemove", contentAreaEventListener, false); //$NON-NLS-1$
-
- documentEventTarget = (nsIDOMEventTarget) getDomDocument().queryInterface(nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID);
- documentEventTarget.addEventListener("keypress", contentAreaEventListener, false); //$NON-NLS-1$
- } else {
- baseEventListener = new MozillaBaseEventListener();
- }
+ //TODO Max Areshkau logic error (we should first call buildDom and only then we can call rebuildDom)
+ public void rebuildDom() {
+ if(getPageContext()!=null&&getPageContext().getVisualBuilder()!=null&&getSourceDocument()!=null) {
+
+ getPageContext().getVisualBuilder().rebuildDom(getSourceDocument());
}
}
- private void removeDomEventListeners() {
- if (contentAreaEventTarget != null && contentAreaEventListener != null) {
- contentAreaEventTarget.removeEventListener("click", contentAreaEventListener, false); //$NON-NLS-1$
- contentAreaEventTarget.removeEventListener("mousedown", contentAreaEventListener, false); //$NON-NLS-1$
- contentAreaEventTarget.removeEventListener("mouseup", contentAreaEventListener, false); //$NON-NLS-1$
- contentAreaEventTarget.removeEventListener("mousemove", contentAreaEventListener, false); //$NON-NLS-1$
- }
- if (domDocument != null && documentEventTarget != null) {
- documentEventTarget.removeEventListener("keypress", contentAreaEventListener, false); //$NON-NLS-1$
- }
+ //TODO Max Areshkau logic error (we should first call buildDom and only then we can call rebuildDom)
+ public void buildDom() {
+ BundleMap bundle = new BundleMap();
+ bundle.init(getSourceEditor());
+
+ setPageContext(new VpePageContext(getTemplateManager(), bundle, getEditPart()));
+
+ VpeDomMapping domMapping = new VpeDomMapping(getPageContext());
+ VpeSourceDomBuilder sourceBuilder = new VpeSourceDomBuilder(domMapping, null, getTemplateManager(), getSourceEditor(), getPageContext());
+ VpeVisualDomBuilder visualBuilder = new VpePreviewDomBuilder(domMapping, null, getTemplateManager(), this, getPageContext());
+ getPageContext().setSourceDomBuilder(sourceBuilder);
+ getPageContext().setVisualDomBuilder(visualBuilder);
+
+ IDOMModel sourceModel = (IDOMModel)getSourceEditor().getModel();
+ setSourceDocument(sourceModel.getDocument());
+
+ visualBuilder.buildDom(getSourceDocument());
}
- private void addSelectionListener() {
- // TODO Max Areshkau add Selection Controller
-// if (contentAreaEventListener != null) {
-// nsISelectionController selectionController = editor.getSelectionController();
-// selectionController.addSelectionListener(contentAreaEventListener);
-// }
+ /**
+ * @return the sourceDocument
+ */
+ protected IDOMDocument getSourceDocument() {
+ return sourceDocument;
}
- private void removeSelectionListener() {
- // TODO Max Areshkau add Selection Controller
-// nsISelectionController selectionController = editor.getSelectionController();
-// selectionController.removeSelectionListener(contentAreaEventListener.getSelectionListener());
+ /**
+ * @param sourceDocument the sourceDocument to set
+ */
+ protected void setSourceDocument(IDOMDocument sourceDocument) {
+ this.sourceDocument = sourceDocument;
}
- public void setSelectionRectangle(Element element, int resizerConstrains, boolean scroll) {
- // TODO Sergey Vasilyev figure out with selection in preview
-// if (contentAreaEventListener != null) {
-// editor.setSelectionRectangle((nsIDOMElement)element, resizerConstrains, scroll);
-// }
+
+
+ /**
+ * @return the pageContext
+ */
+ private VpePageContext getPageContext() {
+ return pageContext;
}
- public void showResizer() {
+
+
+ /**
+ * @param pageContext the pageContext to set
+ */
+ private void setPageContext(VpePageContext pageContext) {
+ this.pageContext = pageContext;
}
- public void hideResizer() {
+
+
+ /**
+ * @return the editPart
+ */
+ private VpeEditorPart getEditPart() {
+ return editPart;
}
+
+
/**
- *
+ * @param editPart the editPart to set
*/
- public void rebuildDom() {
- pageContext.getVisualBuilder().rebuildDom(sourceDocument);
+ private void setEditPart(VpeEditorPart editPart) {
+ this.editPart = editPart;
}
+
+
/**
+ * @return the templateManager
*/
- public void buildDom() {
- bundle = new BundleMap();
- bundle.init(sourceEditor);
-
- pageContext = new VpePageContext(templateManager, bundle, editPart);
-
- domMapping = new VpeDomMapping(pageContext);
- VpeSourceDomBuilder sourceBuilder = new VpeSourceDomBuilder(domMapping, null, templateManager, sourceEditor, pageContext);
- VpeVisualDomBuilder visualBuilder = new VpePreviewDomBuilder(domMapping, null, templateManager, this, pageContext);
- pageContext.setSourceDomBuilder(sourceBuilder);
- pageContext.setVisualDomBuilder(visualBuilder);
+ private VpeTemplateManager getTemplateManager() {
+ return templateManager;
+ }
- IDOMModel sourceModel = (IDOMModel)sourceEditor.getModel();
- sourceDocument = sourceModel.getDocument();
- visualBuilder.buildDom(sourceDocument);
+
+ /**
+ * @param templateManager the templateManager to set
+ */
+ private void setTemplateManager(VpeTemplateManager templateManager) {
+ this.templateManager = templateManager;
}
+
+
+
+ /**
+ * @return the sourceEditor
+ */
+ private StructuredTextEditor getSourceEditor() {
+ return sourceEditor;
+ }
+
+
+
+ /**
+ * @param sourceEditor the sourceEditor to set
+ */
+ private void setSourceEditor(StructuredTextEditor sourceEditor) {
+ this.sourceEditor = sourceEditor;
+ }
+
}
\ No newline at end of file
17 years, 4 months
JBoss Tools SVN: r3614 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2007-09-13 11:53:20 -0400 (Thu, 13 Sep 2007)
New Revision: 3614
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/VpeVisualDomBuilder.java
Log:
code adjustment
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 2007-09-13 14:58:21 UTC (rev 3613)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpePreviewDomBuilder.java 2007-09-13 15:53:20 UTC (rev 3614)
@@ -63,7 +63,8 @@
* @param visualOldContainer
* @return
*/
- private Node createNode(Node sourceNode, Node visualOldContainer) {
+ @Override
+ protected Node createNode(Node sourceNode, Node visualOldContainer) {
boolean registerFlag = isCurrentMainDocument();
switch (sourceNode.getNodeType()) {
case Node.ELEMENT_NODE:
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-09-13 14:58:21 UTC (rev 3613)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-09-13 15:53:20 UTC (rev 3614)
@@ -323,7 +323,7 @@
return border;
}
- private Node createNode(Node sourceNode, Node visualOldContainer) {
+ protected Node createNode(Node sourceNode, Node visualOldContainer) {
boolean registerFlag = isCurrentMainDocument();
switch (sourceNode.getNodeType()) {
case Node.ELEMENT_NODE:
@@ -1196,7 +1196,7 @@
case Node.ELEMENT_NODE:
VpeNodeMapping nodeMapping = domMapping.getNodeMapping(container);
if (nodeMapping != null && nodeMapping.getType() == VpeNodeMapping.ELEMENT_MAPPING) {
- canDrop = ((VpeElementMapping)nodeMapping).getTemplate().canInnerDrop(pageContext, container, dragNode);
+ canDrop = ((VpeElementMapping)nodeMapping).getTemplate().canInnerDrop(pageContext, container, dragNode);
}
if (!canDrop) {
if(!checkParentsTemplates) return new VpeSourceInnerDropInfo(container, offset, canDrop);
17 years, 4 months
JBoss Tools SVN: r3613 - in trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model: helpers/bean and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-13 10:58:21 -0400 (Thu, 13 Sep 2007)
New Revision: 3613
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/AddManagedBeanPropertiesContext.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/AddManagedPropertySupport.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/bean/BeanHelper.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/bean/ManagedBeanHelper.java
Log:
JBIDE-895
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/AddManagedBeanPropertiesContext.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/AddManagedBeanPropertiesContext.java 2007-09-13 14:31:29 UTC (rev 3612)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/AddManagedBeanPropertiesContext.java 2007-09-13 14:58:21 UTC (rev 3613)
@@ -33,7 +33,7 @@
properties = new HashMap<String,IJavaElement>();
try {
properties = BeanHelper.getJavaProperties(type);
- } catch (Exception e) {
+ } catch (JavaModelException e) {
//ignore
}
if(properties.size() != enablement.length) {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/AddManagedPropertySupport.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/AddManagedPropertySupport.java 2007-09-13 14:31:29 UTC (rev 3612)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/AddManagedPropertySupport.java 2007-09-13 14:58:21 UTC (rev 3613)
@@ -14,6 +14,7 @@
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.common.java.generation.*;
import org.jboss.tools.common.meta.action.*;
import org.jboss.tools.common.meta.action.impl.*;
@@ -60,7 +61,7 @@
classCheck.update(s);
try {
fields = BeanHelper.getJavaProperties(classCheck.getExistingClass());
- } catch (Exception e) {
+ } catch (JavaModelException e) {
fields = new TreeMap<String,IJavaElement>();
}
XModelObject[] cs = getTarget().getChildren("JSFManagedProperty");
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/bean/BeanHelper.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/bean/BeanHelper.java 2007-09-13 14:31:29 UTC (rev 3612)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/bean/BeanHelper.java 2007-09-13 14:58:21 UTC (rev 3613)
@@ -21,7 +21,7 @@
public class BeanHelper {
- public static Map<String,IJavaElement> getJavaProperties(IType type) throws Exception {
+ public static Map<String,IJavaElement> getJavaProperties(IType type) throws JavaModelException {
Map<String,IJavaElement> map = new TreeMap<String,IJavaElement>();
if(type == null || !type.exists()) return map;
IField[] fs = type.getFields();
@@ -44,7 +44,7 @@
return (rootName.toUpperCase().equals(rootName)) ? rootName : rootName.substring(0, 1).toLowerCase() + rootName.substring(1);
}
- static Map<String,IJavaElement> getSuperTypeJavaProperties(IType type) throws Exception {
+ static Map<String,IJavaElement> getSuperTypeJavaProperties(IType type) throws JavaModelException {
String scn = type.getSuperclassName();
if(scn == null || scn.length() == 0 || scn.equals("java.lang.Object")) return null;
String[][] rs = type.resolveType(scn);
@@ -71,7 +71,7 @@
}
}
- public static IMethod findGetter(IType type, String property) throws Exception {
+ public static IMethod findGetter(IType type, String property) throws JavaModelException {
IMethod[] ms = type.getMethods();
for (int i = 0; i < ms.length; i++) {
String n = ms[i].getElementName();
@@ -88,7 +88,7 @@
return null;
}
- public static IMethod findSetter(IType type, String property) throws Exception {
+ public static IMethod findSetter(IType type, String property) throws JavaModelException {
IMethod[] ms = type.getMethods();
for (int i = 0; i < ms.length; i++) {
String n = ms[i].getElementName();
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/bean/ManagedBeanHelper.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/bean/ManagedBeanHelper.java 2007-09-13 14:31:29 UTC (rev 3612)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/bean/ManagedBeanHelper.java 2007-09-13 14:58:21 UTC (rev 3613)
@@ -22,7 +22,7 @@
IJavaProject jp = BeanHelper.getJavaProject(bean);
try {
return jp == null ? null : jp.findType(typename);
- } catch (Exception e) {
+ } catch (JavaModelException e) {
//ignore
return null;
}
17 years, 4 months
JBoss Tools SVN: r3612 - in trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard: runtime2 and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-13 10:31:29 -0400 (Thu, 13 Sep 2007)
New Revision: 3612
Modified:
trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/runtime/VerifyWizardView.java
trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/runtime2/VTaskListenerImpl.java
Log:
JBIDE-893
Modified: trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/runtime/VerifyWizardView.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/runtime/VerifyWizardView.java 2007-09-13 14:25:33 UTC (rev 3611)
+++ trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/runtime/VerifyWizardView.java 2007-09-13 14:31:29 UTC (rev 3612)
@@ -28,6 +28,7 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.TreeItem;
+import org.jboss.tools.common.verification.ui.XStudioVerificationPlugin;
import org.jboss.tools.common.verification.ui.vrules.preferences.VerificationPreferencePage;
import org.jboss.tools.common.verification.ui.vrules.wizard.DescriptionManager;
import org.jboss.tools.common.meta.key.WizardKeys;
@@ -227,9 +228,11 @@
if(o == null) return -1;
String s = o.getAttributeValue(VerificationPreferencePage.ATTR_ERRORS_NUMBER_LIMIT);
int limit = -1;
- if(!"unlimited".equals(s)) try {
+ if(!"unlimited".equals(s) && s != null && s.length() > 0) try {
limit = Integer.parseInt(s);
- } catch (Exception e) {}
+ } catch (NumberFormatException e) {
+ XStudioVerificationPlugin.getPluginLog().logError(e);
+ }
return limit;
}
Modified: trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/runtime2/VTaskListenerImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/runtime2/VTaskListenerImpl.java 2007-09-13 14:25:33 UTC (rev 3611)
+++ trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/runtime2/VTaskListenerImpl.java 2007-09-13 14:31:29 UTC (rev 3612)
@@ -35,9 +35,17 @@
addMarkers();
long endTime = System.currentTimeMillis();
long delta = 500 + startTime - endTime;
- if(delta > 0) try { Thread.sleep(delta); } catch (Exception e) {}
+ if(delta > 0) try {
+ Thread.sleep(delta);
+ } catch (InterruptedException e) {
+ //ignore
+ }
view.onFinish();
- try { Thread.sleep(200); } catch (Exception e) {}
+ try {
+ Thread.sleep(200);
+ } catch (InterruptedException e) {
+ //ignore
+ }
view.action("Close");
task.removeTaskListener(this);
}
17 years, 4 months
JBoss Tools SVN: r3611 - trunk/common/plugins/org.jboss.tools.common.gef/src/org/jboss/tools/common/gef.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-13 10:25:33 -0400 (Thu, 13 Sep 2007)
New Revision: 3611
Modified:
trunk/common/plugins/org.jboss.tools.common.gef/src/org/jboss/tools/common/gef/GEFEditor.java
Log:
JBIDE-893
Modified: trunk/common/plugins/org.jboss.tools.common.gef/src/org/jboss/tools/common/gef/GEFEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.gef/src/org/jboss/tools/common/gef/GEFEditor.java 2007-09-13 14:18:48 UTC (rev 3610)
+++ trunk/common/plugins/org.jboss.tools.common.gef/src/org/jboss/tools/common/gef/GEFEditor.java 2007-09-13 14:25:33 UTC (rev 3611)
@@ -70,6 +70,7 @@
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+import org.jboss.tools.common.CommonPlugin;
import org.jboss.tools.common.gef.action.IDiagramSelectionProvider;
import org.jboss.tools.common.gef.outline.xpl.DiagramContentOutlinePage;
import org.jboss.tools.common.gef.xpl.GEFSplitter;
@@ -430,52 +431,64 @@
protected int loadPaletteSize() {
IFile file = getFile();
int size = PALETTE_MIN_SIZE;
- if (file == null)
+ if (file == null || !file.isAccessible()) {
return size;
+ }
try {
String s = file.getPersistentProperty(PALETTE_SIZE_KEY);
if (s != null) {
size = Integer.parseInt(s);
}
- } catch (Exception e) {
+ } catch (CoreException e) {
+ CommonPlugin.getPluginLog().logError(e);
+ } catch (NumberFormatException e) {
+ CommonPlugin.getPluginLog().logError(e);
}
return size;
}
protected void savePaletteSize(int fixedSise) {
IFile file = getFile();
- if (file == null)
+ if (file == null || !file.isAccessible()) {
return;
+ }
try {
- String s = String.valueOf(fixedSise);
+ String s = "" + fixedSise;
file.setPersistentProperty(PALETTE_SIZE_KEY, s);
- } catch (Exception e) {
+ } catch (CoreException e) {
+ CommonPlugin.getPluginLog().logError(e);
}
}
protected double loadZoomSize() {
IFile file = getFile();
double size = 1.0;
- if (file == null)
+ if (file == null || !file.isAccessible()) {
return size;
+ }
try {
String s = file.getPersistentProperty(ZOOM_SIZE_KEY);
- if (s != null) {
+ if (s != null && s.length() > 0) {
size = Double.parseDouble(s);
}
- } catch (Exception e) {
+ } catch (CoreException e) {
+ CommonPlugin.getPluginLog().logError(e);
+ } catch (NumberFormatException e) {
+ CommonPlugin.getPluginLog().logError(e);
}
return size;
}
protected void saveZoomSize(double zoom) {
IFile file = getFile();
- if (file == null)
+ if (file == null || !file.isAccessible()) {
return;
+ }
try {
- String s = String.valueOf(zoom);
+ String s = "" + zoom;
file.setPersistentProperty(ZOOM_SIZE_KEY, s);
- } catch (Exception e) {
+ } catch (CoreException e) {
+ CommonPlugin.getPluginLog().logError(e);
}
}
17 years, 4 months
JBoss Tools SVN: r3610 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-13 10:18:48 -0400 (Thu, 13 Sep 2007)
New Revision: 3610
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/XModelObjectSelectionProvider.java
Log:
JBIDE-893
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/XModelObjectSelectionProvider.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/XModelObjectSelectionProvider.java 2007-09-13 14:06:29 UTC (rev 3609)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/XModelObjectSelectionProvider.java 2007-09-13 14:18:48 UTC (rev 3610)
@@ -55,7 +55,7 @@
if(this.host == host) return;
if(this.host != null) {
try {
- host.removeSelectionChangedListener(this);
+ this.host.removeSelectionChangedListener(this);
} catch (Exception e) {
ModelUIPlugin.getPluginLog().logError(e);
}
17 years, 4 months
JBoss Tools SVN: r3609 - in trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools: common/text/xml/ui and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-13 10:06:29 -0400 (Thu, 13 Sep 2007)
New Revision: 3609
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XmlEditorPlugin.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/FreeCaretStyledText.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/xpl/XmlPreferenceConstants.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/xpl/ToggleOccurencesMarkUpAction.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/jst/jsp/text/xpl/DefaultStructuredTextOccurrenceStructureProvider.java
Log:
JBIDE-893
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XmlEditorPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XmlEditorPlugin.java 2007-09-13 13:55:43 UTC (rev 3608)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XmlEditorPlugin.java 2007-09-13 14:06:29 UTC (rev 3609)
@@ -99,7 +99,9 @@
Method m = AbstractUIPlugin.class.getDeclaredMethod("initializeDefaultPluginPreferences", new Class[0]);
m.setAccessible(true);
m.invoke(JavaPlugin.getDefault(), new Object[0]);
- } catch (Exception e) {}
+ } catch (Exception e) {
+ //ignore
+ }
IPreferenceStore store = getPreferenceStore();
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/FreeCaretStyledText.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/FreeCaretStyledText.java 2007-09-13 13:55:43 UTC (rev 3608)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/FreeCaretStyledText.java 2007-09-13 14:06:29 UTC (rev 3609)
@@ -70,7 +70,7 @@
try {
super.redrawRange(start, length, clearBackground);
} catch (Exception x) {
-
+ //ignore
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/xpl/XmlPreferenceConstants.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/xpl/XmlPreferenceConstants.java 2007-09-13 13:55:43 UTC (rev 3608)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/xpl/XmlPreferenceConstants.java 2007-09-13 14:06:29 UTC (rev 3609)
@@ -12,16 +12,19 @@
*******************************************************************************/
package org.jboss.tools.common.text.xml.ui.xpl;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
+import org.eclipse.jdt.internal.core.ModelUpdater;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.jboss.tools.common.text.xml.XmlEditorPlugin;
/**
* @author Jeremy
@@ -163,7 +166,15 @@
Method m = AbstractUIPlugin.class.getDeclaredMethod("initializeDefaultPluginPreferences", new Class[0]);
m.setAccessible(true);
m.invoke(plugin, new Object[0]);
- } catch (Exception e) {}
+ } catch (NoSuchMethodException e1) {
+ //ignore
+ } catch (IllegalAccessException e2) {
+ //ignore
+ } catch (IllegalArgumentException e3) {
+ XmlEditorPlugin.getPluginLog().logError(e3);
+ } catch (InvocationTargetException e4) {
+ XmlEditorPlugin.getPluginLog().logError(e4);
+ }
final IPreferenceStore editorsStore = ((AbstractUIPlugin)plugin).getPreferenceStore();
for (int i = 0; i < BOOLEAN_PROPERTIES.length; i++) {
String p = BOOLEAN_PROPERTIES[i];
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/xpl/ToggleOccurencesMarkUpAction.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/xpl/ToggleOccurencesMarkUpAction.java 2007-09-13 13:55:43 UTC (rev 3608)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/xpl/ToggleOccurencesMarkUpAction.java 2007-09-13 14:06:29 UTC (rev 3609)
@@ -102,10 +102,11 @@
String relPath= getString(bundle, imageKey, null);
try {
- ImageDescriptor id= ImageDescriptor.createFromURL(makeIconFileURL("resources/icons/xpl", relPath)); //$NON-NLS-1$
+ ImageDescriptor id = ImageDescriptor.createFromURL(makeIconFileURL("resources/icons/xpl", relPath)); //$NON-NLS-1$
if (id != null)
setImageDescriptor(id);
} catch (MalformedURLException e) {
+ //ignore
}
relPath= getString(bundle, disabledImageKey, null);
@@ -114,6 +115,7 @@
if (id != null)
setDisabledImageDescriptor(id);
} catch (MalformedURLException e) {
+ //ignore
}
}
@@ -128,6 +130,7 @@
markOccurences = fPreferenceStore.getBoolean(fKey);
fPreferenceStore.setValue(fKey, !markOccurences);
} catch (Exception x) {
+ //ignore
}
}
@@ -149,19 +152,16 @@
fPreferenceStore.addPropertyChangeListener(this);
}
} catch (Exception x) {
+ //ignore
}
boolean markOccurences = false;
boolean enabled = false;
- try {
-
- // determine if action should be enabled or not
- if(fPreferenceStore!=null) {
- markOccurences = fPreferenceStore.getBoolean(fKey);
- }
- enabled = (getTextEditor() != null);
- } catch (Exception x) {
+ // determine if action should be enabled or not
+ if(fPreferenceStore != null) {
+ markOccurences = fPreferenceStore.getBoolean(fKey);
}
+ enabled = (getTextEditor() != null);
setChecked(markOccurences);
setEnabled(enabled);
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/jst/jsp/text/xpl/DefaultStructuredTextOccurrenceStructureProvider.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/jst/jsp/text/xpl/DefaultStructuredTextOccurrenceStructureProvider.java 2007-09-13 13:55:43 UTC (rev 3608)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/jst/jsp/text/xpl/DefaultStructuredTextOccurrenceStructureProvider.java 2007-09-13 14:06:29 UTC (rev 3609)
@@ -415,6 +415,7 @@
fEditorID));
} catch (Exception x) {
+ XmlEditorPlugin.getPluginLog().logError(x);
}
}
@@ -595,10 +596,12 @@
if (fMarkNodeOccurrences) {
NodeList children = (NodeContainer)dom.getChildNodes();
for (int i = 0; children != null && i < children.getLength(); i++) {
+ if(!(children.item(i) instanceof IDOMNode)) continue;
try {
IDOMNode xmlNode = (IDOMNode)children.item(i);
addTagOccurencies(matches, xmlNode, tagName);
} catch (Exception x) {
+ XmlEditorPlugin.getPluginLog().logError(x);
}
}
}
@@ -626,10 +629,12 @@
if (fMarkAttributeOccurrences) {
NodeList children = (NodeContainer)dom.getChildNodes();
for (int i = 0; children != null && i < children.getLength(); i++) {
+ if(!(children.item(i) instanceof IDOMNode)) continue;
try {
IDOMNode xmlNode = (IDOMNode)children.item(i);
addTagAttrNameOccurencies(matches, xmlNode, attrName);
} catch (Exception x) {
+ XmlEditorPlugin.getPluginLog().logError(x);
}
}
}
@@ -661,11 +666,12 @@
if (fMarkAttributeValueOccurrences) {
NodeList children = (NodeContainer)dom.getChildNodes();
for (int i = 0; children != null && i < children.getLength(); i++) {
+ if(!(children.item(i) instanceof IDOMNode)) continue;
try {
IDOMNode xmlNode = (IDOMNode)children.item(i);
addTagAttrValueOccurencies(matches, xmlNode, attrValue);
} catch (Exception x) {
-
+ XmlEditorPlugin.getPluginLog().logError(x);
}
}
}
@@ -698,10 +704,12 @@
if (fMarkTextOccurrences && !isEmptyString (data)) {
NodeList children = (NodeContainer)dom.getChildNodes();
for (int i = 0; children != null && i < children.getLength(); i++) {
+ if(!(children.item(i) instanceof IDOMNode)) continue;
try {
IDOMNode xmlNode = (IDOMNode)children.item(i);
addTextOccurencies(matches, xmlNode, data);
} catch (Exception x) {
+ XmlEditorPlugin.getPluginLog().logError(x);
}
}
}
17 years, 4 months