01: /* uDig - User Friendly Desktop Internet GIS client
02: * http://udig.refractions.net
03: * (C) 2004, Refractions Research Inc.
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation;
08: * version 2.1 of the License.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: */
15: package net.refractions.udig.ui.operations;
16:
17: import net.refractions.udig.internal.ui.UiPlugin;
18:
19: import org.eclipse.core.runtime.IConfigurationElement;
20:
21: public class AdaptsToParserImpl implements FilterParser {
22:
23: public OpFilter parse(IConfigurationElement element) {
24: String adaptsTo = element.getAttribute("target"); //$NON-NLS-1$
25: if (adaptsTo.trim().length() == 0) {
26: UiPlugin
27: .log(
28: "AdaptsToParserImpl:Parsing OpFilter: adapts to attribute is empty string" + element.getNamespaceIdentifier(), null); //$NON-NLS-1$
29:
30: return OpFilter.TRUE;
31: }
32: return new AdaptsToFilter(adaptsTo);
33: }
34:
35: public String getElementName() {
36: return "adaptsTo"; //$NON-NLS-1$
37: }
38: }
|