本文整理汇总了Java中org.eclipse.gef.palette.PaletteRoot类的典型用法代码示例。如果您正苦于以下问题:Java PaletteRoot类的具体用法?Java PaletteRoot怎么用?Java PaletteRoot使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PaletteRoot类属于org.eclipse.gef.palette包,在下文中一共展示了PaletteRoot类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPaletteRoot
import org.eclipse.gef.palette.PaletteRoot; //导入依赖的package包/类
@Override
protected PaletteRoot getPaletteRoot() {
PaletteRoot root = new PaletteRoot();
PaletteDrawer manipGroup = new PaletteDrawer("Definitions");
manipGroup.add(new CreationToolEntry("Add Module Type", "Add Module Type", new ModuleTypeCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Module Implementation", "Add Module Implementation", new ModuleImplementationCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Module Instance", "Add Module Instance", new ModuleInstanceCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Module Instance Property", "Add Module Instance Property", new ModuleInstancePropertyCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Module Operation", "Add Module Operation", new ModuleOperationCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Module Operation Parameter", "Add Module Operation Parameter", new ModuleOperationParameterCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Trigger Instance", "Add Trigger Instance", new TriggerInstanceNodeCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Dynamic Trigger Instance", "Add Dynamic Trigger Instance", new DynamicTriggerInstanceNodeCreationFactory(), null, null));
manipGroup.add(new ConnectionCreationToolEntry("Add Wire", "Add Wire", new LinkCreationFactory(), null, null));
root.add(manipGroup);
return root;
}
示例2: showComponentCreationOnCanvas
import org.eclipse.gef.palette.PaletteRoot; //导入依赖的package包/类
/**
* Creation of content assist
* @param event
* @param viewer
* @param paletteRoot
*/
public void showComponentCreationOnCanvas(KeyEvent event, GraphicalViewer viewer, PaletteRoot paletteRoot) {
this.graphicViewer = viewer;
this.graphicControl = viewer.getControl();
this.triggerChar = event.character;
this.paletteRoot = paletteRoot;
Point cursorRelativePosition = calculatePosition();
if (cursorRelativePosition == null) {
return;
}
disposeAssistText();
createAssistText(cursorRelativePosition);
initializeListneres();
activateAssist(triggerChar);
}
示例3: refreshThePaletteBasedOnSearchString
import org.eclipse.gef.palette.PaletteRoot; //导入依赖的package包/类
private void refreshThePaletteBasedOnSearchString(final PaletteRoot paletteRoot,
final ELTGraphicalEditor editor, final Map<String, PaletteDrawer> categoryPaletteContainer,
final Text text, final List<Component> componentsConfig, final Composite container) {
text.addVerifyListener(new VerifyListener() {
@Override
public void verifyText(VerifyEvent e) {
boolean matchFound = false;
final List<Component> matchingComponents = new ArrayList<>();
paletteRoot.getChildren().clear();
String currentText = ((Text) e.widget).getText();
createPaletteContainers(paletteRoot, categoryPaletteContainer, editor);
String searchedString = (currentText.substring(0, e.start) + e.text + currentText.substring(e.end))
.toUpperCase();
if (StringUtils.isEmpty(searchedString)) {
showAllContainers(paletteRoot, editor, categoryPaletteContainer, componentsConfig);
} else {
showOpenPaletteContainers(paletteRoot.getChildren());
matchFound = checkSearchedComponentFoundInPalette(editor, categoryPaletteContainer, componentsConfig,
matchingComponents, searchedString);
showMessageWhenComponentNotFound(container, matchFound);
showMatchingContainers(paletteRoot, categoryPaletteContainer, matchingComponents);
}
}
});
}
示例4: showMatchingContainers
import org.eclipse.gef.palette.PaletteRoot; //导入依赖的package包/类
private void showMatchingContainers(PaletteRoot paletteRoot,
Map<String, PaletteDrawer> categoryPaletteContainer, List<Component> matchingComponents) {
List<PaletteContainer> children = paletteRoot.getChildren();
for (PaletteContainer paletteContainer : children) {
paletteContainer.setVisible(false);
}
for (Component component : matchingComponents) {
for (int i = 0; i < children.size(); i++) {
if (children.get(i).equals(categoryPaletteContainer.get(component.getCategory().name()))) {
children.get(i).setVisible(true);
}
}
}
}
示例5: createShapesDrawer
import org.eclipse.gef.palette.PaletteRoot; //导入依赖的package包/类
/**
* createShapesDrawer
*
* @return PaletteContainer
*/
private static PaletteRoot createShapesDrawer(DiagramType diagramType) {
switch (diagramType.getValue()) {
case DiagramType.CLASS_DIAGRAM_VALUE:
return classDiagramPaletteDrawer();
case DiagramType.USE_CASE_DIAGRAM_VALUE:
return useCaseDiagramPaletteDrawer();
case DiagramType.ACTIVITY_DIAGRAM_VALUE:
return activityDiagramPaletteDrawer();
case DiagramType.COMPONENT_DIAGRAM_VALUE:
return componentDiagramPaletteDrawer();
default:
return null;
}
}
示例6: createElements
import org.eclipse.gef.palette.PaletteRoot; //导入依赖的package包/类
public static PaletteDrawer createElements(PaletteRoot paletteRoot, List<String> ignore, PaletteGroup p,
Map<String, List<PaletteEntry>> map) {
PaletteDrawer drawer = createGroup(paletteRoot, ignore, p.getName(), p.getImage());
// drawer.add(createJDEntry(MCallout.getIconDescriptor(), MCallout.class));
drawer.add(createJDEntry(MTextField.getIconDescriptor(), MTextField.class));
drawer.add(createJDEntry(MStaticText.getIconDescriptor(), MStaticText.class));
drawer.add(createJDEntry(MImage.getIconDescriptor(), MImage.class));
drawer.add(createJDEntry(MBreak.getIconDescriptor(), MBreak.class));
drawer.add(createJDEntry(MRectangle.getIconDescriptor(), MRectangle.class));
drawer.add(createJDEntry(MEllipse.getIconDescriptor(), MEllipse.class));
drawer.add(createJDEntry(MLine.getIconDescriptor(), MLine.class));
// drawer.add(createJDEntry(MGenericElement.getIconDescriptor(), MGenericElement.class));
drawer.add(createJDEntry(MFrame.getIconDescriptor(), MFrame.class));
drawer.add(createJDEntry(MSubreport.getIconDescriptor(), MSubreport.class));
getEntries4Key(drawer, ignore, p.getId(), map);
return drawer;
}
示例7: createEditPart
import org.eclipse.gef.palette.PaletteRoot; //导入依赖的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;
}
示例8: getPaletteRoot
import org.eclipse.gef.palette.PaletteRoot; //导入依赖的package包/类
/**
* {@inheritDoc} In this method the {@link ORMGraphicalEditorPalette} of
* this editor is registered by the changeNotifier as well.
*/
@Override
protected PaletteRoot getPaletteRoot() {
ORMGraphicalEditorPalette tmp = new ORMGraphicalEditorPalette();
changeNotifier.register(tmp); // register the palette for editor changes
if (getEditorType() == EditorType.ROLES) { // if we show only roles
tmp.setRoleEntriesVisibility(true); // show only palette entries
// belonging to roles
} else {
// compartments
tmp.setRoleEntriesVisibility(false); // show only palette entries
// belonging to compartment
}
return tmp;
}
示例9: createPalette
import org.eclipse.gef.palette.PaletteRoot; //导入依赖的package包/类
/**
* Creates the palette and returns the palette
*
* @return the editor palette
*/
public static PaletteRoot createPalette( )
{
PaletteRoot root = BasePaletteFactory.createPalette( );
root.addAll( createCategories( ) );
root.add( createAutoTextDrawer( ) );
IExtension extension = new IExtension.Stub( ) {
public String getExtendsionIdentify( )
{
return GuiExtensionManager.PALETTE_MASTERPAGE;
}
};
GuiExtensionManager.doExtension( extension, root );
return root;
}
示例10: createPalette
import org.eclipse.gef.palette.PaletteRoot; //导入依赖的package包/类
/**
* Creates the palette and returns the palette
*
* @return the editor palette
*/
public static PaletteRoot createPalette( )
{
PaletteRoot root = BasePaletteFactory.createPalette( );
root.addAll( createCategories( ) );
IExtension extension = new IExtension.Stub( ) {
public String getExtendsionIdentify( )
{
return GuiExtensionManager.PALETTE_DESIGNER;
}
};
GuiExtensionManager.doExtension( extension, root );
root.add( createQuickTools( ) );
return root;
}
示例11: getAdapter
import org.eclipse.gef.palette.PaletteRoot; //导入依赖的package包/类
/**
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
public Object getAdapter( Class type )
{
if ( type == PalettePage.class )
{
if ( splitter == null )
{
page = createPalettePage( );
return page;
}
return createPalettePage( );
}
if ( type == PaletteRoot.class )
{
return getPaletteRoot( );
}
if ( type == ZoomManager.class )
{
return getGraphicalViewer( ).getProperty( ZoomManager.class.toString( ) );
}
return super.getAdapter( type );
}
示例12: getPaletteRoot
import org.eclipse.gef.palette.PaletteRoot; //导入依赖的package包/类
/**
* Returns the default <code>PaletteRoot</code> for this editor and all its pages.
*
* @return the default <code>PaletteRoot</code>
*/
public PaletteRoot getPaletteRoot() {
if (metadata == null) {
metadata = UrncoreFactory.eINSTANCE.createMetadata();
metadata.setName("Model Type"); //$NON-NLS-1$
metadata.setValue("Feature Model"); //$NON-NLS-1$
}
if (null == paletteRoot) {
boolean isFeatureModel = false;
for (int i = 0; i < parent.getModel().getMetadata().size(); i++)
{
Metadata m = (Metadata) parent.getModel().getMetadata().get(i);
if ((m.getName().equals("Model Type")) && (m.getValue().equals("Feature Model"))) {
isFeatureModel = true;
break;
}
System.out.println(m.getName() + " " + m.getValue());
}
if (isFeatureModel) {
paletteRoot = new FmdPaletteRoot(parent);
} else {
paletteRoot = new GrlPaletteRoot(parent);
}
}
return paletteRoot;
}
示例13: createPaletteRoot
import org.eclipse.gef.palette.PaletteRoot; //导入依赖的package包/类
/**
* @generated NOT
*/
protected PaletteRoot createPaletteRoot(PaletteRoot existingPaletteRoot) {
PaletteRoot root = createPaletteRootGen(existingPaletteRoot);
ModelRel modelRel = (ModelRel) this.getDiagram().getElement();
if (!modelRel.isInstancesLevel()) {
for (Object paletteContainer : root.getChildren()) {
for (Object paletteEntry : ((PaletteContainer) paletteContainer)
.getChildren()) {
if (paletteEntry instanceof ToolEntry
&& !(paletteEntry instanceof PanningSelectionToolEntry || paletteEntry instanceof PaletteToolEntry)) {
((ToolEntry) paletteEntry)
.setLabel(((ToolEntry) paletteEntry).getLabel() + " " + modelRel.getLevel().toString().charAt(0) + modelRel.getLevel().toString().toLowerCase().substring(1));
((ToolEntry) paletteEntry)
.setDescription(((ToolEntry) paletteEntry)
.getDescription() + " " + modelRel.getLevel().toString().charAt(0) + modelRel.getLevel().toString().toLowerCase().substring(1));
}
}
}
}
return root;
}
示例14: getPaletteRoot
import org.eclipse.gef.palette.PaletteRoot; //导入依赖的package包/类
@Override
protected PaletteRoot getPaletteRoot() {
PaletteRoot root = new PaletteRoot();
PaletteDrawer manipGroup = new PaletteDrawer("Definitions");
manipGroup.add(new CreationToolEntry("Add Computing Platform", "Add Computing Platform Definition", new LogicalComputingPlatformCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Computing Node", "Add Computing Node Definition", new LogicalComputingCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Logical Processor", "Add Logical Processor Definition", new LogicalProcessorsCreationFactory(), null, null));
root.add(manipGroup);
return root;
}
示例15: getPaletteRoot
import org.eclipse.gef.palette.PaletteRoot; //导入依赖的package包/类
@Override
protected PaletteRoot getPaletteRoot() {
PaletteRoot root = new PaletteRoot();
PaletteDrawer manipGroup = new PaletteDrawer("Definitions");
manipGroup.add(new CreationToolEntry("Add Composite Property", "Add Composite Property", new CompositePropertyNodeCreationFactory(), null, null));
root.add(manipGroup);
return root;
}