remove old actions

This commit is contained in:
Dennis Ushakov
2012-01-26 22:10:43 +04:00
parent e1d1686263
commit e343fa4fe0
5 changed files with 1 additions and 227 deletions
@@ -1,51 +0,0 @@
/*
* 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.execution.ui.layout.actions;
import com.intellij.execution.ui.actions.BaseViewAction;
import com.intellij.execution.ui.layout.Grid;
import com.intellij.execution.ui.layout.GridCell;
import com.intellij.execution.ui.layout.ViewContext;
import com.intellij.idea.ActionsBundle;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.ui.content.Content;
public class AttachCellAction extends BaseViewAction {
protected void update(final AnActionEvent e, final ViewContext context, final Content[] content) {
if (content.length == 0 || !isDetached(context, content[0])) {
setEnabled(e, false);
return;
}
Grid grid = context.findGridFor(content[0]);
GridCell cell = grid.getCellFor(content[0]);
if (ViewContext.CELL_TOOLBAR_PLACE.equals(e.getPlace()) && content.length == 1) {
setEnabled(e, cell.getContentCount() == 1);
} else {
setEnabled(e, true);
if (cell.getContentCount() > 1) {
e.getPresentation().setText(ActionsBundle.message("action.Runner.AttachCells.text", cell.getContentCount()));
}
}
}
protected void actionPerformed(final AnActionEvent e, final ViewContext context, final Content[] content) {
context.findCellFor(content[0]).attach();
}
}
@@ -1,59 +0,0 @@
/*
* 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.execution.ui.layout.actions;
import com.intellij.execution.ui.actions.BaseViewAction;
import com.intellij.execution.ui.layout.Grid;
import com.intellij.execution.ui.layout.GridCell;
import com.intellij.execution.ui.layout.ViewContext;
import com.intellij.idea.ActionsBundle;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.ui.content.Content;
public class DetachCellAction extends BaseViewAction {
protected void update(final AnActionEvent e, final ViewContext context, final Content[] content) {
if (content.length == 0 || isDetached(context, content[0])) {
setEnabled(e, false);
return;
}
Grid grid = context.findGridFor(content[0]);
if (grid == null) {
setEnabled(e, false);
return;
}
if (ViewContext.TAB_TOOLBAR_PLACE.equals(e.getPlace()) || (ViewContext.TAB_POPUP_PLACE.equals(e.getPlace()))) {
setEnabled(e, grid.getContents().size() == 1);
}
else {
GridCell cell = grid.getCellFor(content[0]);
if (ViewContext.CELL_TOOLBAR_PLACE.equals(e.getPlace()) && content.length == 1) {
setEnabled(e, cell.getContentCount() == 1);
} else {
setEnabled(e, true);
if (cell.getContentCount() > 1) {
e.getPresentation().setText(ActionsBundle.message("action.Runner.DetachCells.text", cell.getContentCount()));
}
}
}
}
protected void actionPerformed(final AnActionEvent e, final ViewContext context, final Content[] content) {
context.findCellFor(content[0]).detach();
}
}
@@ -1,50 +0,0 @@
/*
* 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.execution.ui.layout.actions;
import com.intellij.execution.ui.actions.BaseViewAction;
import com.intellij.execution.ui.layout.Grid;
import com.intellij.execution.ui.layout.Tab;
import com.intellij.execution.ui.layout.ViewContext;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.ui.content.Content;
public class MoveToGridAction extends BaseViewAction {
protected void update(final AnActionEvent e, final ViewContext context, final Content[] content) {
if (!context.isMoveToGridActionEnabled() || content.length != 1) {
setEnabled(e, false);
return;
}
if (isDetached(context, content[0])) {
setEnabled(e, false);
return;
}
Grid grid = context.findGridFor(content[0]);
if (grid == null) {
setEnabled(e, false);
return;
}
Tab tab = context.getTabFor(grid);
setEnabled(e, tab != null && !tab.isDefault() && grid.getContents().size() == 1);
}
protected void actionPerformed(final AnActionEvent e, final ViewContext context, final Content[] content) {
context.getCellTransform().moveToGrid(content[0]);
}
}
@@ -1,56 +0,0 @@
/*
* 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.execution.ui.layout.actions;
import com.intellij.execution.ui.actions.BaseViewAction;
import com.intellij.execution.ui.layout.Grid;
import com.intellij.execution.ui.layout.Tab;
import com.intellij.execution.ui.layout.ViewContext;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.ui.content.Content;
public class MoveToTabAction extends BaseViewAction {
protected void update(final AnActionEvent e, final ViewContext context, final Content[] content) {
if (!context.isMoveToGridActionEnabled() || content.length != 1) {
setEnabled(e, false);
return;
}
if (isDetached(context, content[0])) {
setEnabled(e, false);
return;
}
Grid grid = context.findGridFor(content[0]);
if (grid == null) {
setEnabled(e, false);
return;
}
Tab tab = context.getTabFor(grid);
if (ViewContext.TAB_TOOLBAR_PLACE.equals(e.getPlace())) {
setEnabled(e, false);
} else {
setEnabled(e, tab != null && tab.isDefault());
}
}
protected void actionPerformed(final AnActionEvent e, final ViewContext context, final Content[] content) {
context.getCellTransform().moveToTab(content[0]);
}
}
@@ -730,16 +730,11 @@
<group id="RunnerLayoutActions">
<group id="Runner.Layout" icon="/debugger/restoreLayout.png" popup="true">
<action id="Runner.RestoreLayout" class="com.intellij.execution.ui.layout.actions.RestoreLayoutAction"/>
<action id="Runner.ToggleToolbarLayout" class="com.intellij.execution.ui.layout.actions.ToggleToolbarLayoutAction"/>
<!--action id="Runner.ToggleToolbarLayout" class="com.intellij.execution.ui.layout.actions.ToggleToolbarLayoutAction"/-->
</group>
<group id="Runner.View.Popup">
<action id="Runner.MoveViewToGrid" class="com.intellij.execution.ui.layout.actions.MoveToGridAction" icon="/debugger/toGrid.png"/>
<action id="Runner.MoveViewToTab" class="com.intellij.execution.ui.layout.actions.MoveToTabAction" icon="/debugger/toTab.png"/>
<action id="Runner.DetachCell" class="com.intellij.execution.ui.layout.actions.DetachCellAction" icon="/debugger/detach.png"/>
<action id="Runner.AttachCell" class="com.intellij.execution.ui.layout.actions.AttachCellAction" icon="/debugger/attach.png"/>
<separator/>
<action id="Runner.MinimizeView" class="com.intellij.execution.ui.layout.actions.MinimizeViewAction" icon="/actions/minimize.png"/>
<separator/>
<action id="Runner.CloseView" class="com.intellij.execution.ui.layout.actions.CloseViewAction" icon="/actions/cross.png"/>
@@ -753,12 +748,7 @@
<group id="Runner.View.Toolbar">
<reference ref="Runner.MoveViewToGrid"/>
<reference ref="Runner.MoveViewToTab"/>
<reference ref="Runner.DetachCell"/>
<reference ref="Runner.AttachCell"/>
<reference ref="Runner.MinimizeView"/>
<reference ref="Runner.CloseView"/>
</group>
</group>