@Override
	public void execute(CharSequence str) {
		HasSubSection selectedItem = editor.getSelectedItem();
		
		if(selectedItem instanceof Section) {
			Section section = (Section) selectedItem;
			HasSubSection parent = section.getParent();
			int index = 0;
			while(!parent.getSubSection(index).equals(section)) ++index;
			
			//insert the sections if there is a preceding section
			if(index !=0) {
				parent.removeSubSection(index);
				ArrayList<Section> sectionsToAdd = new ArrayList<Section>(section.getSubSectionNb() +1);
				
				for(int i = 0 ; i < section.getSubSectionNb() ; ++i) {
					sectionsToAdd.add(section.getSubSection(0));
					section.removeSubSection(0);
				}
				sectionsToAdd.add(0, section);
				
				for(int i = 0 ; i < sectionsToAdd.size() ; ++i) {
					parent.getSubSection(index -1).addSubSection(sectionsToAdd.get(i));
				}
				
			}
		}
	}