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.
17 package com
.intellij
.execution
.ui
;
19 import com
.intellij
.execution
.ui
.layout
.LayoutStateDefaults
;
20 import com
.intellij
.execution
.ui
.layout
.LayoutViewOptions
;
21 import com
.intellij
.execution
.ui
.layout
.PlaceInGrid
;
22 import com
.intellij
.openapi
.Disposable
;
23 import com
.intellij
.openapi
.project
.Project
;
24 import com
.intellij
.openapi
.ui
.ComponentWithActions
;
25 import com
.intellij
.openapi
.util
.ActionCallback
;
26 import com
.intellij
.ui
.content
.Content
;
27 import com
.intellij
.ui
.content
.ContentManager
;
28 import com
.intellij
.ui
.content
.ContentManagerListener
;
29 import org
.jetbrains
.annotations
.NotNull
;
30 import org
.jetbrains
.annotations
.Nullable
;
34 public interface RunnerLayoutUi
{
37 LayoutStateDefaults
getDefaults();
40 LayoutViewOptions
getOptions();
43 ContentManager
getContentManager();
46 Content
addContent(@NotNull Content content
);
49 Content
addContent(@NotNull Content content
, int defaultTabId
, PlaceInGrid defaultPlace
, boolean defaultIsMinimized
);
52 Content
createContent(@NotNull String contentId
, @NotNull JComponent component
, @NotNull String displayName
, @Nullable Icon icon
, @Nullable JComponent toFocus
);
55 Content
createContent(@NotNull String contentId
, @NotNull ComponentWithActions contentWithActions
, @NotNull String displayName
, @Nullable Icon icon
, @Nullable JComponent toFocus
);
57 boolean removeContent(@Nullable Content content
, boolean dispose
);
60 Content
findContent(@NotNull String contentId
);
62 ActionCallback
selectAndFocus(@Nullable Content content
, final boolean forced
);
64 RunnerLayoutUi
addListener(@NotNull ContentManagerListener listener
, @NotNull Disposable parent
);
66 void removeListener(@NotNull final ContentManagerListener listener
);
68 void attractBy(@NotNull String condition
);
69 void clearAttractionBy(final String condition
);
71 void setBouncing(@NotNull Content content
, final boolean activate
);
74 JComponent
getComponent();
78 void updateActionsNow();
80 Content
[] getContents();
83 abstract class Factory
{
87 public static Factory
getInstance(Project project
) {
88 return project
.getComponent(Factory
.class);
91 public abstract RunnerLayoutUi
create(@NotNull String runnerType
, @NotNull String runnerTitle
, @NotNull String sessionName
, @NotNull Disposable parent
);