ComponentWithBrowseButton - optional remove listener on hide
[fedora-idea.git] / platform / platform-impl / src / com / intellij / openapi / wm / impl / TestWindowManager.java
blobe2966ec8ee01aace74477dee839fa793e595788c
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.intellij.openapi.wm.impl;
18 import com.intellij.openapi.components.ApplicationComponent;
19 import com.intellij.openapi.progress.TaskInfo;
20 import com.intellij.openapi.project.Project;
21 import com.intellij.openapi.wm.IdeFrame;
22 import com.intellij.openapi.wm.StatusBar;
23 import com.intellij.openapi.wm.WindowManagerListener;
24 import com.intellij.openapi.wm.impl.status.StatusBarPatch;
25 import com.intellij.openapi.wm.ex.ProgressIndicatorEx;
26 import com.intellij.openapi.wm.ex.StatusBarEx;
27 import com.intellij.openapi.wm.ex.WindowManagerEx;
28 import com.intellij.openapi.editor.Editor;
29 import com.intellij.openapi.ui.MessageType;
30 import com.intellij.openapi.ui.popup.BalloonHandler;
31 import com.intellij.notification.impl.IdeNotificationArea;
32 import org.jetbrains.annotations.NotNull;
33 import org.jetbrains.annotations.Nullable;
35 import javax.swing.*;
36 import javax.swing.event.HyperlinkListener;
37 import java.awt.*;
38 import java.awt.event.ComponentEvent;
40 /**
41 * @author Anton Katilin
42 * @author Vladimir Kondratyev
44 public final class TestWindowManager extends WindowManagerEx implements ApplicationComponent{
45 private static final StatusBar ourStatusBar = new DummyStatusBar();
47 public final void doNotSuggestAsParent(final Window window) {
50 public final Window suggestParentWindow(final Project project) {
51 return null;
54 public final StatusBar getStatusBar(final Project project) {
55 return ourStatusBar;
58 public IdeFrame getIdeFrame(final Project project) {
59 return null;
62 @Override
63 public Rectangle getScreenBounds(@NotNull Project project) {
64 return null;
67 public void setWindowMask(final Window window, final Shape mask) {
70 public void resetWindow(final Window window) {
73 private static final class DummyStatusBar implements StatusBarEx {
74 public final void setInfo(final String s) {}
76 public void addFileStatusComponent(final StatusBarPatch component) {
80 public void removeFileStatusComponent(final StatusBarPatch component) {
84 public void fireNotificationPopup(@NotNull JComponent content, final Color backgroundColor) {
87 public IdeNotificationArea getNotificationArea() {
88 return null;
91 public final String getInfo() {
92 return null;
95 public final void clear() {}
97 public void addCustomIndicationComponent(@NotNull JComponent c) {}
99 public void removeCustomIndicationComponent(@NotNull final JComponent c) {
102 public void dispose() {
106 public void cleanupCustomComponents() {
109 public void add(ProgressIndicatorEx indicator, TaskInfo info) {
112 public void startRefreshIndication(final String tooltipText) {
115 public void stopRefreshIndication() {
118 public boolean isProcessWindowOpen() {
119 return false;
122 public void setProcessWindowOpen(final boolean open) {
125 public BalloonHandler notifyProgressByBalloon(@NotNull MessageType type, @NotNull String htmlBody) {
126 return new BalloonHandler() {
127 public void hide() {
132 public BalloonHandler notifyProgressByBalloon(@NotNull MessageType type,
133 @NotNull String htmlBody,
134 @Nullable Icon icon,
135 @Nullable HyperlinkListener listener) {
136 return new BalloonHandler() {
137 public void hide() {
142 public void update(final Editor editor) {
147 public IdeFrameImpl[] getAllFrames() {
148 return new IdeFrameImpl[0];
151 public final IdeFrameImpl getFrame(final Project project) {
152 return null;
155 public final IdeFrameImpl allocateFrame(final Project project) {
156 throw new UnsupportedOperationException();
159 public final void releaseFrame(final IdeFrameImpl frame) {
160 throw new UnsupportedOperationException();
163 public final Component getFocusedComponent(@NotNull final Window window) {
164 throw new UnsupportedOperationException();
167 public final Component getFocusedComponent(final Project project) {
168 throw new UnsupportedOperationException();
171 public final Window getMostRecentFocusedWindow() {
172 return null;
175 public IdeFrame findFrameFor(@Nullable Project project) {
176 throw new UnsupportedOperationException();
179 public final CommandProcessor getCommandProcessor() {
180 throw new UnsupportedOperationException();
183 public final DesktopLayout getLayout() {
184 throw new UnsupportedOperationException();
187 public final void setLayout(final DesktopLayout layout) {
188 throw new UnsupportedOperationException();
191 public final void dispatchComponentEvent(final ComponentEvent e) {
192 throw new UnsupportedOperationException();
195 public final Rectangle getScreenBounds() {
196 throw new UnsupportedOperationException();
199 public final boolean isInsideScreenBounds(final int x, final int y, final int width) {
200 throw new UnsupportedOperationException();
203 public final boolean isInsideScreenBounds(final int x, final int y) {
204 throw new UnsupportedOperationException();
207 public final boolean isAlphaModeSupported() {
208 return false;
211 public final void setAlphaModeRatio(final Window window, final float ratio) {
212 throw new UnsupportedOperationException();
215 public final boolean isAlphaModeEnabled(final Window window) {
216 throw new UnsupportedOperationException();
219 public final void setAlphaModeEnabled(final Window window, final boolean state) {
220 throw new UnsupportedOperationException();
223 public void hideDialog(JDialog dialog, Project project) {
224 dialog.dispose();
227 public final String getComponentName() {
228 return "TestWindowManager";
231 public final void initComponent() { }
233 public final void disposeComponent() {
236 public void addListener(final WindowManagerListener listener) {
240 public void removeListener(final WindowManagerListener listener) {