CompilationUnit astRoot= SharedASTProvider.getAST(type.getCompilationUnit(), SharedASTProvider.WAIT_YES, new NullProgressMonitor()); AddDelegateMethodsContentProvider provider= new AddDelegateMethodsContentProvider(astRoot, type, fields); SourceActionDialog dialog= new AddDelegateMethodsDialog(getShell(), new AddDelegateMethodsLabelProvider(), provider, fEditor, type, false); dialog.setValidator(new AddDelegateMethodsActionStatusValidator(provider.getCount())); AddDelegateMethodsViewerComparator comparator= new AddDelegateMethodsViewerComparator(); dialog.setComparator(comparator); dialog.setMessage(ActionMessages.AddDelegateMethodsAction_message); dialog.setTitle(ActionMessages.AddDelegateMethodsAction_title); IVariableBinding[] expanded= provider.getExpandedElements(); if (expanded.length > 0) { dialog.setExpandedElements(expanded); } else { Object[] elements= provider.getElements(null); if (elements.length > 0) { comparator.sort(null, elements); dialog.setInitialSelections(provider.getInitiallySelectedElements()); dialog.setSize(60, 18); int result= dialog.open();
private void showUI(IType type, IField[] fields) { try { AddDelegateMethodsContentProvider provider= new AddDelegateMethodsContentProvider(type, fields); SourceActionDialog dialog= new AddDelegateMethodsDialog(getShell(), new AddDelegateMethodsLabelProvider(), provider, fEditor, type, false); dialog.setValidator(new AddDelegateMethodsActionStatusValidator(provider.getCount())); AddDelegateMethodsViewerComparator comparator= new AddDelegateMethodsViewerComparator(); dialog.setComparator(comparator); dialog.setMessage(ActionMessages.AddDelegateMethodsAction_message); dialog.setTitle(ActionMessages.AddDelegateMethodsAction_title); IVariableBinding[] expanded= provider.getExpandedElements(); if (expanded.length > 0) { dialog.setExpandedElements(expanded); } else { Object[] elements= provider.getElements(null); if (elements.length > 0) { comparator.sort(null, elements); dialog.setInitialSelections(provider.getInitiallySelectedElements()); dialog.setSize(60, 18); int result= dialog.open(); methodKeys[index]= tuple[1].getKey(); AddDelegateMethodsOperation operation= new AddDelegateMethodsOperation(type, dialog.getElementPosition(), provider.getCompilationUnit(), variableKeys, methodKeys, settings, true, false); IRunnableContext context= JavaPlugin.getActiveWorkbenchWindow(); if (context == null)
CompilationUnit astRoot= SharedASTProviderCore.getAST(type.getCompilationUnit(), SharedASTProviderCore.WAIT_YES, new NullProgressMonitor()); AddDelegateMethodsContentProvider provider= new AddDelegateMethodsContentProvider(astRoot, type, fields); SourceActionDialog dialog= new AddDelegateMethodsDialog(getShell(), new AddDelegateMethodsLabelProvider(), provider, fEditor, type, false); dialog.setValidator(new AddDelegateMethodsActionStatusValidator(provider.getCount())); AddDelegateMethodsViewerComparator comparator= new AddDelegateMethodsViewerComparator(); dialog.setComparator(comparator); dialog.setMessage(ActionMessages.AddDelegateMethodsAction_message); dialog.setTitle(ActionMessages.AddDelegateMethodsAction_title); IVariableBinding[] expanded= provider.getExpandedElements(); if (expanded.length > 0) { dialog.setExpandedElements(expanded); } else { Object[] elements= provider.getElements(null); if (elements.length > 0) { comparator.sort(null, elements); dialog.setInitialSelections((Object[]) provider.getInitiallySelectedElements()); dialog.setSize(60, 18); int result= dialog.open();