List selection = getSelection();
if (selection != null) {
PatternBase pb = (PatternBase)getContext().getValue(de.FeatureModellingTool.Pattern.ConstantDefinition.PATTERN_BASE);
Component container = (Component)getContext().getValue("CONTAINER");
PatternSelection patternSelection = new PatternSelection(pb);
int result = JOptionPane.showConfirmDialog(container , patternSelection, "��ѡ����Ҫ���õ�ģʽ"
,JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);
if (result == JOptionPane.OK_OPTION && patternSelection.template!=null) {
Hashtable<String , Integer> htCount = patternSelection.getCloneCount();
Feature root = (Feature)patternSelection.template.getFeatureModel().getAllFeature().values().iterator().next();
root = patternSelection.template.getFeatureModel().getRootFeature(root.getID());
for (int i = 0; i < selection.size(); i++) {