select all works now

This commit is contained in:
bancika
2011-01-11 18:47:40 +00:00
parent cb72d596a3
commit e9936e4adb
3 changed files with 18 additions and 0 deletions
@@ -168,6 +168,13 @@ public interface IPlugInPort {
*/
ComponentSelection getSelectedComponents();
/**
* Changes component selection.
*
* @param selection
*/
void setSelectedComponents(ComponentSelection selection);
/**
* Returns the {@link Area} occupied by the component.
*
@@ -187,6 +187,8 @@ public class ClipboardManager implements IPlugIn, ClipboardOwner {
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("Select All triggered");
plugInPort.setSelectedComponents(new ComponentSelection(plugInPort.getCurrentProject()
.getComponents()));
}
}
@@ -453,6 +453,15 @@ public class Presenter implements IPlugInPort {
return new ComponentSelection(selectedComponents);
}
@Override
public void setSelectedComponents(ComponentSelection selection) {
this.selectedComponents = new ComponentSelection(selection);
messageDispatcher.dispatchMessage(EventType.SELECTION_CHANGED, selectedComponents);
messageDispatcher.dispatchMessage(EventType.SELECTION_SIZE_CHANGED,
calculateSelectionDimension());
messageDispatcher.dispatchMessage(EventType.REPAINT);
}
@Override
public Area getComponentArea(IDIYComponent<?> component) {
return componentAreaMap.get(component);