本文整理汇总了Java中org.eclipse.gef.RootEditPart类的典型用法代码示例。如果您正苦于以下问题:Java RootEditPart类的具体用法?Java RootEditPart怎么用?Java RootEditPart使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RootEditPart类属于org.eclipse.gef包,在下文中一共展示了RootEditPart类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeOverview
import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
* Initialize overview.
*/
protected void initializeOverview() {
LightweightSystem lws = new J2DLightweightSystem(overview);
RootEditPart rep = editor.getGraphicalViewer().getRootEditPart();
if (rep instanceof MainDesignerRootEditPart) {
ScalableFreeformRootEditPart root = (ScalableFreeformRootEditPart) rep;
thumbnail = new JSSScrollableThumbnail((Viewport) root.getFigure(), (MRoot)getViewer().getContents().getModel());
thumbnail.setSource(root.getLayer(LayerConstants.PRINTABLE_LAYERS));
lws.setContents(thumbnail);
disposeListener = new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
if (thumbnail != null) {
thumbnail.deactivate();
thumbnail = null;
}
}
};
editor.getEditor().addDisposeListener(disposeListener);
}
lws.setControl(overview);
}
示例2: initializeOverview
import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
* Initialize the graphical overview.
*
*/
protected void initializeOverview() {
if (multieditor.getCurrentPage() == null) {
overview.setVisible(false);
thumbnail.deactivate();
thumbnail = null;
return;
}
RootEditPart rep = multieditor.getCurrentPage().getGraphicalViewer().getRootEditPart();
if (rep instanceof ScalableFreeformRootEditPart) {
refreshThumbnail((ScalableFreeformRootEditPart) rep);
disposeListener = new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
if (thumbnail != null) {
thumbnail.deactivate();
thumbnail = null;
}
}
};
((FigureCanvas) multieditor.getCurrentPage().getGraphicalViewer().getControl()).addDisposeListener(disposeListener);
}
}
示例3: pageChanged
import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
* Refresh the overview thumbnail when the map changes.
*/
public void pageChanged() {
if (multieditor.getCurrentPage() == null) {
overview.setVisible(false);
thumbnail.deactivate();
thumbnail = null;
return;
}
RootEditPart rep = multieditor.getCurrentPage().getGraphicalViewer().getRootEditPart();
if (rep instanceof ScalableFreeformRootEditPart) {
refreshThumbnail((ScalableFreeformRootEditPart) rep);
}
refreshDefinitions(false);
}
示例4: getViewer
import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
public EditPartViewer getViewer() {
RootEditPart root = getRoot();
if (root == null) {
return null;
}
return root.getViewer();
}
示例5: getOverviewOutlinePage
import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
protected OverviewOutlinePage getOverviewOutlinePage() {
if(null == overviewOutlinePage && null != getGraphicalViewer()) {
RootEditPart rootEditPart = getGraphicalViewer().getRootEditPart();
if(rootEditPart instanceof ScalableRootEditPart) {
overviewOutlinePage =
new OverviewOutlinePage(
(ScalableRootEditPart) rootEditPart);
}
}
return overviewOutlinePage;
}
示例6: getDiagramEditPart
import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
*
* platformUi에서 다이어그램 EditPart를 가져온다.
*
* @return EditPart
*/
public static EditPart getDiagramEditPart() {
IWorkbench workbench = PlatformUI.getWorkbench();
if (!checkNull(workbench)) {
return null;
}
IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
if (!checkNull(workbenchWindow)) {
return null;
}
IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
if (!checkNull(workbenchPage)) {
return null;
}
IEditorPart editorPart = workbenchPage.getActiveEditor();
if (!checkNull(editorPart)) {
return null;
}
if (!(editorPart instanceof AbstractDiagramEditor)) {
return null;
}
GraphicalViewer graphicalViewer = ((AbstractDiagramEditor) editorPart).getDiagramGraphicalViewer();
if (!checkNull(graphicalViewer)) {
return null;
}
RootEditPart rootEditPart = graphicalViewer.getRootEditPart();
if (!checkNull(rootEditPart)) {
return null;
}
EditPart editPart = rootEditPart.getContents();
if (!checkNull(editPart)) {
return null;
}
return editPart;
}
示例7: getRoot
import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
* @see org.eclipse.gef.editparts.AbstractEditPart#getRoot()
*/
@Override
public RootEditPart getRoot() {
if (getParent() != null && getParent().getParent() != null) {
return super.getRoot();
} else {
return ((AbstractDiagramEditor) PlatformUI.getWorkbench()
.getActiveWorkbenchWindow()
.getActivePage()
.getActiveEditor()).getDiagramGraphicalViewer().getRootEditPart();
}
// return super.getRoot();
}
示例8: getRoot
import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
* @see org.eclipse.gef.editparts.AbstractEditPart#getRoot()
*/
@Override
public RootEditPart getRoot() {
if (getParent() != null && getParent().getParent() != null) {
return super.getRoot();
} else {
return ((AbstractDiagramEditor) PlatformUI.getWorkbench()
.getActiveWorkbenchWindow()
.getActivePage()
.getActiveEditor()).getDiagramGraphicalViewer().getRootEditPart();
}
}
示例9: getMapMode
import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
protected IMapMode getMapMode() {
RootEditPart root = getHost().getRoot();
if (root instanceof DiagramRootEditPart) {
DiagramRootEditPart dgrmRoot = (DiagramRootEditPart) root;
return dgrmRoot.getMapMode();
}
return MapModeUtil.getMapMode();
}
示例10: appendSelection
import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
* @see org.eclipse.gef.EditPartViewer#appendSelection(org.eclipse.gef.EditPart)
*/
public void appendSelection(EditPart editpart) {
if (editpart instanceof RootEditPart)
editpart = ((RootEditPart) editpart).getContents();
setFocus(editpart);
super.appendSelection(editpart);
}
示例11: createEditPolicies
import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
* Creates and installs pertinent EditPolicies.
*/
@Override
protected void createEditPolicies() {
super.createEditPolicies();
installEditPolicy(EditPolicy.CONTAINER_ROLE, new JDContainerEditPolicy());
installEditPolicy(EditPolicy.TREE_CONTAINER_ROLE, new JDTreeContainerEditPolicy());
//Overwrite the policy that handle the delete, so i have a custom delete command to close the subeditor
installEditPolicy(EditPolicy.COMPONENT_ROLE, new CloseSubeditorDeletePolicy());
// If this editpart is the contents of the viewer, then it is not deletable!
if (getParent() instanceof RootEditPart)
installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
}
示例12: createEditPolicies
import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
* Creates and installs pertinent EditPolicies.
*/
@Override
protected void createEditPolicies() {
super.createEditPolicies();
installEditPolicy(EditPolicy.CONTAINER_ROLE, new JDContainerEditPolicy());
installEditPolicy(EditPolicy.TREE_CONTAINER_ROLE, new JDTreeContainerEditPolicy());
// If this editpart is the contents of the viewer, then it is not deletable!
if (getParent() instanceof RootEditPart)
installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:13,代码来源:NotDragableContainerTreeEditPart.java
示例13: createEditPolicies
import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
/**
* Creates and installs pertinent EditPolicies.
*/
protected void createEditPolicies() {
super.createEditPolicies();
installEditPolicy(EditPolicy.CONTAINER_ROLE, new JDStyleContainerEditPolicy());
installEditPolicy(EditPolicy.TREE_CONTAINER_ROLE, new JDStyleTreeContainerEditPolicy());
// If this editpart is the contents of the viewer, then it is not deletable!
if (getParent() instanceof RootEditPart)
installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
}
示例14: handleMove
import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
@Override
protected boolean handleMove() {
try {
EditPartViewer viewer = getCurrentViewer();
if (viewer instanceof TimelineViewer) {
TimelineViewer timelineViewer = (TimelineViewer) viewer;
RootEditPart rootEditPart = timelineViewer.getRootEditPart();
List children = rootEditPart.getChildren();
if ((children.size() != 1) || !(children.get(0) instanceof SplitScroller)) {
// Don't update the cursor time while in the horizontal scroller.
// Scrolling and updating the cursor time together interact very poorly.
// The effect seen was that the scrollbar would follow the cursor until
// the mouse was released at which point the scrollbar would snap to the
// right, hiding what the user had revealed.
TimelineUtils.updateCursorTime(timelineViewer, this);
}
}
String tooltipPreference = TimelineConstants.TIMELINE_PREFERENCES.getString(TimelinePreferencePage.P_TOOLTIP_SPEED);
Tooltip value = Tooltip.valueOf(tooltipPreference);
if (value == Tooltip.FAST) {
handleHover();
}
} catch (Exception e) {
LogUtil.error("handleMove", e);
}
return super.handleMove();
}
示例15: getRoot
import org.eclipse.gef.RootEditPart; //导入依赖的package包/类
@Override
public RootEditPart getRoot() {
if (getParent() == null) {
return null;
}
return super.getRoot();
}