📄 systemmenudetachex.java
字号:
/*******************************************************************************
* $Header: /cvsroot/EOS6/work_dir/niegy/com.primeton.studio.gef.ui/src/com/primeton/studio/gef/ui/action/SystemMenuDetachEx.java,v 1.1 2006/11/17 03:15:13 niegy Exp $
* $Revision: 1.1 $
* $Date: 2006/11/17 03:15:13 $
*
*==============================================================================
*
* Copyright (c) 2001-2006 Primeton Technologies, Ltd.
* All rights reserved.
*
* Created on 2006-10-26
*******************************************************************************/
package com.primeton.studio.gef.ui.action;
import org.eclipse.ui.internal.ViewPane;
import org.eclipse.ui.internal.WorkbenchMessages;
import org.eclipse.ui.internal.WorkbenchPage;
import org.eclipse.ui.internal.presentations.ISelfUpdatingAction;
import org.eclipse.ui.internal.presentations.PresentationFactoryUtil;
import org.eclipse.ui.presentations.IPresentablePart;
import org.eclipse.ui.presentations.IStackPresentationSite;
import com.primeton.studio.gef.ui.properties.PropertySheetActionEx;
import com.primeton.studio.gef.ui.properties.PropertySheetViewerEx;
/**
* TODO此处填写 class 信息
*
* @author niegy (mailto:niegy@primeton.com)
*/
/*
* 修改历史
* $Log: SystemMenuDetachEx.java,v $
* Revision 1.1 2006/11/17 03:15:13 niegy
* create
*
*/
public class SystemMenuDetachEx extends PropertySheetActionEx implements ISelfUpdatingAction{
private ViewPane viewPane;
// private IStackPresentationSite site;
private WorkbenchPage page;
private boolean fIsDetach;
public SystemMenuDetachEx(PropertySheetViewerEx viewer, boolean isDetach){//,IStackPresentationSite site) {
super(viewer,"Detach");
// this.site = site;
setText(WorkbenchMessages.PartPane_detach);
fIsDetach = isDetach;
if(isDetach){
setChecked(false);
setText("Attach");
}
else{
setChecked(true);
setText("Detach");
}
update();
}
public void update() {
// IPresentablePart presentablePart = site.getSelectedPart();
// setEnabled(presentablePart != null && site.isPartMoveable(presentablePart));
if(viewPane != null){
setChecked(!viewPane.isDocked());
page = viewPane.getPage();
}
}
public boolean shouldBeVisible() {
if(page != null) {
return page.getActivePerspective().getPresentation().canDetach();
}
return false;
}
public void dispose() {
// site = null;
}
public void setPane(ViewPane current){
viewPane = current;
update();
}
public void run() {
if(fIsDetach){
setChecked(false);
setText("Detach");
viewPane.doAttach();
fIsDetach = ! fIsDetach;
}
else{
setChecked(true);
setText("Attach");
viewPane.doDetach();
fIsDetach = ! fIsDetach;
}
// if(!isChecked()){
// viewPane.doDetach();
// }
// else{
// viewPane.doAttach();
//
// }
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -