diff options
Diffstat (limited to 'web/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/properties/JSPedCSSPropertySource.java')
-rw-r--r-- | web/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/properties/JSPedCSSPropertySource.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/web/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/properties/JSPedCSSPropertySource.java b/web/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/properties/JSPedCSSPropertySource.java new file mode 100644 index 0000000000..09c7828b9b --- /dev/null +++ b/web/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/properties/JSPedCSSPropertySource.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2006 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are 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: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jst.jsp.css.ui.internal.properties; + +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jst.jsp.ui.internal.JSPUIMessages; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode; +import org.eclipse.wst.css.ui.internal.properties.CSSPropertySource; + + + +public class JSPedCSSPropertySource extends CSSPropertySource { + + public JSPedCSSPropertySource(ICSSNode target) { + super(target); + } + + public void setPropertyValue(Object name, Object value) { + // workaround to avoid DOMException: if value contains jsp element, nothing happen. + String v = value.toString(); + if (v.indexOf("${") != -1 || v.indexOf("<%=") != -1){ + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + String title = JSPUIMessages.Title_InvalidValue; //$NON-NLS-1$ + String message = JSPUIMessages.Message_InvalidValue; //$NON-NLS-1$ + MessageDialog.openWarning(window.getShell(), title, message); + return; + } + super.setPropertyValue(name, value); + } +} |