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.tasklist.todo;
042:
043: import java.awt.Frame;
044: import java.awt.Image;
045: import java.beans.PropertyChangeListener;
046: import java.util.Set;
047: import javax.swing.Action;
048: import org.openide.nodes.Node;
049: import org.openide.windows.Mode;
050: import org.openide.windows.TopComponent;
051: import org.openide.windows.TopComponentGroup;
052: import org.openide.windows.WindowManager;
053: import org.openide.windows.Workspace;
054:
055: /**
056: *
057: * @author pzajac
058: */
059: public class WindowManagerMock extends WindowManager {
060:
061: TopComponent otc;
062:
063: public WindowManagerMock() {
064: }
065:
066: public void setOpenedEditorTopComponent(TopComponent tc) {
067: otc = tc;
068: }
069:
070: @Override
071: public boolean isEditorTopComponent(TopComponent tc) {
072: return true;
073: }
074:
075: @Override
076: public boolean isOpenedEditorTopComponent(TopComponent tc) {
077: return (tc != null && tc == otc);
078: }
079:
080: public Mode findMode(String name) {
081: throw new UnsupportedOperationException("Not supported yet.");
082: }
083:
084: public Mode findMode(TopComponent tc) {
085: throw new UnsupportedOperationException("Not supported yet.");
086: }
087:
088: public Set<? extends Mode> getModes() {
089: throw new UnsupportedOperationException("Not supported yet.");
090: }
091:
092: public Frame getMainWindow() {
093: throw new UnsupportedOperationException("Not supported yet.");
094: }
095:
096: public void updateUI() {
097: throw new UnsupportedOperationException("Not supported yet.");
098: }
099:
100: protected Component createTopComponentManager(TopComponent c) {
101: throw new UnsupportedOperationException("Not supported yet.");
102: }
103:
104: public Workspace createWorkspace(String name, String displayName) {
105: throw new UnsupportedOperationException("Not supported yet.");
106: }
107:
108: public Workspace findWorkspace(String name) {
109: throw new UnsupportedOperationException("Not supported yet.");
110: }
111:
112: public Workspace[] getWorkspaces() {
113: throw new UnsupportedOperationException("Not supported yet.");
114: }
115:
116: public void setWorkspaces(Workspace[] workspaces) {
117: throw new UnsupportedOperationException("Not supported yet.");
118: }
119:
120: public Workspace getCurrentWorkspace() {
121: throw new UnsupportedOperationException("Not supported yet.");
122: }
123:
124: public TopComponentGroup findTopComponentGroup(String name) {
125: throw new UnsupportedOperationException("Not supported yet.");
126: }
127:
128: public void addPropertyChangeListener(PropertyChangeListener l) {
129: throw new UnsupportedOperationException("Not supported yet.");
130: }
131:
132: public void removePropertyChangeListener(PropertyChangeListener l) {
133: throw new UnsupportedOperationException("Not supported yet.");
134: }
135:
136: protected void topComponentOpen(TopComponent tc) {
137: throw new UnsupportedOperationException("Not supported yet.");
138: }
139:
140: protected void topComponentOpenAtTabPosition(TopComponent tc,
141: int position) {
142: throw new UnsupportedOperationException("Not supported yet.");
143: }
144:
145: protected int topComponentGetTabPosition(TopComponent tc) {
146: throw new UnsupportedOperationException("Not supported yet.");
147: }
148:
149: protected void topComponentClose(TopComponent tc) {
150: throw new UnsupportedOperationException("Not supported yet.");
151: }
152:
153: protected void topComponentRequestActive(TopComponent tc) {
154: throw new UnsupportedOperationException("Not supported yet.");
155: }
156:
157: protected void topComponentRequestVisible(TopComponent tc) {
158: throw new UnsupportedOperationException("Not supported yet.");
159: }
160:
161: protected void topComponentDisplayNameChanged(TopComponent tc,
162: String displayName) {
163: throw new UnsupportedOperationException("Not supported yet.");
164: }
165:
166: protected void topComponentHtmlDisplayNameChanged(TopComponent tc,
167: String htmlDisplayName) {
168: throw new UnsupportedOperationException("Not supported yet.");
169: }
170:
171: protected void topComponentToolTipChanged(TopComponent tc,
172: String toolTip) {
173: throw new UnsupportedOperationException("Not supported yet.");
174: }
175:
176: protected void topComponentIconChanged(TopComponent tc, Image icon) {
177: throw new UnsupportedOperationException("Not supported yet.");
178: }
179:
180: protected void topComponentActivatedNodesChanged(TopComponent tc,
181: Node[] activatedNodes) {
182: // throw new UnsupportedOperationException("Not supported yet.");
183: }
184:
185: protected boolean topComponentIsOpened(TopComponent tc) {
186: return false;
187: // throw new UnsupportedOperationException("Not supported yet.");
188: }
189:
190: protected Action[] topComponentDefaultActions(TopComponent tc) {
191:
192: throw new UnsupportedOperationException("Not supported yet.");
193: }
194:
195: protected String topComponentID(TopComponent tc, String preferredID) {
196: throw new UnsupportedOperationException("Not supported yet.");
197: }
198:
199: public TopComponent findTopComponent(String tcID) {
200: throw new UnsupportedOperationException("Not supported yet.");
201: }
202:
203: }
|