001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041: package org.netbeans.modules.bpel.search.api;
042:
043: /**
044: * @author Vladimir Yaroslavskiy
045: * @version 2007.05.25
046: */
047: public interface SearchOption {
048:
049: /**
050: * Returns text to be found.
051: * @return text to be found
052: */
053: String getText();
054:
055: /**
056: * Returns source where search will be performed.
057: * @return source where search will be performed
058: */
059: Object getSource();
060:
061: /**
062: * Returns target to be found.
063: * @return target to be found
064: */
065: SearchTarget getTarget();
066:
067: /**
068: * Returns search match.
069: * @return search match
070: */
071: SearchMatch getSearchMatch();
072:
073: /**
074: * Returns true if search is case sensitive.
075: * @return true if search is case sensitive
076: */
077: boolean isCaseSensitive();
078:
079: /**
080: * Returns true if search will be performed in selection.
081: * @return true if search will be performed in selection
082: */
083: boolean useSelection();
084:
085: // ------------------------------------------
086: public class Adapter implements SearchOption {
087:
088: public Adapter(String text, Object source, SearchTarget target,
089: SearchMatch match, boolean caseSensitive,
090: boolean useSelection) {
091: myText = text;
092: mySource = source;
093: myTarget = target;
094: mySearchMatch = match;
095: myCaseSensitive = caseSensitive;
096: myUseSelection = useSelection;
097: }
098:
099: public String getText() {
100: return myText;
101: }
102:
103: public Object getSource() {
104: return mySource;
105: }
106:
107: public SearchTarget getTarget() {
108: return myTarget;
109: }
110:
111: public SearchMatch getSearchMatch() {
112: return mySearchMatch;
113: }
114:
115: public boolean isCaseSensitive() {
116: return myCaseSensitive;
117: }
118:
119: public boolean useSelection() {
120: return myUseSelection;
121: }
122:
123: private String myText;
124: private Object mySource;
125: private SearchTarget myTarget;
126: private SearchMatch mySearchMatch;
127: private boolean myCaseSensitive;
128: private boolean myUseSelection;
129: }
130: }
|