当前位置: 首页>>代码示例>>Java>>正文


Java PaletteViewer类代码示例

本文整理汇总了Java中org.eclipse.gef.ui.palette.PaletteViewer的典型用法代码示例。如果您正苦于以下问题:Java PaletteViewer类的具体用法?Java PaletteViewer怎么用?Java PaletteViewer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PaletteViewer类属于org.eclipse.gef.ui.palette包,在下文中一共展示了PaletteViewer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createPaletteViewerProvider

import org.eclipse.gef.ui.palette.PaletteViewer; //导入依赖的package包/类
@Override
protected PaletteViewerProvider createPaletteViewerProvider() {
	final ELTGraphicalEditor editor = this;
	return new PaletteViewerProvider(getEditDomain()) {

		@Override
		protected void configurePaletteViewer(final PaletteViewer viewer) {
			super.configurePaletteViewer(viewer);
			
			paletteEditPartFactory = new CustomPaletteEditPartFactory(palatteTextColor,viewer.getControl().getBackground());
			viewer.setEditPartFactory(paletteEditPartFactory);
			
			
			// create a drag source listener for this palette viewer
			// together with an appropriate transfer drop target listener,
			// this will enable
			// model element creation by dragging a
			// CombinatedTemplateCreationEntries
			// from the palette into the editor
			// @see ShapesEditor#createTransferDropTargetListener()

			viewer.addDragSourceListener(new TemplateTransferDragSourceListener(viewer));
			PaletteContainerListener paletteContainerListener = new PaletteContainerListener(viewer, getGraphicalViewer());
			viewer.getControl().addMouseListener(paletteContainerListener);
			viewer.getControl().addMouseTrackListener(paletteContainerListener);
			viewer.getControl().addMouseMoveListener(paletteContainerListener);
			setDefaultToolUndoRedoStatus();
		}

		@Override
		public PaletteViewer createPaletteViewer(Composite parent) {
			CustomPaletteViewer pViewer = new CustomPaletteViewer();
			CustomFigureCanvas figureCanvas=new CustomFigureCanvas(parent,pViewer.getLightweightSys(),pViewer, getPalettesRoot(),editor);
			pViewer.setFigureCanvas(figureCanvas);
			configurePaletteViewer(pViewer);
			hookPaletteViewer(pViewer);
			return pViewer;
		}
	};
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:41,代码来源:ELTGraphicalEditor.java

示例2: createPaletteViewerProvider

import org.eclipse.gef.ui.palette.PaletteViewer; //导入依赖的package包/类
protected PaletteViewerProvider createPaletteViewerProvider() {
	PaletteViewerProvider paletteViewerProvider = new PaletteViewerProvider(getEditDomain()) {
		public PaletteViewer createPaletteViewer(Composite parent) {
			PaletteViewer paletteViewer = super.createPaletteViewer(parent);
			paletteViewer.getPaletteViewerPreferences().setUseLargeIcons(PaletteViewerPreferences.LAYOUT_LIST, !PALETTE_USE_ICON16);
			return paletteViewer;
		}

		protected void configurePaletteViewer(PaletteViewer viewer) {
			super.configurePaletteViewer(viewer);
			viewer.addDragSourceListener(new TemplateTransferDragSourceListener(viewer));
		}
	};
	return paletteViewerProvider;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:16,代码来源:DbToolGefEditor.java

示例3: createPaletteViewerProvider

import org.eclipse.gef.ui.palette.PaletteViewer; //导入依赖的package包/类
protected PaletteViewerProvider createPaletteViewerProvider() {
	return new PaletteViewerProvider(getEditDomain()) {
		protected void configurePaletteViewer(PaletteViewer viewer) {
			super.configurePaletteViewer(viewer);
			viewer.addDragSourceListener(new TemplateTransferDragSourceListener(
					viewer));
		}

	};
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:11,代码来源:GUIEditor.java

示例4: createPaletteViewer

import org.eclipse.gef.ui.palette.PaletteViewer; //导入依赖的package包/类
@Override
public PaletteViewer createPaletteViewer(Composite parent) {
  PaletteTreeViewer pViewer = new PaletteTreeViewer();
  pViewer.createTreeControl(parent);
  configurePaletteViewer(pViewer);
  hookPaletteViewer(pViewer);
  return pViewer;
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:9,代码来源:PaletteTreeViewerProvider.java

示例5: handlePaletteToolChanged

import org.eclipse.gef.ui.palette.PaletteViewer; //导入依赖的package包/类
private void handlePaletteToolChanged() {
	PaletteViewer paletteViewer = getPaletteViewer();
	if (paletteViewer != null) {
		ToolEntry entry = paletteViewer.getActiveTool();
		if (entry != null)
			setActiveTool(entry.createTool());
		else
			setActiveTool(getDefaultTool());
	}
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:11,代码来源:EditDomain.java

示例6: loadDefaultTool

import org.eclipse.gef.ui.palette.PaletteViewer; //导入依赖的package包/类
/**
 * Loads the default Tool. If a palette has been provided and that palette
 * has a default, then that tool is loaded. If not, the EditDomain's default
 * tool is loaded. By default, this is the
 * {@link org.eclipse.gef.tools.SelectionTool}.
 */
public void loadDefaultTool() {
	setActiveTool(null);
	PaletteViewer paletteViewer = getPaletteViewer();
	if (paletteRoot != null && paletteViewer != null) {
		if (paletteRoot.getDefaultEntry() != null) {
			paletteViewer.setActiveTool(paletteRoot.getDefaultEntry());
			return;
		} else
			paletteViewer.setActiveTool(null);
	}
	setActiveTool(getDefaultTool());
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:19,代码来源:EditDomain.java

示例7: setPaletteViewer

import org.eclipse.gef.ui.palette.PaletteViewer; //导入依赖的package包/类
/**
 * Sets the <code>PaletteViewer</code> for this EditDomain
 * 
 * @param palette
 *            the PaletteViewer
 */
public void setPaletteViewer(PaletteViewer palette) {
	if (palette == paletteViewer)
		return;
	if (paletteViewer != null)
		paletteViewer.removePaletteListener(paletteListener);
	paletteViewer = palette;
	if (paletteViewer != null) {
		palette.addPaletteListener(paletteListener);
		if (paletteRoot != null) {
			paletteViewer.setPaletteRoot(paletteRoot);
			loadDefaultTool();
		}
	}
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:21,代码来源:EditDomain.java

示例8: createPaletteViewer

import org.eclipse.gef.ui.palette.PaletteViewer; //导入依赖的package包/类
/**
 * Creates the palette on the given composite.
 * 
 * @param parent
 *            the composite
 */
protected void createPaletteViewer(Composite parent) {
	PaletteViewer viewer = new PaletteViewer();
	setPaletteViewer(viewer);
	viewer.createControl(parent);
	configurePaletteViewer();
	hookPaletteViewer();
	initializePaletteViewer();
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:15,代码来源:GraphicalEditorWithPalette.java

示例9: activeToolChanged

import org.eclipse.gef.ui.palette.PaletteViewer; //导入依赖的package包/类
public void activeToolChanged(PaletteViewer palette, ToolEntry tool) {
	if (getStack().getChildren().contains(tool)) {
		if (!arrowFigure.getModel().isSelected())
			arrowFigure.getModel().setSelected(true);
		if (!getStack().getActiveEntry().equals(tool))
			getStack().setActiveEntry(tool);
	} else
		arrowFigure.getModel().setSelected(false);
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:10,代码来源:PaletteStackEditPart.java

示例10: activeToolChanged

import org.eclipse.gef.ui.palette.PaletteViewer; //导入依赖的package包/类
public void activeToolChanged(PaletteViewer palette, ToolEntry tool) {
	if (!getStackFigure().isPinnedOpen()
			&& getStack().getChildren().contains(tool)) {
		if (!getStack().getActiveEntry().equals(tool)) {
			getStack().setActiveEntry(tool);
		}
	}
	if (!getStackFigure().isPinnedOpen()) {
		getStackFigure().setExpanded(false);
	}
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:12,代码来源:PinnablePaletteStackEditPart.java

示例11: registerVisuals

import org.eclipse.gef.ui.palette.PaletteViewer; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#registerVisuals()
 */
@SuppressWarnings("unchecked")
protected void registerVisuals() {
	super.registerVisuals();
	controller = new PaletteAnimator(
			((PaletteViewer) getViewer()).getPaletteViewerPreferences());
	getViewer().getEditPartRegistry().put(PaletteAnimator.class, controller);
	ToolbarLayout layout = new PaletteToolbarLayout();
	getFigure().setLayoutManager(layout);
	getFigure().addLayoutListener(controller);
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:14,代码来源:SliderPaletteEditPart.java

示例12: findThePaletteTool

import org.eclipse.gef.ui.palette.PaletteViewer; //导入依赖的package包/类
private Tool findThePaletteTool(final EditPartViewer theEditPartViewer, final String toolPath) {
	final EditDomain theDomain = theEditPartViewer.getEditDomain();
	final PaletteViewer thePaletteViewer = theDomain.getPaletteViewer();
	final ToolEntry toolEntry = findByLabel(thePaletteViewer.getPaletteRoot(), toolPath);
	thePaletteViewer.setActiveTool(toolEntry);

	final Tool theTool = toolEntry.createTool();
	theTool.setViewer(theEditPartViewer);
	theTool.setEditDomain(theDomain);

	return theTool;
}
 
开发者ID:timezra,项目名称:UML-Testing-Tool,代码行数:13,代码来源:ClassDiagramPaletteTest.java

示例13: createPaletteViewer

import org.eclipse.gef.ui.palette.PaletteViewer; //导入依赖的package包/类
/**
 * Creates a PaletteViewer on the given Composite
 * 
 * @param parent
 *            the control for the PaletteViewer
 * @return the newly created PaletteViewer
 */
public PaletteViewer createPaletteViewer(Composite parent) {
  PaletteViewer pViewer = new PaletteViewer();
  pViewer.enableVerticalScrollbar(true);
  pViewer.createControl(parent);
  configurePaletteViewer(pViewer);
  hookPaletteViewer(pViewer);
  return pViewer;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:16,代码来源:ORMPaletteViewerProvider.java

示例14: findThePaletteTool

import org.eclipse.gef.ui.palette.PaletteViewer; //导入依赖的package包/类
public static Tool findThePaletteTool(final EditPart theEditPart, final String toolPath) {
    final EditPartViewer theEditPartViewer = theEditPart.getViewer();
    final PaletteViewer thePaletteViewer = theEditPartViewer.getEditDomain().getPaletteViewer();
    final ToolEntry toolEntry = findByLabel(thePaletteViewer.getPaletteRoot(), toolPath);
    thePaletteViewer.setActiveTool(toolEntry);

    final Tool theTool = toolEntry.createTool();
    theTool.setViewer(theEditPartViewer);
    theTool.setEditDomain(theEditPartViewer.getEditDomain());

    return theTool;
}
 
开发者ID:info-sharing-environment,项目名称:NIEM-Modeling-Tool,代码行数:13,代码来源:PapyrusUtils.java

示例15: selectTool

import org.eclipse.gef.ui.palette.PaletteViewer; //导入依赖的package包/类
public static void selectTool(IWorkbenchPart part, String tool) {
    if (part instanceof UCMNavMultiPageEditor) {
        UCMNavMultiPageEditor nav = (UCMNavMultiPageEditor) part;

        if (nav.getCurrentPage() != null) {
            PaletteViewer viewer = nav.getCurrentPage().getEditDomain().getPaletteViewer();
            if (viewer != null) {
                PaletteRoot root = viewer.getPaletteRoot();
                if (root != null && root instanceof UcmPaletteRoot) {
                    viewer.setActiveTool(((UcmPaletteRoot) root).getAssociatedTool(tool));
                }
            }
        }
    }
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:16,代码来源:SelectPaletteEntryAction.java


注:本文中的org.eclipse.gef.ui.palette.PaletteViewer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。