Author: dmaliarevich
Date: 2009-08-21 08:06:55 -0400 (Fri, 21 Aug 2009)
New Revision: 17215
Removed:
trunk/common/plugins/org.jboss.tools.common.resref.ui/src/org/jboss/tools/common/resref/ui/BaseAddReferenceSupport.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeAddReferenceSupport.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeCSSFileValidator.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeCSSReferenceSupport.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeELReferenceSupport.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeElVariableValidator.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibReferenceSupport.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibValidator.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ReferenceWizard.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ReferenceWizardDialog.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4547, old classes of the VpeResourcesDialog were
removed, plugin.xml was corrected, "Help" button was removed.
Deleted:
trunk/common/plugins/org.jboss.tools.common.resref.ui/src/org/jboss/tools/common/resref/ui/BaseAddReferenceSupport.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.resref.ui/src/org/jboss/tools/common/resref/ui/BaseAddReferenceSupport.java 2009-08-21
12:04:33 UTC (rev 17214)
+++
trunk/common/plugins/org.jboss.tools.common.resref.ui/src/org/jboss/tools/common/resref/ui/BaseAddReferenceSupport.java 2009-08-21
12:06:55 UTC (rev 17215)
@@ -1,123 +0,0 @@
-package org.jboss.tools.common.resref.ui;
-
-import java.util.Properties;
-
-import org.eclipse.core.resources.IFile;
-import org.jboss.tools.common.meta.action.XActionInvoker;
-import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
-import org.jboss.tools.common.meta.constraint.XAttributeConstraintL;
-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.options.PreferenceModelUtilities;
-import org.jboss.tools.common.resref.core.ResourceReference;
-
-public abstract class BaseAddReferenceSupport extends SpecialWizardSupport {
-
- public static boolean add(IFile file, ResourceReference css, ResourceReference[] list,
String entity) {
- return run(file, css, list, "CreateActions.AddItem", entity); //$NON-NLS-1$
- }
-
- public static boolean edit(IFile file, ResourceReference css, ResourceReference[] list,
- String entity) {
- return run(file, css, list, "EditActions.EditItem", entity); //$NON-NLS-1$
- }
-
- private static boolean run(IFile file, ResourceReference css, ResourceReference[] list,
- String action, String entity) {
- XModel model = PreferenceModelUtilities.getPreferenceModel();
- XModelObject object = model.createModelObject(entity, null);
- object.setAttributeValue("location", css.getLocation()); //$NON-NLS-1$
- if(object.getAttributeValue("prefix") != null) { //$NON-NLS-1$
- object.setAttributeValue("prefix", css.getProperties()); //$NON-NLS-1$
- }
- Properties p = new Properties();
- p.put("resourceReference", css); //$NON-NLS-1$
- p.put("scope",Integer.valueOf(css.getScope())); //$NON-NLS-1$
- p.put("list", list); //$NON-NLS-1$
- if(file != null) p.put("file", file); //$NON-NLS-1$
- XActionInvoker.invoke(action, object, p);
- boolean ok = "true".equals(p.getProperty("okPressed"));
//$NON-NLS-1$ //$NON-NLS-2$
- if(ok) {
- css.setLocation(object.getAttributeValue("location")); //$NON-NLS-1$
- Integer scope = (Integer)p.get("scope"); //$NON-NLS-1$
-
- css.setScope(scope.intValue());
- if(css.isGlobal()){
- css.setScope(ResourceReference.GLOBAL_SCOPE);
- }
- String properties = object.getAttributeValue("prefix"); //$NON-NLS-1$
- if(properties != null) css.setProperties(properties);
- }
- return ok;
- }
-
- protected IFile file = null;
- String initialLocation;
- String initialPrefix;
- ResourceReference[] list;
- String[] scopeNames;
-
- public BaseAddReferenceSupport() {
- super();
- }
-
- protected void reset() {
- initialLocation = getTarget().getAttributeValue("location"); //$NON-NLS-1$
- setAttributeValue(0, "location", initialLocation); //$NON-NLS-1$
- initialPrefix = getTarget().getAttributeValue("prefix"); //$NON-NLS-1$
- if(initialPrefix != null) {
- setAttributeValue(0, "prefix", initialPrefix); //$NON-NLS-1$
- }
- if(getTarget().getModelEntity().getAttribute("scope") != null) {
//$NON-NLS-1$
- final XAttributeConstraintL scopeAttribute = ((XAttributeConstraintL)
getTarget().getModelEntity().getAttribute("scope") //$NON-NLS-1$
- .getConstraint());
- if (scopeAttribute != null) {
- scopeNames = scopeAttribute.getValues();
- }
- } else {
- //just in case. should not happen
- scopeNames = ResourceReference.SCOPE_NAMES;
- }
- int scopeIndex = ((Integer)getProperties().get("scope")).intValue();
//$NON-NLS-1$
-
- if(scopeIndex == 1 && scopeNames.length == 1){
- scopeIndex = 0;
- }else if(scopeIndex > scopeNames.length){
- scopeIndex = scopeNames.length -1;
- }
- String scope = scopeNames[scopeIndex];
- setAttributeValue(0, "scope", scope); //$NON-NLS-1$
- list = (ResourceReference[])getProperties().get("list"); //$NON-NLS-1$
- file = (IFile)getProperties().get("file"); //$NON-NLS-1$
- }
-
- public void action(String name) throws XModelException {
- if(OK.equals(name) || FINISH.equals(name)) {
- execute();
- setFinished(true);
- getProperties().setProperty("okPressed", "true"); //$NON-NLS-1$
//$NON-NLS-2$
- } else if(CANCEL.equals(name)) {
- setFinished(true);
- }
- }
-
- protected void execute() throws XModelException {
- Properties p0 = extractStepData(0);
- getTarget().setAttributeValue("location",
p0.getProperty("location")); //$NON-NLS-1$ //$NON-NLS-2$
- if(p0.containsKey("prefix")) { //$NON-NLS-1$
- getTarget().setAttributeValue("prefix", p0.getProperty("prefix"));
//$NON-NLS-1$ //$NON-NLS-2$
- }
- int scope = getSelectedScope(p0);
- getProperties().put("scope", Integer.valueOf(scope)); //$NON-NLS-1$
- }
-
- public int getSelectedScope(Properties p0) {
- String scopeName = p0.getProperty("scope"); //$NON-NLS-1$
- for (int i = 0; i < scopeNames.length; i++) {
- if(scopeNames[i].equals(scopeName)) return i;
- }
- return 0;
- }
-
-}
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml 2009-08-21 12:04:33 UTC (rev
17214)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml 2009-08-21 12:06:55 UTC (rev
17215)
@@ -1,14 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
- <extension point="org.jboss.tools.common.model.classes">
- <xclass id="org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
- class="org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"/>
- <xclass id="org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
- class="org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"/>
- <xclass id="org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
- class="org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"/>
- <xclass id="org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"
- class="org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"/>
- </extension>
+
</plugin>
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ReferenceWizard.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ReferenceWizard.java 2009-08-21
12:04:33 UTC (rev 17214)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ReferenceWizard.java 2009-08-21
12:06:55 UTC (rev 17215)
@@ -28,8 +28,9 @@
public ReferenceWizard(Object fileLocation, String windowTitle) {
super();
this.fileLocation = fileLocation;
+ setWindowTitle(windowTitle);
+ setHelpAvailable(false);
createPage();
- setWindowTitle(windowTitle);
}
public void createPageControls(Composite pageContainer, Object fileLocation) {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ReferenceWizardDialog.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ReferenceWizardDialog.java 2009-08-21
12:04:33 UTC (rev 17214)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ReferenceWizardDialog.java 2009-08-21
12:06:55 UTC (rev 17215)
@@ -22,21 +22,19 @@
public ReferenceWizardDialog(Shell parentShell, ReferenceWizard newWizard,
ResourceReference resref) {
super(parentShell, newWizard);
this.resref = resref;
+ setHelpAvailable(false);
}
-
- @Override
- protected void constrainShellSize() {
- super.constrainShellSize();
- }
@Override
public int open() {
/*
- * Get Resouce Reference dialog.
+ * Get Resource Reference wizard.
*/
ReferenceWizard wizard = (ReferenceWizard) getWizard();
+
/*
- * Read values from resref when editing.
+ * Read values from resref when editing
+ * and send it to the wizard.
*/
wizard.setResref(resref);
@@ -44,12 +42,15 @@
* Open the dialog
*/
int returnCode = super.open();
+
/*
- * If Finish pressed - store new values in the resref.
+ * If Finish pressed - store new values in the resref
+ * and than it'll be saved in the appropriate ResourceReferenceComposite
*/
if (Dialog.OK == returnCode) {
resref = wizard.getResref();
}
+
return returnCode;
}
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeAddReferenceSupport.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeAddReferenceSupport.java 2009-08-21
12:04:33 UTC (rev 17214)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeAddReferenceSupport.java 2009-08-21
12:06:55 UTC (rev 17215)
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.resref.core;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.jboss.tools.common.model.XModel;
-import org.jboss.tools.common.model.project.IModelNature;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.resref.ui.BaseAddReferenceSupport;
-import org.jboss.tools.jst.web.project.WebProject;
-import org.jboss.tools.jst.web.tld.TaglibMapping;
-
-public class VpeAddReferenceSupport extends BaseAddReferenceSupport {
-
- void setURIList() {
- if(file == null) return;
- if(getEntityData()[0].getModelEntity().getName().startsWith("VPETLD")) {
//$NON-NLS-1$
- Set set = new TreeSet();
- IModelNature n = EclipseResourceUtil.getModelNature(file.getProject());
- if(n == null) return;
- XModel model = n.getModel();
- TaglibMapping taglibs = WebProject.getInstance(model).getTaglibMapping();
- Map map = taglibs.getTaglibObjects();
- Iterator it = map.keySet().iterator();
- while(it.hasNext()) {
- String s = it.next().toString();
- set.add(taglibs.resolveURI(s));
- }
- String[] uris = (String[])set.toArray(new String[0]);
- setValueList(0, "location", uris); //$NON-NLS-1$
- }
- }
-
-}
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeCSSFileValidator.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeCSSFileValidator.java 2009-08-21
12:04:33 UTC (rev 17214)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeCSSFileValidator.java 2009-08-21
12:06:55 UTC (rev 17215)
@@ -1,53 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007 Red Hat, Inc.
-* Distributed under license by Red Hat, Inc. All rights reserved.
-* This program is made available under the terms of the
-* Eclipse Public License v1.0 which accompanies this distribution,
-* and is available at
http://www.eclipse.org/legal/epl-v10.html
-*
-* Contributors:
-* Red Hat, Inc. - initial API and implementation
-******************************************************************************/
-package org.jboss.tools.vpe.resref.core;
-
-import java.io.File;
-import java.util.Properties;
-
-import org.eclipse.osgi.util.NLS;
-import org.jboss.tools.common.meta.action.impl.DefaultWizardDataValidator;
-import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
-import org.jboss.tools.jst.web.messages.xpl.WebUIMessages;
-
-/**
- * @author mareshkau
- *
- */
-public class VpeCSSFileValidator extends DefaultWizardDataValidator {
-
- /**
- *
- * @param support
- * @param step
- */
- public VpeCSSFileValidator(SpecialWizardSupport support, int step) {
- super.setSupport(support, step);
- }
- /* (non-Javadoc)
- * @see
org.jboss.tools.common.meta.action.impl.DefaultWizardDataValidator#validate(java.util.Properties)
- */
- @Override
- public void validate(Properties data) {
-
- super.validate(data);
-
- if( (getErrorMessage()!=null) ||
- (getWarningMessage()!=null)) {
- return;
- }
- String location = (String) data.get("location"); //$NON-NLS-1$
- if(!new File(location).isFile()) {
- message = NLS.bind(WebUIMessages.FILE_DOESNOT_EXIST,location);
- }
-
- }
-}
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeCSSReferenceSupport.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeCSSReferenceSupport.java 2009-08-21
12:04:33 UTC (rev 17214)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeCSSReferenceSupport.java 2009-08-21
12:06:55 UTC (rev 17215)
@@ -1,34 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007 Red Hat, Inc.
-* Distributed under license by Red Hat, Inc. All rights reserved.
-* This program is made available under the terms of the
-* Eclipse Public License v1.0 which accompanies this distribution,
-* and is available at
http://www.eclipse.org/legal/epl-v10.html
-*
-* Contributors:
-* Red Hat, Inc. - initial API and implementation
-******************************************************************************/
-package org.jboss.tools.vpe.resref.core;
-
-import org.jboss.tools.common.meta.action.impl.WizardDataValidator;
-
-/**
- * @author mareshkau
- *
- */
-public class VpeCSSReferenceSupport extends VpeAddReferenceSupport{
-
- private WizardDataValidator wizardDataValidator;
- /* (non-Javadoc)
- * @see org.jboss.tools.common.meta.action.impl.SpecialWizardSupport#getValidator(int)
- */
- @Override
- public WizardDataValidator getValidator(int step) {
- if(this.wizardDataValidator==null) {
-
- this.wizardDataValidator = new VpeCSSFileValidator(this, step);
- }
- return this.wizardDataValidator;
- }
-
-}
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeELReferenceSupport.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeELReferenceSupport.java 2009-08-21
12:04:33 UTC (rev 17214)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeELReferenceSupport.java 2009-08-21
12:06:55 UTC (rev 17215)
@@ -1,31 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007-2008 Red Hat, Inc.
-* Distributed under license by Red Hat, Inc. All rights reserved.
-* This program is made available under the terms of the
-* Eclipse Public License v1.0 which accompanies this distribution,
-* and is available at
http://www.eclipse.org/legal/epl-v10.html
-*
-* Contributor:
-* Red Hat, Inc. - initial API and implementation
-******************************************************************************/
-package org.jboss.tools.vpe.resref.core;
-
-import org.jboss.tools.common.meta.action.impl.WizardDataValidator;
-import org.jboss.tools.common.resref.core.ResourceReference;
-
-/**
- * @author mareshkau
- *
- */
-public class VpeELReferenceSupport extends VpeAddReferenceSupport {
- /* (non-Javadoc)
- * @see org.jboss.tools.common.meta.action.impl.SpecialWizardSupport#getValidator(int)
- */
- @Override
- public WizardDataValidator getValidator(int step) {
- ResourceReference[] currentReferenceList =
(ResourceReference[])p.get("list"); //$NON-NLS-1$
- ResourceReference editingReference =
(ResourceReference)p.get("resourceReference"); //$NON-NLS-1$
- return new VpeElVariableValidator(this, getStepId(), currentReferenceList,
editingReference);
- }
-
-}
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeElVariableValidator.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeElVariableValidator.java 2009-08-21
12:04:33 UTC (rev 17214)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeElVariableValidator.java 2009-08-21
12:06:55 UTC (rev 17215)
@@ -1,82 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007-2008 Red Hat, Inc.
-* Distributed under license by Red Hat, Inc. All rights reserved.
-* This program is made available under the terms of the
-* Eclipse Public License v1.0 which accompanies this distribution,
-* and is available at
http://www.eclipse.org/legal/epl-v10.html
-*
-* Contributor:
-* Red Hat, Inc. - initial API and implementation
-******************************************************************************/
-package org.jboss.tools.vpe.resref.core;
-
-import java.util.Properties;
-
-import org.jboss.tools.common.el.core.model.ELModel;
-import org.jboss.tools.common.el.core.parser.ELParser;
-import org.jboss.tools.common.el.core.parser.ELParserUtil;
-import org.jboss.tools.common.meta.action.impl.DefaultWizardDataValidator;
-import org.jboss.tools.common.resref.core.ResourceReference;
-import org.jboss.tools.common.resref.ui.BaseAddReferenceSupport;
-
-/**
- * @author mareshkau
- *
- */
-public class VpeElVariableValidator extends DefaultWizardDataValidator {
- private ResourceReference[] currentReferenceList;
- private ResourceReference editingReference;
-
- /**
- *
- * @param support
- * @param step
- * @param resourceReferences
- * @param editingReference
- */
- public VpeElVariableValidator(BaseAddReferenceSupport support, int step,
ResourceReference[] currentReferenceList, ResourceReference editingReference) {
- super.setSupport(support, step);
- this.currentReferenceList = currentReferenceList;
- this.editingReference = editingReference;
- }
-
- /* (non-Javadoc)
- * @see
org.jboss.tools.common.meta.action.impl.DefaultWizardDataValidator#validate(java.util.Properties)
- */
- @Override
- public void validate(Properties data) {
-
- super.validate(data);
- if( (getErrorMessage()!=null) ||
- (getWarningMessage()!=null)) {
- return;
- }
- String location = (String) data.get("location"); //$NON-NLS-1$
- ELParser elParser = ELParserUtil.getDefaultFactory().createParser();
- ELModel model = elParser.parse("#{"+location+'}'); //$NON-NLS-1$
- if(model == null || model.getSyntaxErrors().size()>0) {
- message = Messages.INVALID_EL_EXPRESSION;
- } else {
- // yradtsevich: JBIDE-3576: EL expression overriding
- // check if there is no another EL reference in the same scope with the same name
-
- int selectedScope = ((BaseAddReferenceSupport)support).getSelectedScope(data);
-
- /* XXX yradtsevich: BaseAddReferenceSupport.getSelectedScope(...) returns an
- * incorrect scope if the scope is global. So we need to fix it. */
- if (editingReference.isGlobal()) {
- selectedScope = ResourceReference.GLOBAL_SCOPE;
- }
-
- for (ResourceReference listItemReference : currentReferenceList) {
- if (editingReference != listItemReference
- && listItemReference.getScope() == selectedScope
- && location.equals(listItemReference.getLocation())) {
- message = Messages.EL_EXPRESSION_ALREADY_EXISTS;
- break;
- }
- }
- }
- }
-
-}
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibReferenceSupport.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibReferenceSupport.java 2009-08-21
12:04:33 UTC (rev 17214)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibReferenceSupport.java 2009-08-21
12:06:55 UTC (rev 17215)
@@ -1,36 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007 Red Hat, Inc.
-* Distributed under license by Red Hat, Inc. All rights reserved.
-* This program is made available under the terms of the
-* Eclipse Public License v1.0 which accompanies this distribution,
-* and is available at
http://www.eclipse.org/legal/epl-v10.html
-*
-* Contributors:
-* Red Hat, Inc. - initial API and implementation
-******************************************************************************/
-package org.jboss.tools.vpe.resref.core;
-
-import org.jboss.tools.common.meta.action.impl.WizardDataValidator;
-
-/**
- * @author mareshkau
- *
- */
-public class VpeTaglibReferenceSupport extends VpeAddReferenceSupport {
-
- private WizardDataValidator wizardDataValidator;
-
- /* (non-Javadoc)
- * @see org.jboss.tools.common.meta.action.impl.SpecialWizardSupport#getValidator(int)
- */
- @Override
- public WizardDataValidator getValidator(int step) {
-
- if(this.wizardDataValidator == null) {
-
- wizardDataValidator = new VpeTaglibValidator(this, step);
- }
-
- return this.wizardDataValidator;
- }
-}
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibValidator.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibValidator.java 2009-08-21
12:04:33 UTC (rev 17214)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibValidator.java 2009-08-21
12:06:55 UTC (rev 17215)
@@ -1,61 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007 Red Hat, Inc.
-* Distributed under license by Red Hat, Inc. All rights reserved.
-* This program is made available under the terms of the
-* Eclipse Public License v1.0 which accompanies this distribution,
-* and is available at
http://www.eclipse.org/legal/epl-v10.html
-*
-* Contributors:
-* Red Hat, Inc. - initial API and implementation
-******************************************************************************/
-package org.jboss.tools.vpe.resref.core;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Properties;
-
-import org.eclipse.osgi.util.NLS;
-import org.jboss.tools.common.meta.action.impl.DefaultWizardDataValidator;
-import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
-import org.jboss.tools.jst.web.messages.xpl.WebUIMessages;
-
-/**
- * @author mareshkau
- *
- */
-public class VpeTaglibValidator extends DefaultWizardDataValidator {
-
- /**
- *
- * @param support
- * @param step
- */
- public VpeTaglibValidator(SpecialWizardSupport support, int step) {
- super.setSupport(support, step);
- }
- /* (non-Javadoc)
- * @see
org.jboss.tools.common.meta.action.impl.DefaultWizardDataValidator#validate(java.util.Properties)
- */
- @Override
- public void validate(Properties data) {
- super.validate(data);
- if( (getErrorMessage()!=null) ||
- (getWarningMessage()!=null)) {
- return;
- }
- String uriStr = (String) data.get("location"); //$NON-NLS-1$
- String prefix = (String) data.get("prefix");//$NON-NLS-1$
- String nameStrt = "[A-Za-z_]|[^\\x00-\\x7F]"; //$NON-NLS-1$
- String nameChar = "[A-Za-z0-9_.-]|[^\\x00-\\x7F]"; //$NON-NLS-1$
- String name = '(' + nameStrt + ')'+'(' + nameChar +
")*"; //$NON-NLS-1$
-
- try {
- new URI(uriStr);
- }catch (URISyntaxException ex) {
- message = NLS.bind(WebUIMessages.INCORRECT_URI,uriStr);
- }
- if((prefix!=null)&&(!prefix.matches(name))){
- message = NLS.bind(WebUIMessages.INCORRECT_PREFIX,prefix);
- }
- }
-}