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.ui.content;
18 import com.intellij.openapi.Disposable;
19 import com.intellij.openapi.actionSystem.ActionGroup;
20 import com.intellij.openapi.ui.ComponentContainer;
21 import com.intellij.openapi.util.Computable;
22 import com.intellij.openapi.util.UserDataHolder;
23 import org.jetbrains.annotations.NonNls;
24 import org.jetbrains.annotations.Nullable;
27 import java.beans.PropertyChangeListener;
29 public interface Content extends UserDataHolder, ComponentContainer {
31 String PROP_DISPLAY_NAME = "displayName";
33 String PROP_ICON = "icon";
34 String PROP_ACTIONS = "actions";
35 @NonNls String PROP_DESCRIPTION = "description";
37 String PROP_COMPONENT = "component";
39 String PROP_ALERT = "alerting";
41 void setComponent(JComponent component);
43 void setPreferredFocusableComponent(JComponent component);
45 void setPreferredFocusedComponent(Computable<JComponent> computable);
47 void setIcon(Icon icon);
51 void setDisplayName(String displayName);
53 String getDisplayName();
55 void setTabName(String tabName);
59 void setToolwindowTitle(String toolwindowTitle);
61 String getToolwindowTitle();
63 Disposable getDisposer();
66 * @param disposer a Disposable object whoes dispose() method will be invoked upon this content release.
68 void setDisposer(Disposable disposer);
70 String getDescription();
72 void setDescription(String description);
74 void addPropertyChangeListener(PropertyChangeListener l);
76 void removePropertyChangeListener(PropertyChangeListener l);
78 ContentManager getManager();
87 void setPinned(boolean locked);
90 boolean isCloseable();
91 void setCloseable(boolean closeable);
93 void setActions(ActionGroup actions, String place, @Nullable JComponent contextComponent);
94 void setSearchComponent(@Nullable JComponent comp);
96 ActionGroup getActions();
97 @Nullable JComponent getSearchComponent();
99 JComponent getActionsContextComponent();
101 void setAlertIcon(@Nullable AlertIcon icon);
102 @Nullable AlertIcon getAlertIcon();