diff --git a/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowType.java b/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowType.java index d33dc93e070d..aea21320f433 100644 --- a/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowType.java +++ b/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowType.java @@ -16,5 +16,5 @@ package com.intellij.openapi.wm; public enum ToolWindowType { - DOCKED, FLOATING, SLIDING + DOCKED, FLOATING, SLIDING, WINDOWED } diff --git a/platform/platform-api/src/com/intellij/openapi/wm/WindowInfo.java b/platform/platform-api/src/com/intellij/openapi/wm/WindowInfo.java index 836c15ef66c3..370c789437d6 100644 --- a/platform/platform-api/src/com/intellij/openapi/wm/WindowInfo.java +++ b/platform/platform-api/src/com/intellij/openapi/wm/WindowInfo.java @@ -38,6 +38,8 @@ public interface WindowInfo { boolean isFloating(); + boolean isWindowed(); + boolean isSliding(); ToolWindowContentUiType getContentUiType(); diff --git a/platform/platform-impl/src/com/intellij/designer/LightToolWindow.java b/platform/platform-impl/src/com/intellij/designer/LightToolWindow.java index ce3cb33deb90..c0953e4c06c0 100644 --- a/platform/platform-impl/src/com/intellij/designer/LightToolWindow.java +++ b/platform/platform-impl/src/com/intellij/designer/LightToolWindow.java @@ -16,6 +16,7 @@ package com.intellij.designer; import com.intellij.icons.AllIcons; +import com.intellij.ide.actions.ToggleWindowedModeAction; import com.intellij.ide.util.PropertiesComponent; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.actionSystem.impl.ActionManagerImpl; @@ -69,6 +70,7 @@ public class LightToolWindow extends JPanel { private final TogglePinnedModeAction myToggleAutoHideModeAction = new TogglePinnedModeAction(); private final ToggleDockModeAction myToggleDockModeAction = new ToggleDockModeAction(); private final ToggleFloatingModeAction myToggleFloatingModeAction = new ToggleFloatingModeAction(); + private final ToggleWindowedModeAction myToggleWindowedModeAction = new ToggleWindowedModeAction(); private final ToggleSideModeAction myToggleSideModeAction = new ToggleSideModeAction(); private final ComponentListener myWidthListener = new ComponentAdapter() { @@ -331,15 +333,18 @@ public class LightToolWindow extends JPanel { group.add(myToggleAutoHideModeAction); group.add(myToggleDockModeAction); group.add(myToggleFloatingModeAction); + group.add(myToggleWindowedModeAction); group.add(myToggleSideModeAction); } - else if (type == ToolWindowType.FLOATING) { + else if (type == ToolWindowType.FLOATING || type == ToolWindowType.WINDOWED) { group.add(myToggleAutoHideModeAction); group.add(myToggleFloatingModeAction); + group.add(myToggleWindowedModeAction); } else if (type == ToolWindowType.SLIDING) { group.add(myToggleDockModeAction); group.add(myToggleFloatingModeAction); + group.add(myToggleWindowedModeAction); } return group; diff --git a/platform/platform-impl/src/com/intellij/ide/actions/HideAllToolWindowsAction.java b/platform/platform-impl/src/com/intellij/ide/actions/HideAllToolWindowsAction.java index 99fb583fd864..8e4bd27579ed 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/HideAllToolWindowsAction.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/HideAllToolWindowsAction.java @@ -23,6 +23,7 @@ import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; import com.intellij.openapi.wm.ToolWindow; +import com.intellij.openapi.wm.ToolWindowType; import com.intellij.openapi.wm.ex.ToolWindowManagerEx; import com.intellij.openapi.wm.impl.DesktopLayout; @@ -51,7 +52,7 @@ public class HideAllToolWindowsAction extends AnAction implements DumbAware { boolean hasVisible = false; for (String id : ids) { ToolWindow toolWindow = toolWindowManager.getToolWindow(id); - if (toolWindow.isVisible()) { + if (toolWindow.isVisible() && toolWindow.getType() != ToolWindowType.WINDOWED) { toolWindow.hide(null); hasVisible = true; } @@ -81,7 +82,8 @@ public class HideAllToolWindowsAction extends AnAction implements DumbAware { ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(project); String[] ids = toolWindowManager.getToolWindowIds(); for (String id : ids) { - if (toolWindowManager.getToolWindow(id).isVisible()) { + ToolWindow toolWindow = toolWindowManager.getToolWindow(id); + if (toolWindow.isVisible() && toolWindow.getType() != ToolWindowType.WINDOWED) { presentation.setEnabled(true); presentation.setText(IdeBundle.message("action.hide.all.windows"), true); return; diff --git a/platform/platform-impl/src/com/intellij/ide/actions/ResizeToolWindowAction.java b/platform/platform-impl/src/com/intellij/ide/actions/ResizeToolWindowAction.java index 9f8d104ebdd2..f0b43e3737ae 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/ResizeToolWindowAction.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/ResizeToolWindowAction.java @@ -99,7 +99,7 @@ public abstract class ResizeToolWindowAction extends AnAction implements DumbAwa window = mgr.getToolWindow(mgr.getActiveToolWindowId()); } - if (window == null || !window.isAvailable() || !window.isVisible() || window.getType() == ToolWindowType.FLOATING || !window.isActive()) { + if (window == null || !window.isAvailable() || !window.isVisible() || window.getType() == ToolWindowType.FLOATING || window.getType() == ToolWindowType.WINDOWED || !window.isActive()) { setDisabled(e); return; } diff --git a/platform/platform-impl/src/com/intellij/ide/actions/ToggleDockModeAction.java b/platform/platform-impl/src/com/intellij/ide/actions/ToggleDockModeAction.java index 9c41674642e9..75b646bd3e72 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/ToggleDockModeAction.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/ToggleDockModeAction.java @@ -74,6 +74,8 @@ public class ToggleDockModeAction extends ToggleAction implements DumbAware { return; } ToolWindow toolWindow=mgr.getToolWindow(id); - presentation.setEnabled(toolWindow.isAvailable()&&ToolWindowType.FLOATING!=toolWindow.getType()); + presentation.setEnabled(toolWindow.isAvailable() + && toolWindow.getType() != ToolWindowType.FLOATING + && toolWindow.getType() != ToolWindowType.WINDOWED); } } diff --git a/platform/platform-impl/src/com/intellij/ide/actions/ToggleWindowedModeAction.java b/platform/platform-impl/src/com/intellij/ide/actions/ToggleWindowedModeAction.java new file mode 100644 index 000000000000..6d18de9024f4 --- /dev/null +++ b/platform/platform-impl/src/com/intellij/ide/actions/ToggleWindowedModeAction.java @@ -0,0 +1,76 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.ide.actions; + +import com.intellij.openapi.actionSystem.AnActionEvent; +import com.intellij.openapi.actionSystem.CommonDataKeys; +import com.intellij.openapi.actionSystem.Presentation; +import com.intellij.openapi.actionSystem.ToggleAction; +import com.intellij.openapi.project.DumbAware; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.wm.ToolWindowManager; +import com.intellij.openapi.wm.ToolWindowType; +import com.intellij.openapi.wm.ex.ToolWindowEx; +import com.intellij.openapi.wm.ex.ToolWindowManagerEx; + +public class ToggleWindowedModeAction extends ToggleAction implements DumbAware { + + public boolean isSelected(AnActionEvent event) { + Project project = CommonDataKeys.PROJECT.getData(event.getDataContext()); + if (project == null) { + return false; + } + ToolWindowManager windowManager = ToolWindowManager.getInstance(project); + String id = windowManager.getActiveToolWindowId(); + if (id == null) { + return false; + } + return ToolWindowType.WINDOWED == windowManager.getToolWindow(id).getType(); + } + + public void setSelected(AnActionEvent event, boolean flag) { + Project project = CommonDataKeys.PROJECT.getData(event.getDataContext()); + if (project == null) { + return; + } + String id = ToolWindowManager.getInstance(project).getActiveToolWindowId(); + if (id == null) { + return; + } + ToolWindowManagerEx mgr = ToolWindowManagerEx.getInstanceEx(project); + ToolWindowEx toolWindow = (ToolWindowEx)mgr.getToolWindow(id); + ToolWindowType type = toolWindow.getType(); + if (ToolWindowType.WINDOWED == type) { + toolWindow.setType(toolWindow.getInternalType(), null); + } + else { + toolWindow.setType(ToolWindowType.WINDOWED, null); + } + } + + public void update(AnActionEvent event) { + super.update(event); + Presentation presentation = event.getPresentation(); + Project project = CommonDataKeys.PROJECT.getData(event.getDataContext()); + if (project == null) { + presentation.setEnabled(false); + return; + } + ToolWindowManager mgr = ToolWindowManager.getInstance(project); + String id = mgr.getActiveToolWindowId(); + presentation.setEnabled(id != null && mgr.getToolWindow(id).isAvailable()); + } +} diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/FloatingDecorator.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/FloatingDecorator.java index 5a0a20351c29..4a05faa4a8f0 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/FloatingDecorator.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/FloatingDecorator.java @@ -43,6 +43,8 @@ import java.awt.event.WindowEvent; public final class FloatingDecorator extends JDialog { private static final Logger LOG=Logger.getInstance("#com.intellij.openapi.wm.impl.FloatingDecorator"); + static final int DIVIDER_WIDTH = 3; + private static final int ANCHOR_TOP=1; private static final int ANCHOR_LEFT=2; private static final int ANCHOR_BOTTOM=4; @@ -201,7 +203,6 @@ public final class FloatingDecorator extends JDialog { } private final class BorderItem extends JPanel{ - private static final int DIVIDER_WIDTH=3; private static final int RESIZER_WIDTH=10; private final int myAnchor; diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/InternalDecorator.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/InternalDecorator.java index 876d4e8c5886..fd33c767533d 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/InternalDecorator.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/InternalDecorator.java @@ -65,6 +65,7 @@ public final class InternalDecorator extends JPanel implements Queryable, DataPr private final TogglePinnedModeAction myToggleAutoHideModeAction; private final ToggleDockModeAction myToggleDockModeAction; private final ToggleFloatingModeAction myToggleFloatingModeAction; + private final ToggleWindowedModeAction myToggleWindowedModeAction; private final ToggleSideModeAction myToggleSideModeAction; private final ToggleContentUiTypeAction myToggleContentUiTypeAction; @@ -76,6 +77,7 @@ public final class InternalDecorator extends JPanel implements Queryable, DataPr @NonNls public static final String TOGGLE_PINNED_MODE_ACTION_ID = "TogglePinnedMode"; @NonNls public static final String TOGGLE_DOCK_MODE_ACTION_ID = "ToggleDockMode"; @NonNls public static final String TOGGLE_FLOATING_MODE_ACTION_ID = "ToggleFloatingMode"; + @NonNls public static final String TOGGLE_WINDOWED_MODE_ACTION_ID = "ToggleWindowedMode"; @NonNls public static final String TOGGLE_SIDE_MODE_ACTION_ID = "ToggleSideMode"; @NonNls private static final String TOGGLE_CONTENT_UI_TYPE_ACTION_ID = "ToggleContentUiTypeMode"; @@ -90,6 +92,7 @@ public final class InternalDecorator extends JPanel implements Queryable, DataPr myDivider = new MyDivider(); myToggleFloatingModeAction = new ToggleFloatingModeAction(); + myToggleWindowedModeAction = new ToggleWindowedModeAction(); myToggleSideModeAction = new ToggleSideModeAction(); myToggleDockModeAction = new ToggleDockModeAction(); myToggleAutoHideModeAction = new TogglePinnedModeAction(); @@ -428,17 +431,24 @@ public final class InternalDecorator extends JPanel implements Queryable, DataPr group.add(myToggleAutoHideModeAction); group.add(myToggleDockModeAction); group.add(myToggleFloatingModeAction); + group.add(myToggleWindowedModeAction); group.add(myToggleSideModeAction); } else if (myInfo.isFloating()) { group.add(myToggleAutoHideModeAction); group.add(myToggleFloatingModeAction); + group.add(myToggleWindowedModeAction); + } + else if (myInfo.isWindowed()) { + group.add(myToggleFloatingModeAction); + group.add(myToggleWindowedModeAction); } else if (myInfo.isSliding()) { if (!ToolWindowId.PREVIEW.equals(myInfo.getId())) { group.add(myToggleDockModeAction); } group.add(myToggleFloatingModeAction); + group.add(myToggleWindowedModeAction); group.add(myToggleSideModeAction); } return group; @@ -567,6 +577,27 @@ public final class InternalDecorator extends JPanel implements Queryable, DataPr } } + private final class ToggleWindowedModeAction extends ToggleAction implements DumbAware { + public ToggleWindowedModeAction() { + copyFrom(ActionManager.getInstance().getAction(TOGGLE_WINDOWED_MODE_ACTION_ID)); + } + + @Override + public final boolean isSelected(final AnActionEvent event) { + return myInfo.isWindowed(); + } + + @Override + public final void setSelected(final AnActionEvent event, final boolean flag) { + if (myInfo.isWindowed()) { + fireTypeChanged(myInfo.getInternalType()); + } + else { + fireTypeChanged(ToolWindowType.WINDOWED); + } + } + } + private final class ToggleSideModeAction extends ToggleAction implements DumbAware { public ToggleSideModeAction() { copyFrom(ActionManager.getInstance().getAction(TOGGLE_SIDE_MODE_ACTION_ID)); diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java index e7240a66a5b2..2d727abfdc3e 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java @@ -77,6 +77,8 @@ import java.beans.PropertyChangeListener; import java.util.*; import java.util.List; +import static com.intellij.openapi.wm.impl.FloatingDecorator.DIVIDER_WIDTH; + /** * @author Anton Katilin * @author Vladimir Kondratyev @@ -90,6 +92,7 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements private final DesktopLayout myLayout; private final Map myId2InternalDecorator; private final Map myId2FloatingDecorator; + private final Map myId2WindowedDecorator; private final Map myId2StripeButton; private final Map myId2FocusWatcher; private final Set myDumbAwareIds = Collections.synchronizedSet(ContainerUtil.newTroveSet()); @@ -186,6 +189,7 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements myId2InternalDecorator = new HashMap(); myId2FloatingDecorator = new HashMap(); + myId2WindowedDecorator = new HashMap(); myId2StripeButton = new HashMap(); myId2FocusWatcher = new HashMap(); @@ -702,7 +706,7 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements } private boolean isToHide(final WindowInfoImpl info) { - return (info.isAutoHide() || info.isSliding()) && !(info.isFloating() && hasModalChild(info)); + return (info.isAutoHide() || info.isSliding()) && !(info.isFloating() && hasModalChild(info)) && !info.isWindowed(); } /** @@ -808,6 +812,9 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements if (info.isFloating()) { appendRemoveFloatingDecoratorCmd(info, commandsList); } + else if (info.isWindowed()) { + appendRemoveWindowedDecoratorCmd(info, commandsList); + } else { // docked and sliding windows appendRemoveDecoratorCmd(id, false, commandsList); } @@ -863,7 +870,12 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements private FloatingDecorator getFloatingDecorator(final String id) { return myId2FloatingDecorator.get(id); } - + /** + * @return windowed decorator for the tool window with specified ID. + */ + private WindowedDecorator getWindowedDecorator(String id) { + return myId2WindowedDecorator.get(id); + } /** * @return internal decorator for the tool window with specified ID. */ @@ -1037,6 +1049,9 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements if (toBeShownInfo.isFloating()) { commandsList.add(new AddFloatingDecoratorCmd(decorator, toBeShownInfo)); } + else if (toBeShownInfo.isWindowed()) { + commandsList.add(new AddWindowedDecoratorCmd(decorator, toBeShownInfo)); + } else { // docked and sliding windows // If there is tool window on the same side then we have to hide it, i.e. @@ -1260,6 +1275,9 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements if (info.isFloating()) { appendRemoveFloatingDecoratorCmd(info, commandsList); } + else if (info.isWindowed()) { + appendRemoveWindowedDecoratorCmd(info, commandsList); + } else { // floating and sliding windows appendRemoveDecoratorCmd(id, false, commandsList); } @@ -1744,6 +1762,9 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements if (info.isFloating()) { appendRemoveFloatingDecoratorCmd(info, commandsList); } + else if (info.isWindowed()) { + appendRemoveWindowedDecoratorCmd(info, commandsList); + } else { // docked and sliding windows appendRemoveDecoratorCmd(id, dirtyMode, commandsList); } @@ -1790,6 +1811,11 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements commandsList.add(command); } + private void appendRemoveWindowedDecoratorCmd(final WindowInfoImpl info, final List commandsList) { + final RemoveWindowedDecoratorCmd command = new RemoveWindowedDecoratorCmd(info); + commandsList.add(command); + } + /** * @see com.intellij.openapi.wm.impl.ToolWindowsPane#createAddButtonCmd */ @@ -2108,6 +2134,104 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements return ApplicationManager.getApplication().getDisposed(); } } + + /** + * This command creates and shows WindowedDecorator. + */ + private final class AddWindowedDecoratorCmd extends FinalizableCommand { + private final WindowedDecorator myWindowedDecorator; + + /** + * Creates floating decorator for specified floating decorator. + */ + private AddWindowedDecoratorCmd(final InternalDecorator decorator, final WindowInfoImpl info) { + super(myWindowManager.getCommandProcessor()); + myWindowedDecorator = new WindowedDecorator(myProject, info.copy(), decorator); + Window window = myWindowedDecorator.getFrame(); + final Rectangle bounds = info.getFloatingBounds(); + if (bounds != null) { + bounds.setBounds(bounds.x + DIVIDER_WIDTH, bounds.y + DIVIDER_WIDTH, bounds.width - 2 * DIVIDER_WIDTH, bounds.height - 2 * DIVIDER_WIDTH); + } + if (bounds != null && + bounds.width > 0 && + bounds.height > 0 && + myWindowManager.isInsideScreenBounds(bounds.x, bounds.y, bounds.width)) { + window.setBounds(bounds); + } + else { // place new frame at the center of main frame if there are no floating bounds + Dimension size = decorator.getSize(); + if (size.width == 0 || size.height == 0) { + size = decorator.getPreferredSize(); + } + window.setSize(size); + window.setLocationRelativeTo(myFrame); + } + myId2WindowedDecorator.put(info.getId(), myWindowedDecorator); + myWindowedDecorator.addDisposable(new Disposable() { + @Override + public void dispose() { + if (myId2WindowedDecorator.get(info.getId()) != null) { + hideToolWindow(info.getId(), false); + } + } + }); + } + + @Override + public void run() { + try { + myWindowedDecorator.show(false); + Window window = myWindowedDecorator.getFrame(); + JRootPane rootPane = ((RootPaneContainer)window).getRootPane(); + Rectangle rootPaneBounds = rootPane.getBounds(); + Point point = rootPane.getLocationOnScreen(); + Rectangle windowBounds = window.getBounds(); + //Point windowLocation = windowBounds.getLocation(); + //windowLocation.translate(windowLocation.x - point.x, windowLocation.y - point.y); + window.setLocation(2 * windowBounds.x - point.x, 2 * windowBounds.y - point.y); + window.setSize(2 * windowBounds.width - rootPaneBounds.width, 2 * windowBounds.height - rootPaneBounds.height); + } + finally { + finish(); + } + } + } + + /** + * This command hides and destroys floating decorator for tool window + * with specified ID. + */ + private final class RemoveWindowedDecoratorCmd extends FinalizableCommand { + private final WindowedDecorator myWindowedDecorator; + + private RemoveWindowedDecoratorCmd(final WindowInfoImpl info) { + super(myWindowManager.getCommandProcessor()); + myWindowedDecorator = getWindowedDecorator(info.getId()); + myId2WindowedDecorator.remove(info.getId()); + + JRootPane rootPane = ((RootPaneContainer)myWindowedDecorator.getFrame()).getRootPane(); + Rectangle bounds = rootPane.getBounds(); + Point location = rootPane.getLocationOnScreen(); + bounds.setBounds(location.x - DIVIDER_WIDTH, location.y - DIVIDER_WIDTH, bounds.width + 2 * DIVIDER_WIDTH, bounds.height + 2 * DIVIDER_WIDTH); + info.setFloatingBounds(bounds); + } + + @Override + public void run() { + try { + Disposer.dispose(myWindowedDecorator); + } + finally { + finish(); + } + } + + @Override + @Nullable + public Condition getExpireCondition() { + return ApplicationManager.getApplication().getDisposed(); + } + } private final class EditorComponentFocusWatcher extends FocusWatcher { @Override diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowInfoImpl.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowInfoImpl.java index 8fc9b55d609c..aa7c3657e18b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowInfoImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowInfoImpl.java @@ -157,7 +157,7 @@ public final class WindowInfoImpl implements Cloneable,JDOMExternalizable, Windo */ @Override public Rectangle getFloatingBounds(){ - return myFloatingBounds; + return new Rectangle(myFloatingBounds); } /** @@ -229,6 +229,11 @@ public final class WindowInfoImpl implements Cloneable,JDOMExternalizable, Windo return ToolWindowType.FLOATING==myType; } + @Override + public boolean isWindowed(){ + return ToolWindowType.WINDOWED==myType; + } + @Override public boolean isSliding(){ return ToolWindowType.SLIDING==myType; @@ -251,6 +256,9 @@ public final class WindowInfoImpl implements Cloneable,JDOMExternalizable, Windo if (ToolWindowType.DOCKED.toString().equalsIgnoreCase(text)) { return ToolWindowType.DOCKED; } + if (ToolWindowType.WINDOWED.toString().equalsIgnoreCase(text)) { + return ToolWindowType.WINDOWED; + } if (ToolWindowType.FLOATING.toString().equalsIgnoreCase(text)) { return ToolWindowType.FLOATING; } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowedDecorator.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowedDecorator.java new file mode 100644 index 000000000000..53e29a1a8749 --- /dev/null +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowedDecorator.java @@ -0,0 +1,39 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.openapi.wm.impl; + +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.ui.FrameWrapper; +import org.jetbrains.annotations.NotNull; + +public final class WindowedDecorator extends FrameWrapper { + private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.wm.impl.WindowedDecorator"); + + private final Project myProject; + + WindowedDecorator(@NotNull Project project, @NotNull WindowInfoImpl info, @NotNull InternalDecorator internalDecorator) { + super(project); + myProject = project; + setTitle(info.getId() + " - " + myProject.getName()); + setProject(project); + setComponent(internalDecorator); + } + + public Project getProject() { + return myProject; + } +} \ No newline at end of file diff --git a/platform/platform-resources-en/src/messages/ActionsBundle.properties b/platform/platform-resources-en/src/messages/ActionsBundle.properties index 89f48f1340cc..430b5b608017 100644 --- a/platform/platform-resources-en/src/messages/ActionsBundle.properties +++ b/platform/platform-resources-en/src/messages/ActionsBundle.properties @@ -843,6 +843,8 @@ action.ToggleDockMode.text=Dock_ed Mode action.ToggleDockMode.description=Dock/undock active tool window action.ToggleFloatingMode.text=Floating _Mode action.ToggleFloatingMode.description=Float/unfloat active tool window +action.ToggleWindowedMode.text=_Windowed Mode +action.ToggleWindowedMode.description=Window/unwindow active tool window action.ToggleSideMode.text=Split Mode action.ToggleSideMode.description=Tool windows split mode on/off action.ToggleContentUiTypeMode.text=Show Views as Tabs diff --git a/platform/platform-resources/src/idea/PlatformActions.xml b/platform/platform-resources/src/idea/PlatformActions.xml index 05c267a7b065..d1f98e7d62ae 100644 --- a/platform/platform-resources/src/idea/PlatformActions.xml +++ b/platform/platform-resources/src/idea/PlatformActions.xml @@ -374,6 +374,7 @@ + diff --git a/plugins/properties/testData/propertiesFile/enter/Performance.properties b/plugins/properties/testData/propertiesFile/enter/Performance.properties index 7ea7f2a6db40..a0384241cf5c 100644 --- a/plugins/properties/testData/propertiesFile/enter/Performance.properties +++ b/plugins/properties/testData/propertiesFile/enter/Performance.properties @@ -5045,6 +5045,8 @@ action.ToggleDockMode.text=Dock_ed Mode action.ToggleDockMode.description=Dock/undock active tool window action.ToggleFloatingMode.text=Floating _Mode action.ToggleFloatingMode.description=Float/unfloat active tool window +action.ToggleWindowedMode.text=_Windowed Mode +action.ToggleWindowedMode.description=Window/unwindow active tool window action.ToggleSideMode.text=Split Mode action.ToggleSideMode.description=Tool windows split mode on/off action.ToggleContentUiTypeMode.text=Show Views as Tabs @@ -20533,6 +20535,8 @@ action.ToggleDockMode.text=Dock_ed Mode action.ToggleDockMode.description=Dock/undock active tool window action.ToggleFloatingMode.text=Floating _Mode action.ToggleFloatingMode.description=Float/unfloat active tool window +action.ToggleWindowedMode.text=_Windowed Mode +action.ToggleWindowedMode.description=Window/unwindow active tool window action.ToggleSideMode.text=Split Mode action.ToggleSideMode.description=Tool windows split mode on/off action.ToggleContentUiTypeMode.text=Show Views as Tabs diff --git a/xml/dom-tests/testData/performance.xml b/xml/dom-tests/testData/performance.xml index 49f57b15fcd9..f962b120e584 100644 --- a/xml/dom-tests/testData/performance.xml +++ b/xml/dom-tests/testData/performance.xml @@ -591,6 +591,7 @@ +