1 11 package org.eclipse.debug.internal.ui.views.variables; 12 13 import org.eclipse.debug.core.DebugPlugin; 14 import org.eclipse.debug.core.ILogicalStructureType; 15 import org.eclipse.debug.core.model.IValue; 16 import org.eclipse.jface.action.Action; 17 import org.eclipse.jface.action.IAction; 18 import org.eclipse.swt.custom.BusyIndicator; 19 20 24 public class SelectLogicalStructureAction extends Action { 25 26 private VariablesView fView; 27 private ILogicalStructureType fType; 28 private ILogicalStructureType[] fAvailableTypes; 29 30 38 public SelectLogicalStructureAction(VariablesView view, ILogicalStructureType type, IValue value, ILogicalStructureType[] availableTypes) { 39 super(type.getDescription(value), IAction.AS_CHECK_BOX); 40 setView(view); 41 fAvailableTypes= availableTypes; 42 fType= type; 43 } 44 45 48 public void run() { 49 valueChanged(); 50 } 51 52 private void valueChanged() { 53 if (!getView().isAvailable()) { 54 return; 55 } 56 BusyIndicator.showWhile(getView().getViewer().getControl().getDisplay(), new Runnable () { 57 public void run() { 58 ILogicalStructureType type= null; 61 if (isChecked()) { 62 type= fType; 63 } 64 DebugPlugin.setDefaultStructureType(fAvailableTypes, type); 65 getView().getViewer().refresh(); 66 } 67 }); 68 } 69 70 protected VariablesView getView() { 71 return fView; 72 } 73 74 protected void setView(VariablesView view) { 75 fView = view; 76 } 77 } 78 | Popular Tags |