本文整理汇总了Java中org.eclipse.gef.palette.PaletteStack类的典型用法代码示例。如果您正苦于以下问题:Java PaletteStack类的具体用法?Java PaletteStack怎么用?Java PaletteStack使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PaletteStack类属于org.eclipse.gef.palette包,在下文中一共展示了PaletteStack类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createEditPart
import org.eclipse.gef.palette.PaletteStack; //导入依赖的package包/类
/**
* @see org.eclipse.gef.EditPartFactory#createEditPart(EditPart, Object)
*/
public EditPart createEditPart(EditPart parentEditPart, Object model) {
if (model instanceof PaletteRoot)
return createMainPaletteEditPart(parentEditPart, model);
if (model instanceof PaletteStack)
return createStackEditPart(parentEditPart, model);
if (model instanceof PaletteContainer) {
Object type = ((PaletteContainer) model).getType();
if (PaletteDrawer.PALETTE_TYPE_DRAWER.equals(type))
return createDrawerEditPart(parentEditPart, model);
if (PaletteGroup.PALETTE_TYPE_GROUP.equals(type)
|| PaletteContainer.PALETTE_TYPE_UNKNOWN.equals(type))
return createGroupEditPart(parentEditPart, model);
if (PaletteToolbar.PALETTE_TYPE_TOOLBAR_GROUP.equals(type))
return createToolbarEditPart(parentEditPart, model);
}
if (model instanceof PaletteTemplateEntry)
return createTemplateEditPart(parentEditPart, model);
if (model instanceof PaletteSeparator)
return createSeparatorEditPart(parentEditPart, model);
if (model instanceof PaletteEntry)
return createEntryEditPart(parentEditPart, model);
return null;
}
示例2: reveal
import org.eclipse.gef.palette.PaletteStack; //导入依赖的package包/类
/**
* @see ScrollingGraphicalViewer#reveal(EditPart)
*/
public void reveal(EditPart part) {
// If the given part is a drawer, we don't need to expand it. Hence,
// when invoking
// findContainingDrawer(), we use part.getParent()
DrawerEditPart drawer = findContainingDrawer(part.getParent());
if (drawer != null && !drawer.isExpanded())
drawer.setExpanded(true);
// if the part is inside a stack, set it to be the top level item of the
// stack.
if (part.getParent() != null
&& part.getParent() instanceof PaletteStackEditPart)
((PaletteStack) part.getParent().getModel())
.setActiveEntry((PaletteEntry) part.getModel());
super.reveal(part);
}
示例3: canCreate
import org.eclipse.gef.palette.PaletteStack; //导入依赖的package包/类
/**
* @see org.eclipse.gef.ui.palette.customize.PaletteEntryFactory#canCreate(org.eclipse.gef.palette.PaletteEntry)
*/
public boolean canCreate(PaletteEntry selected) {
if (!(selected instanceof ToolEntry)
|| selected.getParent() instanceof PaletteStack)
return false;
return super.canCreate(selected);
}
示例4: createNewEntry
import org.eclipse.gef.palette.PaletteStack; //导入依赖的package包/类
/**
* @see org.eclipse.gef.ui.palette.customize.PaletteEntryFactory#createNewEntry(org.eclipse.swt.widgets.Shell,
* org.eclipse.gef.palette.PaletteEntry)
*/
public PaletteEntry createNewEntry(Shell shell, PaletteEntry selected) {
PaletteContainer parent = determineContainerForNewEntry(selected);
int index = determineIndexForNewEntry(parent, selected);
PaletteEntry entry = createNewEntry(shell);
parent.remove(selected);
parent.add(index - 1, entry);
((PaletteStack) entry).add(selected);
entry.setUserModificationPermission(PaletteEntry.PERMISSION_FULL_MODIFICATION);
return entry;
}
示例5: buildNavigationList
import org.eclipse.gef.palette.PaletteStack; //导入依赖的package包/类
private void buildNavigationList(EditPart palettePart, EditPart exclusion,
ArrayList navList, EditPart stackPart) {
if (palettePart != exclusion) {
if (isCollapsedDrawer(palettePart)) {
navList.add(palettePart);
return;
} else if (stackPart instanceof PaletteStackEditPart
&& stackPart.getChildren().contains(palettePart)) {
// we only want to add the top level item to the navlist
if (((PaletteStack) stackPart.getModel()).getActiveEntry()
.equals(palettePart.getModel()))
navList.add(palettePart);
} else if (stackPart instanceof PinnablePaletteStackEditPart
&& stackPart.getChildren().contains(palettePart)) {
// we only want to add the top level item to the navlist unless
// the palette stack is expanded
if (((PinnablePaletteStackEditPart) stackPart).isExpanded()
|| ((PaletteStack) stackPart.getModel())
.getActiveEntry()
.equals(palettePart.getModel())) {
navList.add(palettePart);
}
} else if ((palettePart instanceof ToolEntryEditPart
|| palettePart instanceof DrawerEditPart || palettePart instanceof TemplateEditPart)) {
navList.add(palettePart);
}
}
List children = palettePart.getChildren();
for (int k = 0; k < children.size(); k++) {
EditPart ep = (EditPart) children.get(k);
if (ep instanceof IPaletteStackEditPart)
stackPart = ep;
buildNavigationList(ep, exclusion, navList, stackPart);
}
}
示例6: navigateTo
import org.eclipse.gef.palette.PaletteStack; //导入依赖的package包/类
/**
* @see GraphicalViewerKeyHandler#navigateTo(EditPart, KeyEvent)
*/
protected void navigateTo(EditPart part, KeyEvent event) {
if (part == null)
return;
if (part instanceof IPaletteStackEditPart) {
PaletteEntry activeEntry = ((PaletteStack) part.getModel())
.getActiveEntry();
part = (EditPart) getViewer().getEditPartRegistry()
.get(activeEntry);
}
getViewer().select(part);
getViewer().reveal(part);
}
示例7: propertyChange
import org.eclipse.gef.palette.PaletteStack; //导入依赖的package包/类
/**
* @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
if (event.getPropertyName().equals(PaletteStack.PROPERTY_ACTIVE_ENTRY))
activeEntryChanged(event.getOldValue(), event.getNewValue());
else
super.propertyChange(event);
}
示例8: getAdapter
import org.eclipse.gef.palette.PaletteStack; //导入依赖的package包/类
public Object getAdapter(Class key) {
if (key == IPinnableEditPart.class) {
if ((getParent() instanceof PinnablePaletteStackEditPart)
&& ((PinnablePaletteStackEditPart) getParent())
.canBePinned()
&& ((PaletteStack) getParent().getModel()).getActiveEntry()
.equals(getModel())) {
return getParent();
}
}
return super.getAdapter(key);
}
示例9: determineTypeForNewEntry
import org.eclipse.gef.palette.PaletteStack; //导入依赖的package包/类
/**
* @see org.eclipse.gef.ui.palette.customize.PaletteEntryFactory#determineTypeForNewEntry(org.eclipse.gef.palette.PaletteEntry)
*/
protected Object determineTypeForNewEntry(PaletteEntry selected) {
return PaletteStack.PALETTE_TYPE_STACK;
}
示例10: getStack
import org.eclipse.gef.palette.PaletteStack; //导入依赖的package包/类
private PaletteStack getStack() {
return (PaletteStack) getModel();
}
示例11: propertyChange
import org.eclipse.gef.palette.PaletteStack; //导入依赖的package包/类
public void propertyChange(PropertyChangeEvent event) {
if (event.getPropertyName().equals(PaletteStack.PROPERTY_ACTIVE_ENTRY))
activeEntryChanged(event.getOldValue(), event.getNewValue());
else
super.propertyChange(event);
}
示例12: createStackEditPart
import org.eclipse.gef.palette.PaletteStack; //导入依赖的package包/类
/**
* Create PaletteStackEditPart - edit part for PaletteStack
*
* @param parentEditPart
* the parent of the new editpart to be created
* @param model
* the PaletteStack
* @return the newly created EditPart
*/
protected EditPart createStackEditPart(EditPart parentEditPart, Object model) {
if (parentEditPart instanceof PaletteEditPart
&& ((PaletteEditPart) parentEditPart).isToolbarItem()) {
return new PaletteStackEditPart((PaletteStack) model);
}
return new PinnablePaletteStackEditPart((PaletteStack) model);
}
示例13: PaletteStackEditPart
import org.eclipse.gef.palette.PaletteStack; //导入依赖的package包/类
/**
* Creates a new PaletteStackEditPart with the given PaletteStack as its
* model.
*
* @param model
* the PaletteStack to associate with this EditPart.
*/
public PaletteStackEditPart(PaletteStack model) {
super(model);
}
示例14: PinnablePaletteStackEditPart
import org.eclipse.gef.palette.PaletteStack; //导入依赖的package包/类
/**
* Creates a new PaletteStackEditPart with the given PaletteStack as its
* model.
*
* @param model
* the PaletteStack to associate with this EditPart.
*/
public PinnablePaletteStackEditPart(PaletteStack model) {
super(model);
}