1 19 package org.netbeans.modules.xml.refactoring.ui.j.api; 20 21 import java.util.AbstractCollection ; 22 import java.util.Collection ; 23 import java.util.Iterator ; 24 import java.util.LinkedList ; 25 import java.util.NoSuchElementException ; 26 27 36 37 41 public final class RefactoringSession { 42 private final LinkedList internalList; 44 private final Collection refactoringElements; 46 private final String description; 47 49 private RefactoringSession(String description) { 50 internalList = new LinkedList (); 51 this.description = description; 53 this.refactoringElements = new ElementsCollection(); 54 } 55 56 58 public static RefactoringSession create(String description) { 59 return new RefactoringSession(description); 60 } 61 62 public Problem doRefactoring(boolean saveAfterDone) { 63 return null; 91 } 92 93 public Collection getRefactoringElements() { 94 return refactoringElements; 95 } 96 97 public synchronized void addProgressListener(ProgressListener listener) { 98 } 103 104 public synchronized void removeProgressListener(ProgressListener listener) { 105 } 109 110 114 private void fireProgressListenerStart(int type, int count) { 115 } 119 120 private void fireProgressListenerStep() { 121 } 125 126 private void fireProgressListenerStop() { 127 } 131 132 private class ElementsCollection extends AbstractCollection { 133 public Iterator iterator() { 134 return new Iterator () { 135 private final Iterator inner = internalList.iterator(); 136 137 public void remove() { 138 throw new UnsupportedOperationException (); 139 } 140 141 public Object next() throws NoSuchElementException { 142 return null; 144 } 145 146 public boolean hasNext() { 147 return inner.hasNext(); 148 } 149 }; 150 } 151 152 public int size() { 153 return internalList.size(); 154 } 155 } 156 } 157 | Popular Tags |