Пример #1
0
 private int getPolicy() {
   final IWorkbenchPart part = getPart();
   if (part == null) return 0;
   final TCFNode node = getRootNode(part);
   if (node == null) return 0;
   return new TCFTask<Integer>(node.getChannel()) {
     public void run() {
       TCFModel model = node.getModel();
       if (!model.isLocked(part)) done(TCFModel.UPDATE_POLICY_AUTOMATIC);
       else done(model.getLockPolicy(part));
     }
   }.getE();
 }
Пример #2
0
 private void setPolicy(final int n) {
   final IWorkbenchPart part = getPart();
   if (part == null) return;
   final TCFNode node = getRootNode(part);
   if (node == null) return;
   new TCFTask<Object>(node.getChannel()) {
     public void run() {
       TCFModel model = node.getModel();
       model.setLockPolicy(part, n);
       done(null);
     }
   }.getE();
 }