Composite addSuperClassConstructorChoices(Composite composite) { Label label= new Label(composite, SWT.NONE); label.setText(ActionMessages.GenerateConstructorUsingFieldsSelectionDialog_sort_constructor_choices_label); GridData gd= new GridData(GridData.FILL_HORIZONTAL); label.setLayoutData(gd); BindingLabelProvider provider= new BindingLabelProvider(); final Combo combo= new Combo(composite, SWT.READ_ONLY); SWTUtil.setDefaultVisibleItemCount(combo); for (int i= 0; i < fSuperConstructors.length; i++) { combo.add(provider.getText(fSuperConstructors[i])); } // TODO: Can we be a little more intelligent about guessing the super() ? combo.setText(combo.getItem(0)); combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); combo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { fSuperIndex= combo.getSelectionIndex(); // Disable omit super checkbox unless default constructor fOmitSuperButton.setEnabled(getSuperConstructorChoice().getParameterTypes().length == 0); updateOKStatus(); } }); return composite; }
Composite addSuperClassConstructorChoices(Composite composite) { Label label= new Label(composite, SWT.NONE); label.setText(ActionMessages.GenerateConstructorUsingFieldsSelectionDialog_sort_constructor_choices_label); GridData gd= new GridData(GridData.FILL_HORIZONTAL); label.setLayoutData(gd); BindingLabelProvider provider= new BindingLabelProvider(); final Combo combo= new Combo(composite, SWT.READ_ONLY); for (int i= 0; i < fSuperConstructors.length; i++) { combo.add(provider.getText(fSuperConstructors[i])); } // TODO: Can we be a little more intelligent about guessing the super() ? combo.setText(combo.getItem(0)); combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); combo.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { fSuperIndex= combo.getSelectionIndex(); // Disable omit super checkbox unless default constructor fOmitSuperButton.setEnabled(getSuperConstructorChoice().getParameterTypes().length == 0); updateOKStatus(); } }); return composite; }
Composite addSuperClassConstructorChoices(Composite composite) { Label label= new Label(composite, SWT.NONE); label.setText(ActionMessages.GenerateConstructorUsingFieldsSelectionDialog_sort_constructor_choices_label); GridData gd= new GridData(GridData.FILL_HORIZONTAL); label.setLayoutData(gd); BindingLabelProvider provider= new BindingLabelProvider(); final Combo combo= new Combo(composite, SWT.READ_ONLY); SWTUtil.setDefaultVisibleItemCount(combo); for (int i= 0; i < fSuperConstructors.length; i++) { combo.add(provider.getText(fSuperConstructors[i])); } // TODO: Can we be a little more intelligent about guessing the super() ? combo.setText(combo.getItem(0)); combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); combo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { fSuperIndex= combo.getSelectionIndex(); // Disable omit super checkbox unless default constructor fOmitSuperButton.setEnabled(getSuperConstructorChoice().getParameterTypes().length == 0); updateOKStatus(); } }); return composite; }
public GenerateToStringDialog(Shell shell, CompilationUnitEditor editor, IType type, IVariableBinding[] fields, IVariableBinding[] inheritedFields, IVariableBinding[] selectedFields, IMethodBinding[] methods, IMethodBinding[] inheritededMethods) throws JavaModelException { super(shell, new BindingLabelProvider(), new GenerateToStringContentProvider(fields, inheritedFields, methods, inheritededMethods), editor, type, false); setEmptyListMessage(JavaUIMessages.GenerateHashCodeEqualsDialog_no_entries); List<Object> selected= new ArrayList<>(Arrays.asList(selectedFields)); if (selectedFields.length == fields.length && selectedFields.length > 0) selected.add(getContentProvider().getParent(selectedFields[0])); setInitialElementSelections(selected); setTitle(JavaUIMessages.GenerateToStringDialog_dialog_title); setMessage(JavaUIMessages.GenerateToStringDialog_select_fields_to_include); setValidator(new GenerateToStringValidator(fields.length + inheritedFields.length, methods.length + inheritededMethods.length)); setSize(60, 18); setInput(new Object()); fGenerationSettings= new ToStringGenerationSettings(getDialogSettings()); }
public GenerateToStringDialog(Shell shell, CompilationUnitEditor editor, IType type, IVariableBinding[] fields, IVariableBinding[] inheritedFields, IVariableBinding[] selectedFields, IMethodBinding[] methods, IMethodBinding[] inheritededMethods) throws JavaModelException { super(shell, new BindingLabelProvider(), new GenerateToStringContentProvider(fields, inheritedFields, methods, inheritededMethods), editor, type, false); setEmptyListMessage(JavaUIMessages.GenerateHashCodeEqualsDialog_no_entries); List<Object> selected= new ArrayList<Object>(Arrays.asList(selectedFields)); if (selectedFields.length == fields.length && selectedFields.length > 0) selected.add(getContentProvider().getParent(selectedFields[0])); setInitialElementSelections(selected); setTitle(JavaUIMessages.GenerateToStringDialog_dialog_title); setMessage(JavaUIMessages.GenerateToStringDialog_select_fields_to_include); setValidator(new GenerateToStringValidator(fields.length + inheritedFields.length, methods.length + inheritededMethods.length)); setSize(60, 18); setInput(new Object()); fGenerationSettings= new ToStringGenerationSettings(getDialogSettings()); }
public OverrideMethodDialog(Shell shell, CompilationUnitEditor editor, IType type, boolean isSubType) throws JavaModelException { super(shell, new BindingLabelProvider(), new OverrideMethodContentProvider(), editor, type, false); RefactoringASTParser parser= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL); fUnit= parser.parse(type.getCompilationUnit(), true);
public OverrideMethodDialog(Shell shell, CompilationUnitEditor editor, IType type, boolean isSubType) throws JavaModelException { super(shell, new BindingLabelProvider(), new OverrideMethodContentProvider(), editor, type, false); RefactoringASTParser parser= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL); fUnit= parser.parse(type.getCompilationUnit(), true);
public OverrideMethodDialog(Shell shell, CompilationUnitEditor editor, IType type, boolean isSubType) throws JavaModelException { super(shell, new BindingLabelProvider(), new OverrideMethodContentProvider(), editor, type, false); RefactoringASTParser parser= new RefactoringASTParser(AST.JLS3); fUnit= parser.parse(type.getCompilationUnit(), true);
public GenerateHashCodeEqualsDialog(Shell shell, CompilationUnitEditor editor, IType type, IVariableBinding[] allFields, IVariableBinding[] selectedFields) throws JavaModelException { super(shell, new BindingLabelProvider(), new GenerateHashCodeEqualsContentProvider(allFields), editor, type, false); setEmptyListMessage(JavaUIMessages.GenerateHashCodeEqualsDialog_no_entries); setInitialSelections(selectedFields); setTitle(JavaUIMessages.GenerateHashCodeEqualsDialog_dialog_title); setMessage(JavaUIMessages.GenerateHashCodeEqualsDialog_select_fields_to_include); setValidator(new GenerateHashCodeEqualsValidator(allFields.length)); setSize(60, 18); setInput(new Object()); fUseInstanceOf= asBoolean(getDialogSettings().get(SETTINGS_INSTANCEOF), false); }
public GenerateHashCodeEqualsDialog(Shell shell, CompilationUnitEditor editor, IType type, IVariableBinding[] allFields, IVariableBinding[] selectedFields) throws JavaModelException { super(shell, new BindingLabelProvider(), new GenerateHashCodeEqualsContentProvider(allFields), editor, type, false); setEmptyListMessage(JavaUIMessages.GenerateHashCodeEqualsDialog_no_entries); setInitialSelections(selectedFields); setTitle(JavaUIMessages.GenerateHashCodeEqualsDialog_dialog_title); setMessage(JavaUIMessages.GenerateHashCodeEqualsDialog_select_fields_to_include); setValidator(new GenerateHashCodeEqualsValidator(allFields.length)); setSize(60, 18); setInput(new Object()); fUseInstanceOf= asBoolean(getDialogSettings().get(SETTINGS_INSTANCEOF), false); fUseBlocks= asBoolean(getDialogSettings().get(SETTINGS_BLOCKS), false); }
public GenerateHashCodeEqualsDialog(Shell shell, CompilationUnitEditor editor, IType type, IVariableBinding[] allFields, IVariableBinding[] selectedFields) throws JavaModelException { super(shell, new BindingLabelProvider(), new GenerateHashCodeEqualsContentProvider(allFields), editor, type, false); this.fProject = type.getJavaProject(); setEmptyListMessage(JavaUIMessages.GenerateHashCodeEqualsDialog_no_entries); setInitialSelections((Object[]) selectedFields); setTitle(JavaUIMessages.GenerateHashCodeEqualsDialog_dialog_title); setMessage(JavaUIMessages.GenerateHashCodeEqualsDialog_select_fields_to_include); setValidator(new GenerateHashCodeEqualsValidator(allFields.length)); setSize(60, 18); setInput(new Object()); fUseInstanceOf= asBoolean(getDialogSettings().get(SETTINGS_INSTANCEOF), false); fUseBlocks= asBoolean(getDialogSettings().get(SETTINGS_BLOCKS), false); fUseJ7HashEquals= asBoolean(getDialogSettings().get(SETTINGS_J7_HASH_EQUALS), false); }
GenerateConstructorUsingFieldsSelectionDialog dialog= new GenerateConstructorUsingFieldsSelectionDialog(getShell(), new BindingLabelProvider(), provider, fEditor, type, bindings); dialog.setCommentString(ActionMessages.SourceActionDialog_createConstructorComment); dialog.setTitle(ActionMessages.GenerateConstructorUsingFieldsAction_dialog_title);
GenerateConstructorUsingFieldsSelectionDialog dialog= new GenerateConstructorUsingFieldsSelectionDialog(getShell(), new BindingLabelProvider(), provider, fEditor, type, bindings); dialog.setCommentString(ActionMessages.SourceActionDialog_createConstructorComment); dialog.setTitle(ActionMessages.GenerateConstructorUsingFieldsAction_dialog_title);
GenerateConstructorUsingFieldsSelectionDialog dialog= new GenerateConstructorUsingFieldsSelectionDialog(getShell(), new BindingLabelProvider(), provider, fEditor, type, bindings); dialog.setCommentString(ActionMessages.SourceActionDialog_createConstructorComment); dialog.setTitle(ActionMessages.GenerateConstructorUsingFieldsAction_dialog_title);
AddUnimplementedConstructorsDialog dialog= new AddUnimplementedConstructorsDialog(shell, new BindingLabelProvider(), provider, fEditor, type); dialog.setCommentString(ActionMessages.SourceActionDialog_createConstructorComment); dialog.setTitle(ActionMessages.AddUnimplementedConstructorsAction_dialog_title);
AddUnimplementedConstructorsDialog dialog= new AddUnimplementedConstructorsDialog(shell, new BindingLabelProvider(), provider, fEditor, type); dialog.setCommentString(ActionMessages.SourceActionDialog_createConstructorComment); dialog.setTitle(ActionMessages.AddUnimplementedConstructorsAction_dialog_title);
AddUnimplementedConstructorsDialog dialog= new AddUnimplementedConstructorsDialog(shell, new BindingLabelProvider(), provider, fEditor, type); dialog.setCommentString(ActionMessages.SourceActionDialog_createConstructorComment); dialog.setTitle(ActionMessages.AddUnimplementedConstructorsAction_dialog_title);