[Pydev-cvs] org.python.pydev.refactoring/src/org/python/pydev/refactoring/ui/model OffsetStrategyM
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-09-27 20:02:13
|
Update of /cvsroot/pydev/org.python.pydev.refactoring/src/org/python/pydev/refactoring/ui/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21605/src/org/python/pydev/refactoring/ui/model Modified Files: OffsetStrategyModel.java OffsetStrategyProvider.java Log Message: Synching to latest changes: Pydev <ul> <li><strong>Editor</strong>: Cursor settings no longer overridden</li> <li><strong>Code-completion</strong>: If __all__ is defined with runtime elements (and not only in a single assign statement), it's ignored for code-completion purposes</li> <li><strong>Debugger</strong>: Pythonpath the same in debug and regular modes (sys.path[0] is the same directory as the file run)</li> <li><strong>Debugger</strong>: Persist choices done in the debugger when files from the debugger are not found</li> <li><strong>Interpreter config</strong>: "email" automatically added to the "forced builtins"</li> <li><strong>Parser</strong>: Correctly recognizing absolute import with 3 or more levels</li> <li><strong>Syntax check</strong>: Option to do only on active editor</li> </ul> Also: tabs changed for spaces Index: OffsetStrategyModel.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.refactoring/src/org/python/pydev/refactoring/ui/model/OffsetStrategyModel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OffsetStrategyModel.java 20 Oct 2007 19:31:04 -0000 1.2 --- OffsetStrategyModel.java 27 Sep 2008 20:00:44 -0000 1.3 *************** *** 12,32 **** public class OffsetStrategyModel extends StructuredSelection { ! private int key; ! private String description; ! public OffsetStrategyModel(int key, String description) { ! this.key = key; ! this.description = description; ! } ! @Override ! public String toString() { ! return description; ! } ! public int getStrategy() { ! return key; ! } } --- 12,32 ---- public class OffsetStrategyModel extends StructuredSelection { ! private int key; ! private String description; ! public OffsetStrategyModel(int key, String description) { ! this.key = key; ! this.description = description; ! } ! @Override ! public String toString() { ! return description; ! } ! public int getStrategy() { ! return key; ! } } Index: OffsetStrategyProvider.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.refactoring/src/org/python/pydev/refactoring/ui/model/OffsetStrategyProvider.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OffsetStrategyProvider.java 20 Oct 2007 19:31:04 -0000 1.3 --- OffsetStrategyProvider.java 27 Sep 2008 20:00:44 -0000 1.4 *************** *** 20,91 **** public class OffsetStrategyProvider implements IStructuredContentProvider { ! private List<OffsetStrategyModel> strategies; ! private String initLabel; ! private String beginLabel; ! private String endLabel; ! public OffsetStrategyProvider(int strategyOption) { ! strategies = new ArrayList<OffsetStrategyModel>(); ! initLabel(); ! initStrategies(strategyOption); ! } ! public OffsetStrategyProvider(AbstractScopeNode<?> scopeAdapter, int strategyOption) { ! strategies = new ArrayList<OffsetStrategyModel>(); ! strategyOption = updateLabel(scopeAdapter, strategyOption); ! initStrategies(strategyOption); ! } ! private void initLabel() { ! initLabel = Messages.offsetStrategyAfterInit; ! beginLabel = Messages.offsetStrategyBegin; ! endLabel = Messages.offsetStrategyEnd; ! } ! private int updateLabel(AbstractScopeNode<?> scopeAdapter, int strategyOption) { ! if (scopeAdapter != null) { ! if (scopeAdapter.getNodeBodyIndent() == 0) { ! beginLabel = Messages.offsetStrategyBeginModule; ! endLabel = Messages.offsetStrategyEndModule; ! if ((strategyOption & IOffsetStrategy.AFTERINIT) == IOffsetStrategy.AFTERINIT) { ! strategyOption &= ~IOffsetStrategy.AFTERINIT; ! } ! } else ! initLabel(); ! } ! return strategyOption; ! } ! private void initStrategies(int strategyOption) { ! setStrategy(strategyOption, IOffsetStrategy.AFTERINIT, initLabel); ! setStrategy(strategyOption, IOffsetStrategy.BEGIN, beginLabel); ! setStrategy(strategyOption, IOffsetStrategy.END, endLabel); ! } ! private void setStrategy(int strategyOption, int id, String label) { ! if ((strategyOption & id) == id) { ! strategies.add(new OffsetStrategyModel(id, label)); ! } ! } ! public OffsetStrategyModel get(int i) { ! return this.strategies.get(i); ! } ! public Object[] getElements(Object inputElement) { ! return strategies.toArray(); ! } ! public void dispose() { ! this.strategies = null; ! } ! public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { ! } } --- 20,91 ---- public class OffsetStrategyProvider implements IStructuredContentProvider { ! private List<OffsetStrategyModel> strategies; ! private String initLabel; ! private String beginLabel; ! private String endLabel; ! public OffsetStrategyProvider(int strategyOption) { ! strategies = new ArrayList<OffsetStrategyModel>(); ! initLabel(); ! initStrategies(strategyOption); ! } ! public OffsetStrategyProvider(AbstractScopeNode<?> scopeAdapter, int strategyOption) { ! strategies = new ArrayList<OffsetStrategyModel>(); ! strategyOption = updateLabel(scopeAdapter, strategyOption); ! initStrategies(strategyOption); ! } ! private void initLabel() { ! initLabel = Messages.offsetStrategyAfterInit; ! beginLabel = Messages.offsetStrategyBegin; ! endLabel = Messages.offsetStrategyEnd; ! } ! private int updateLabel(AbstractScopeNode<?> scopeAdapter, int strategyOption) { ! if (scopeAdapter != null) { ! if (scopeAdapter.getNodeBodyIndent() == 0) { ! beginLabel = Messages.offsetStrategyBeginModule; ! endLabel = Messages.offsetStrategyEndModule; ! if ((strategyOption & IOffsetStrategy.AFTERINIT) == IOffsetStrategy.AFTERINIT) { ! strategyOption &= ~IOffsetStrategy.AFTERINIT; ! } ! } else ! initLabel(); ! } ! return strategyOption; ! } ! private void initStrategies(int strategyOption) { ! setStrategy(strategyOption, IOffsetStrategy.AFTERINIT, initLabel); ! setStrategy(strategyOption, IOffsetStrategy.BEGIN, beginLabel); ! setStrategy(strategyOption, IOffsetStrategy.END, endLabel); ! } ! private void setStrategy(int strategyOption, int id, String label) { ! if ((strategyOption & id) == id) { ! strategies.add(new OffsetStrategyModel(id, label)); ! } ! } ! public OffsetStrategyModel get(int i) { ! return this.strategies.get(i); ! } ! public Object[] getElements(Object inputElement) { ! return strategies.toArray(); ! } ! public void dispose() { ! this.strategies = null; ! } ! public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { ! } } |