use of org.eclipse.gef.palette.PaletteEntry in project tdi-studio-se by Talend.
the class TalendEntryEditPart method getChildLevel.
protected int getChildLevel() {
PaletteEntry entry = (PaletteEntry) getModel();
int i = 0;
while ((entry = entry.getParent()) != null) {
++i;
}
return i;
}
use of org.eclipse.gef.palette.PaletteEntry in project archi by archimatetool.
the class CanvasEditorPalette method createElementsGroup.
private PaletteContainer createElementsGroup() {
PaletteContainer group = new PaletteGroup(Messages.CanvasEditorPalette_1);
add(group);
PaletteEntry entry = new CombinedTemplateCreationEntry(Messages.CanvasEditorPalette_2, null, new CanvasModelFactory(ICanvasPackage.eINSTANCE.getCanvasModelBlock()), ICanvasImages.ImageFactory.getImageDescriptor(ICanvasImages.ICON_CANVAS_BLOCK), ICanvasImages.ImageFactory.getImageDescriptor(ICanvasImages.ICON_CANVAS_BLOCK));
group.add(entry);
entry = new CombinedTemplateCreationEntry(Messages.CanvasEditorPalette_3, null, new CanvasModelFactory(ICanvasPackage.eINSTANCE.getCanvasModelImage()), IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_LANDSCAPE), IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_LANDSCAPE));
group.add(entry);
entry = createConnectionCreationToolEntry(ICanvasPackage.eINSTANCE.getCanvasModelConnection(), IDiagramModelConnection.LINE_SOLID, Messages.CanvasEditorPalette_4, null, IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_CONNECTION_PLAIN));
group.add(entry);
entry = createConnectionCreationToolEntry(ICanvasPackage.eINSTANCE.getCanvasModelConnection(), IDiagramModelConnection.ARROW_FILL_TARGET, Messages.CanvasEditorPalette_5, null, IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_CONNECTION_ARROW));
group.add(entry);
entry = createConnectionCreationToolEntry(ICanvasPackage.eINSTANCE.getCanvasModelConnection(), IDiagramModelConnection.ARROW_FILL_TARGET | IDiagramModelConnection.LINE_DASHED, Messages.CanvasEditorPalette_6, null, IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_CONNECTION_DASHED_ARROW));
group.add(entry);
entry = createConnectionCreationToolEntry(ICanvasPackage.eINSTANCE.getCanvasModelConnection(), IDiagramModelConnection.ARROW_FILL_TARGET | IDiagramModelConnection.LINE_DOTTED, Messages.CanvasEditorPalette_7, null, IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_CONNECTION_DOTTED_ARROW));
group.add(entry);
return group;
}
use of org.eclipse.gef.palette.PaletteEntry in project archi by archimatetool.
the class SketchEditorPalette method createElementsGroup.
private PaletteContainer createElementsGroup() {
PaletteContainer group = new PaletteGroup(Messages.SketchEditorPalette_1);
add(group);
// Actor
PaletteEntry groupEntry = createCombinedTemplateCreationEntry(IArchimatePackage.eINSTANCE.getSketchModelActor(), Messages.SketchEditorPalette_2, Messages.SketchEditorPalette_3);
group.add(groupEntry);
// Group
groupEntry = createCombinedTemplateCreationEntry(IArchimatePackage.eINSTANCE.getDiagramModelGroup(), Messages.SketchEditorPalette_4, Messages.SketchEditorPalette_5);
group.add(groupEntry);
return group;
}
use of org.eclipse.gef.palette.PaletteEntry in project archi by archimatetool.
the class ArchimateDiagramEditorPalette method setViewpoint.
/**
* Update the Palette depending on the Viewpoint
* @param viewpoint
*/
public void setViewpoint(IViewpoint viewpoint) {
fViewpoint = viewpoint;
// Remove 'em all
for (PaletteEntry entry : fEntries) {
remove(entry);
}
// Re-Create Archimate Relations Group
createArchimateRelationsGroup();
// Re-Create Archimate Groups
createArchimateElementGroups();
}
use of org.eclipse.gef.palette.PaletteEntry in project liferay-ide by liferay.
the class SnippetsUtil method importSnippetsFromFile.
@SuppressWarnings("rawtypes")
public static void importSnippetsFromFile(File snippetFile) throws FileNotFoundException {
if ((snippetFile == null) || !snippetFile.exists() || !snippetFile.isFile()) {
return;
}
// InputStream stream = Files.newInputStream(snippetFile.toPath());
SnippetDefinitions definitions = ModelFactoryForUser.getInstance().load(snippetFile.getAbsolutePath());
List importCategories = definitions.getCategories();
SnippetManager manager = SnippetManager.getInstance();
List currentCategories = manager.getDefinitions().getCategories();
Display.getDefault().asyncExec(new Runnable() {
public void run() {
for (int i = 0; i < importCategories.size(); i++) {
boolean found = false;
for (int j = 0; j < currentCategories.size(); j++) {
if (((PaletteEntry) currentCategories.get(j)).getId().compareToIgnoreCase(((PaletteEntry) importCategories.get(i)).getId()) == 0) {
found = true;
break;
}
}
if (!found) {
SnippetManager manager = SnippetManager.getInstance();
manager.getPaletteRoot().add((PaletteEntry) importCategories.get(i));
}
}
}
});
// IViewPart view = findSnippetsView();
// if (view != null) {
// SnippetsView snippetsView = (SnippetsView) view;
// snippetsView.getViewer().getContents().refresh();
// }
}
Aggregations