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


Java SelectionEditPolicy类代码示例

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


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

示例1: createEditPolicies

import org.eclipse.gef.editpolicies.SelectionEditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies() {
	super.createEditPolicies();

	installEditPolicy(EditPolicy.CONNECTION_ROLE, new DwParentChildConnectionEditPolicy());
	installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DwFeatureGraphicalNodeEditPolicy(editor, model));
	installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new DwParentChildConnectionEndpointEditPolicy());
	installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionEditPolicy(){
		DEGraphicalEditorTheme theme = DEGraphicalEditor.getTheme();

		@Override
		protected void hideSelection() {
			((DwParentChildConnectionFigure)getFigure()).setColor(theme.getLineColor());
			getFigure().repaint();
		}

		@Override
		protected void showSelection() {
			((DwParentChildConnectionFigure)getFigure()).setColor(theme.getSelectionSecondaryColor());
			getFigure().repaint();
		}
	});
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:24,代码来源:DwParentChildConnectionEditorEditPart.java

示例2: createEditPolicies

import org.eclipse.gef.editpolicies.SelectionEditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies() {
	installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy() {
		@Override
		protected Command createDeleteCommand(GroupRequest deleteRequest) {
			return new DeleteCommand(getModel());
		}
	});

	installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new TableNodeEditPolicy());
	installEditPolicy(EditPolicy.LAYOUT_ROLE, new TableLayoutEditPolicy());
	installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionEditPolicy() {

		@Override
		protected void hideSelection() {
			getFigure().hideSelectedBorder();
		}

		@Override
		protected void showSelection() {
			getFigure().showSelectedBorder();
		}
	});
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:25,代码来源:TableEditPart.java

示例3: createEditPolicies

import org.eclipse.gef.editpolicies.SelectionEditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies() {
	installEditPolicy(EditPolicy.LAYOUT_ROLE, new ItemDragPolicy());
	installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE,
	        new SelectionEditPolicy() {
		        @Override
		        protected void showSelection() {
		        	sync.syncExec(new Runnable() {							
						@Override
						public void run() {
							((ItemFigure) getHostFigure()).changeColor(true);
						}
					});
		        }

		        @Override
		        protected void hideSelection() {
		        	sync.syncExec(new Runnable() {							
		        		@Override
		        		public void run() {
		        			((ItemFigure) getHostFigure()).changeColor(false);
		        		}
		        	});
		        }
	        });
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:27,代码来源:ItemEditPart.java

示例4: createEditPolicies

import org.eclipse.gef.editpolicies.SelectionEditPolicy; //导入依赖的package包/类
protected void createEditPolicies() {
		installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionEditPolicy() {
			protected void hideSelection() {
//				System.out.println("hide branch");
			}

			protected void showSelection() {
//				System.out.println("show branch");
			}			
		});
	}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:12,代码来源:BranchEditPart.java

示例5: createEditPolicies

import org.eclipse.gef.editpolicies.SelectionEditPolicy; //导入依赖的package包/类
protected void createEditPolicies() {
		installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionEditPolicy() {
			protected void hideSelection() {
//				System.out.println("hide path");
			}

			protected void showSelection() {
//				System.out.println("show path");
			}			
		});
	}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:12,代码来源:PathEditPart.java

示例6: createEditPolicies

import org.eclipse.gef.editpolicies.SelectionEditPolicy; //导入依赖的package包/类
protected void createEditPolicies() {
	installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionEditPolicy() {
		protected void hideSelection() {
			refreshVisuals();
		}
		protected void showSelection() {
			refreshVisuals();				
		}
	});
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:11,代码来源:RevisionEditPart.java

示例7: createEditPolicies

import org.eclipse.gef.editpolicies.SelectionEditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies()
{
    super.createEditPolicies();
    installEditPolicy("ShowDropdown", new SelectionEditPolicy() { //$NON-NLS-1$
        @Override
        protected void hideSelection()
        {
            setShowDropdown(false);
        }

        @Override
        protected void showSelection()
        {
            setShowDropdown(false);
        }

        @Override
        protected void showPrimarySelection()
        {
            setShowDropdown(true);
        }

        private void setShowDropdown(boolean flag)
        {
            IFigure figure = getFigure();
            if(figure instanceof ComboboxFigure) {
                ((ComboboxFigure)figure).setShowDropdown(flag);
            }
        }
    });
}
 
开发者ID:henrikor2,项目名称:eclipsensis,代码行数:33,代码来源:InstallOptionsComboboxEditPart.java


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