issue_id
int64 2.04k
425k
| title
stringlengths 9
251
| body
stringlengths 4
32.8k
⌀ | status
stringclasses 6
values | after_fix_sha
stringlengths 7
7
| project_name
stringclasses 6
values | repo_url
stringclasses 6
values | repo_name
stringclasses 6
values | language
stringclasses 1
value | issue_url
null | before_fix_sha
null | pull_url
null | commit_datetime
timestamp[us, tz=UTC] | report_datetime
timestamp[us, tz=UTC] | updated_file
stringlengths 23
187
| chunk_content
stringlengths 1
22k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
|
if (selection.size() != 1)
return;
Object element= selection.getFirstElement();
if (!(element instanceof IJavaElement))
return;
IResource resource= null;
try {
resource= ((IJavaElement)element).getUnderlyingResource();
} catch(JavaModelException e) {
}
if (!(resource instanceof IFile))
return;
MenuManager submenu= new MenuManager(TypeHierarchyMessages.getString("TypeHierarchyViewPart.menu.open"));
submenu.add(new OpenWithMenu(getSite().getPage(), (IFile) resource));
menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, submenu);
}
private void addOpenPerspectiveItem(IMenuManager menu, IStructuredSelection selection) {
OpenTypeHierarchyUtil.addToMenu(getSite().getWorkbenchWindow(), menu, selection);
}
/**
* Toggles between the empty viewer page and the hierarchy
*/
private void setViewerVisibility(boolean showHierarchy) {
if (showHierarchy) {
fViewerbook.showPage(getCurrentViewer().getControl());
} else {
fViewerbook.showPage(fEmptyTypesViewer);
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
|
}
}
/**
* Sets the member filter. <code>null</code> disables member filtering.
*/
private void setMemberFilter(IMember[] memberFilter) {
Assert.isNotNull(fAllViewers);
for (int i= 0; i < fAllViewers.length; i++) {
fAllViewers[i].setMemberFilter(memberFilter);
}
updateHierarchyViewer();
updateTitle();
internalSelectType(fSelectedType, true);
}
private IType getSelectableType(IJavaElement elem) {
ISelection sel= null;
if (elem.getElementType() != IJavaElement.TYPE) {
return (IType) getCurrentViewer().getTreeRootType();
} else {
return (IType) elem;
}
}
private void internalSelectType(IMember elem, boolean reveal) {
TypeHierarchyViewer viewer= getCurrentViewer();
viewer.removeSelectionChangedListener(fSelectionChangedListener);
viewer.setSelection(elem != null ? new StructuredSelection(elem) : StructuredSelection.EMPTY, reveal);
viewer.addSelectionChangedListener(fSelectionChangedListener);
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
|
}
private void internalSelectMember(IMember member) {
fMethodsViewer.removeSelectionChangedListener(fSelectionChangedListener);
fMethodsViewer.setSelection(member != null ? new StructuredSelection(member) : StructuredSelection.EMPTY);
fMethodsViewer.addSelectionChangedListener(fSelectionChangedListener);
}
/**
* When the input changed or the hierarchy pane becomes visible,
* <code>updateHierarchyViewer<code> brings up the correct view and refreshes
* the current tree
*/
private void updateHierarchyViewer() {
if (fInputElement == null) {
fPagebook.showPage(fNoHierarchyShownLabel);
} else {
if (getCurrentViewer().containsElements() != null) {
Runnable runnable= new Runnable() {
public void run() {
getCurrentViewer().updateContent();
}
};
BusyIndicator.showWhile(getDisplay(), runnable);
if (!isChildVisible(fViewerbook, getCurrentViewer().getControl())) {
setViewerVisibility(true);
}
} else {
fEmptyTypesViewer.setText(TypeHierarchyMessages.getFormattedString("TypeHierarchyViewPart.nodecl", fInputElement.getElementName()));
setViewerVisibility(false);
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
|
}
}
}
private void updateMethodViewer(IType input) {
if (input != fMethodsViewer.getInput() && !fIsEnableMemberFilter && fCurrentOrientation != VIEW_ORIENTATION_SINGLE) {
if (input != null) {
fMethodViewerPaneLabel.setText(fPaneLabelProvider.getText(input));
fMethodViewerPaneLabel.setImage(fPaneLabelProvider.getImage(input));
} else {
fMethodViewerPaneLabel.setText("");
fMethodViewerPaneLabel.setImage(null);
}
fMethodsViewer.setInput(input);
}
}
private void doSelectionChanged(SelectionChangedEvent e) {
if (e.getSelectionProvider() == fMethodsViewer) {
methodSelectionChanged(e.getSelection());
} else {
typeSelectionChanged(e.getSelection());
}
}
private void methodSelectionChanged(ISelection sel) {
if (sel instanceof IStructuredSelection) {
List selected= ((IStructuredSelection)sel).toList();
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
|
int nSelected= selected.size();
if (fIsEnableMemberFilter) {
IMember[] memberFilter= null;
if (nSelected > 0) {
memberFilter= new IMember[nSelected];
selected.toArray(memberFilter);
}
setMemberFilter(memberFilter);
}
if (nSelected == 1) {
revealElementInEditor(selected.get(0), fMethodsViewer);
}
}
}
private void typeSelectionChanged(ISelection sel) {
if (sel instanceof IStructuredSelection) {
List selected= ((IStructuredSelection)sel).toList();
int nSelected= selected.size();
if (nSelected != 0) {
List types= new ArrayList(nSelected);
for (int i= nSelected-1; i >= 0; i--) {
Object elem= selected.get(i);
if (elem instanceof IType && !types.contains(elem)) {
types.add(elem);
}
}
if (types.size() == 1) {
fSelectedType= (IType) types.get(0);
updateMethodViewer(fSelectedType);
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
|
} else if (types.size() == 0) {
}
if (nSelected == 1) {
revealElementInEditor(selected.get(0), getCurrentViewer());
}
} else {
fSelectedType= null;
updateMethodViewer(null);
}
}
}
private void revealElementInEditor(Object elem, Viewer originViewer) {
if (getSite().getPage().getActivePart() != this) {
return;
}
if (fSelectionProviderMediator.getViewerInFocus() != originViewer) {
return;
}
IEditorPart editorPart= EditorUtility.isOpenInEditor(elem);
if (editorPart != null && (elem instanceof IJavaElement)) {
try {
getSite().getPage().removePartListener(fPartListener);
EditorUtility.openInEditor(elem, false);
EditorUtility.revealInEditor(editorPart, (IJavaElement) elem);
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
|
getSite().getPage().addPartListener(fPartListener);
} catch (CoreException e) {
JavaPlugin.log(e);
}
}
}
private Display getDisplay() {
if (fPagebook != null && !fPagebook.isDisposed()) {
return fPagebook.getDisplay();
}
return null;
}
private boolean isChildVisible(Composite pb, Control child) {
Control[] children= pb.getChildren();
for (int i= 0; i < children.length; i++) {
if (children[i] == child && children[i].isVisible())
return true;
}
return false;
}
private void updateTitle() {
String viewerTitle= getCurrentViewer().getTitle();
String tooltip;
String title;
if (fInputElement != null) {
String[] args= new String[] { viewerTitle, JavaElementLabels.getElementLabel(fInputElement, JavaElementLabels.ALL_DEFAULT) };
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
|
title= TypeHierarchyMessages.getFormattedString("TypeHierarchyViewPart.title", args);
tooltip= TypeHierarchyMessages.getFormattedString("TypeHierarchyViewPart.tooltip", args);
} else {
title= viewerTitle;
tooltip= viewerTitle;
}
setTitle(title);
setTitleToolTip(tooltip);
}
private void updateToolbarButtons() {
boolean isType= fInputElement instanceof IType;
for (int i= 0; i < fViewActions.length; i++) {
ToggleViewAction action= fViewActions[i];
if (action.getViewerIndex() == VIEW_ID_TYPE) {
action.setEnabled(fInputElement != null);
} else {
action.setEnabled(isType);
}
}
}
/**
* Sets the current view (see view id)
* called from ToggleViewAction. Must be called after creation of the viewpart.
*/
public void setView(int viewerIndex) {
Assert.isNotNull(fAllViewers);
if (viewerIndex < fAllViewers.length && fCurrentViewerIndex != viewerIndex) {
fCurrentViewerIndex= viewerIndex;
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
|
updateHierarchyViewer();
if (fInputElement != null) {
ISelection currSelection= getCurrentViewer().getSelection();
if (currSelection == null || currSelection.isEmpty()) {
internalSelectType(getSelectableType(fInputElement), false);
}
if (!fIsEnableMemberFilter) {
typeSelectionChanged(currSelection);
}
}
updateTitle();
if (fHierarchyProblemListener != null) {
JavaPlugin.getDefault().getProblemMarkerManager().removeListener(fHierarchyProblemListener);
}
fHierarchyProblemListener= getCurrentViewer();
JavaPlugin.getDefault().getProblemMarkerManager().addListener(fHierarchyProblemListener);
fDialogSettings.put(DIALOGSTORE_HIERARCHYVIEW, viewerIndex);
getCurrentViewer().getTree().setFocus();
}
for (int i= 0; i < fViewActions.length; i++) {
ToggleViewAction action= fViewActions[i];
action.setChecked(fCurrentViewerIndex == action.getViewerIndex());
}
}
/**
* Gets the curret active view index.
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
|
*/
public int getViewIndex() {
return fCurrentViewerIndex;
}
private TypeHierarchyViewer getCurrentViewer() {
return fAllViewers[fCurrentViewerIndex];
}
/**
* called from EnableMemberFilterAction.
* Must be called after creation of the viewpart.
*/
public void enableMemberFilter(boolean on) {
if (on != fIsEnableMemberFilter) {
fIsEnableMemberFilter= on;
if (!on) {
IType methodViewerInput= (IType) fMethodsViewer.getInput();
setMemberFilter(null);
if (methodViewerInput != null && getCurrentViewer().isElementShown(methodViewerInput)) {
internalSelectType(methodViewerInput, true);
} else if (fSelectedType != null) {
internalSelectType(fSelectedType, true);
updateMethodViewer(fSelectedType);
}
} else {
methodSelectionChanged(fMethodsViewer.getSelection());
}
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
|
}
fEnableMemberFilterAction.setChecked(on);
}
/**
* Called from ITypeHierarchyLifeCycleListener.
* Can be called from any thread
*/
private void doTypeHierarchyChanged(final TypeHierarchyLifeCycle typeHierarchy, final IType[] changedTypes) {
Display display= getDisplay();
if (display != null) {
display.asyncExec(new Runnable() {
public void run() {
doTypeHierarchyChangedOnViewers(changedTypes);
}
});
}
}
private void doTypeHierarchyChangedOnViewers(IType[] changedTypes) {
if (changedTypes == null) {
if (fHierarchyLifeCycle.getHierarchy() == null || !fHierarchyLifeCycle.getHierarchy().exists()) {
clearInput();
} else {
try {
fHierarchyLifeCycle.ensureRefreshedTypeHierarchy(fInputElement);
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
clearInput();
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
|
return;
}
updateHierarchyViewer();
}
} else {
if (getCurrentViewer().isMethodFiltering()) {
if (changedTypes.length == 1) {
getCurrentViewer().refresh(changedTypes[0]);
} else {
updateHierarchyViewer();
}
} else {
getCurrentViewer().update(changedTypes, new String[] { IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE } );
}
}
}
/**
* Determines the input element to be used initially .
*/
private IJavaElement determineInputElement() {
Object input= getSite().getPage().getInput();
if (input instanceof IJavaElement) {
return (IJavaElement) input;
}
return null;
}
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
|
/*
* @see IViewPart#init
*/
public void init(IViewSite site, IMemento memento) throws PartInitException {
super.init(site, memento);
fMemento= memento;
}
/*
* @see ViewPart#saveState(IMemento)
*/
public void saveState(IMemento memento) {
if (fPagebook == null) {
if (fMemento != null) {
memento.putMemento(fMemento);
}
return;
}
if (fInputElement != null) {
memento.putString(TAG_INPUT, fInputElement.getHandleIdentifier());
}
memento.putInteger(TAG_VIEW, getViewIndex());
memento.putInteger(TAG_ORIENTATION, fCurrentOrientation);
int weigths[]= fTypeMethodsSplitter.getWeights();
int ratio= (weigths[0] * 1000) / (weigths[0] + weigths[1]);
memento.putInteger(TAG_RATIO, ratio);
ScrollBar bar= getCurrentViewer().getTree().getVerticalBar();
int position= bar != null ? bar.getSelection() : 0;
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
|
memento.putInteger(TAG_VERTICAL_SCROLL, position);
IJavaElement selection= (IJavaElement)((IStructuredSelection) getCurrentViewer().getSelection()).getFirstElement();
if (selection != null) {
memento.putString(TAG_SELECTION, selection.getHandleIdentifier());
}
fMethodsViewer.saveState(memento);
}
/**
* Restores the type hierarchy settings from a memento.
*/
private void restoreState(IMemento memento, IJavaElement defaultInput) {
IJavaElement input= defaultInput;
String elementId= memento.getString(TAG_INPUT);
if (elementId != null) {
input= JavaCore.create(elementId);
if (!input.exists()) {
input= null;
}
}
setInputElement(input);
Integer viewerIndex= memento.getInteger(TAG_VIEW);
if (viewerIndex != null) {
setView(viewerIndex.intValue());
}
Integer orientation= memento.getInteger(TAG_ORIENTATION);
if (orientation != null) {
setOrientation(orientation.intValue());
}
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
|
Integer ratio= memento.getInteger(TAG_RATIO);
if (ratio != null) {
fTypeMethodsSplitter.setWeights(new int[] { ratio.intValue(), 1000 - ratio.intValue() });
}
ScrollBar bar= getCurrentViewer().getTree().getVerticalBar();
if (bar != null) {
Integer vScroll= memento.getInteger(TAG_VERTICAL_SCROLL);
if (vScroll != null) {
bar.setSelection(vScroll.intValue());
}
}
String selectionId= memento.getString(TAG_SELECTION);
if (selectionId != null) {
IJavaElement elem= JavaCore.create(selectionId);
if (getCurrentViewer().isElementShown(elem) && elem instanceof IMember) {
internalSelectType((IMember)elem, false);
}
}
fMethodsViewer.restoreState(memento);
}
/**
* Link selection to active editor.
*/
private void editorActivated(IEditorPart editor) {
if (!JavaBasePreferencePage.linkTypeHierarchySelectionToEditor()) {
return;
}
if (fInputElement == null) {
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
|
return;
}
IJavaElement elem= (IJavaElement)editor.getEditorInput().getAdapter(IJavaElement.class);
try {
TypeHierarchyViewer currentViewer= getCurrentViewer();
if (elem instanceof IClassFile) {
IType type= ((IClassFile)elem).getType();
if (currentViewer.isElementShown(type)) {
internalSelectType(type, true);
updateMethodViewer(type);
}
} else if (elem instanceof ICompilationUnit) {
IType[] allTypes= ((ICompilationUnit)elem).getAllTypes();
for (int i= 0; i < allTypes.length; i++) {
if (currentViewer.isElementShown(allTypes[i])) {
internalSelectType(allTypes[i], true);
updateMethodViewer(allTypes[i]);
return;
}
}
}
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
}
}
}
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewer.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.typehierarchy;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IContentProvider;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ILabelProvider;
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewer.java
|
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.IContextMenuConstants;
import org.eclipse.jdt.internal.ui.actions.ContextMenuGroup;
import org.eclipse.jdt.internal.ui.actions.GenerateGroup;
import org.eclipse.jdt.internal.ui.actions.OpenJavaElementAction;
import org.eclipse.jdt.internal.ui.actions.ShowInPackageViewAction;
import org.eclipse.jdt.internal.ui.search.JavaSearchGroup;
import org.eclipse.jdt.internal.ui.viewsupport.IProblemChangedListener;
import org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer;
import org.eclipse.jdt.internal.ui.wizards.NewGroup;
public abstract class TypeHierarchyViewer extends ProblemTreeViewer implements IProblemChangedListener {
private OpenJavaElementAction fOpen;
private ShowInPackageViewAction fShowInPackageViewAction;
private ContextMenuGroup[] fStandardGroups;
public TypeHierarchyViewer(Composite parent, IContentProvider contentProvider, ILabelProvider lprovider, IWorkbenchPart part) {
super(new Tree(parent, SWT.SINGLE));
setContentProvider(contentProvider);
setLabelProvider(lprovider);
setSorter(new ViewerSorter() {
public boolean isSorterProperty(Object element, Object property) {
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewer.java
|
return true;
}
public int category(Object element) {
if (element instanceof IType) {
try {
return (((IType)element).isInterface()) ? 2 : 1;
} catch (JavaModelException e) {
}
} else if (element instanceof IMember) {
return 0;
}
return 3;
}
});
fOpen= new OpenJavaElementAction(this);
addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
fOpen.run();
}
});
fShowInPackageViewAction= new ShowInPackageViewAction();
fStandardGroups= new ContextMenuGroup[] {
new JavaSearchGroup(), new NewGroup(), new GenerateGroup()
};
}
/**
* Attaches a contextmenu listener to the tree
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewer.java
|
*/
public void initContextMenu(IMenuListener menuListener, String popupId, IWorkbenchPartSite viewSite) {
MenuManager menuMgr= new MenuManager();
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(menuListener);
Menu menu= menuMgr.createContextMenu(getTree());
getTree().setMenu(menu);
viewSite.registerContextMenu(popupId, menuMgr, this);
}
/**
* Fills up the context menu with items for the hierarchy viewer
* Should be called by the creator of the context menu
*/
public void contributeToContextMenu(IMenuManager menu) {
if (fOpen.canActionBeAdded()) {
menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, fOpen);
}
menu.appendToGroup(IContextMenuConstants.GROUP_SHOW, fShowInPackageViewAction);
ContextMenuGroup.add(menu, fStandardGroups, this);
}
/**
* Set the member filter
*/
public void setMemberFilter(IMember[] memberFilter) {
getHierarchyContentProvider().setMemberFilter(memberFilter);
}
/**
* Returns if method filtering is enabled.
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewer.java
|
*/
public boolean isMethodFiltering() {
return getHierarchyContentProvider().getMemberFilter() != null;
}
/**
* Returns true if the hierarchy contains elements. Returns one of them
* With member filtering it is possible that no elements are visible
*/
public Object containsElements() {
Object[] elements= ((IStructuredContentProvider)getContentProvider()).getElements(null);
if (elements.length > 0) {
return elements[0];
}
return null;
}
/**
* Returns true if the hierarchy contains elements. Returns one of them
* With member filtering it is possible that no elements are visible
*/
public IType getTreeRootType() {
Object[] elements= ((IStructuredContentProvider)getContentProvider()).getElements(null);
if (elements.length > 0 && elements[0] instanceof IType) {
return (IType) elements[0];
}
return null;
}
|
6,765 |
Bug 6765 Type hierarchy missing buttons when in "Hierarchy View Only" mode
|
Build 20011206, Win2000 Steps: 1) Put the type hierarchy view in "Hierarchy View Only" 2) Shutdown the workbench and restart 3) The type hierarchy is now missing its toolbar buttons, the ones that cycle between the different type hierarchy modes. Workaround is to switch to "Vertical Viewer Orientation", then back to "Hierarchy View Only", then the buttons reappear. Side note: This seems to be the only place in the UI that the term "Viewer" is used. Maybe it should say "Vertical View Orientation", etc. There's probably a JFace viewer underneath, but users are only aware of views, not viewers.
|
resolved fixed
|
edd94b3
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-12T16:23:22Z | 2001-12-10T21:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewer.java
|
/**
* Returns true if the hierarchy contains element the element.
*/
public boolean isElementShown(Object element) {
return findItem(element) != null;
}
/**
* Updates the content of this viewer: refresh and expanding the tree in the way wanted.
*/
public abstract void updateContent();
/**
* Returns the title for the current view
*/
public abstract String getTitle();
/*
* @see StructuredViewer#setContentProvider
* Content provider must be of type TypeHierarchyContentProvider
*/
public void setContentProvider(IContentProvider cp) {
Assert.isTrue(cp instanceof TypeHierarchyContentProvider);
super.setContentProvider(cp);
}
protected TypeHierarchyContentProvider getHierarchyContentProvider() {
return (TypeHierarchyContentProvider)getContentProvider();
}
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddUnimplementedMethodsAction.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.actions;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddUnimplementedMethodsAction.java
|
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.corext.codemanipulation.AddUnimplementedMethodsOperation;
import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
/**
* Evaluates unimplemented methods of a type.
* Will open an editor for the type. Changes are unsaved.
*/
public class AddUnimplementedMethodsAction extends Action {
private ISelectionProvider fSelectionProvider;
public AddUnimplementedMethodsAction(ISelectionProvider selProvider) {
super(JavaUIMessages.getString("AddUnimplementedMethodsAction.label"));
setDescription(JavaUIMessages.getString("AddUnimplementedMethodsAction.description"));
setToolTipText(JavaUIMessages.getString("AddUnimplementedMethodsAction.tooltip"));
fSelectionProvider= selProvider;
WorkbenchHelp.setHelp(this, new Object[] { IJavaHelpContextIds.ADD_UNIMPLEMENTED_METHODS_ACTION });
}
public void run() {
Shell shell= JavaPlugin.getActiveWorkbenchShell();
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddUnimplementedMethodsAction.java
|
try {
IType type= getSelectedType();
if (type == null) {
return;
}
IEditorPart editor= EditorUtility.openInEditor(type);
type= (IType)EditorUtility.getWorkingCopy(type);
if (type == null) {
MessageDialog.openError(shell, JavaUIMessages.getString("AddUnimplementedMethodsAction.error.title"), JavaUIMessages.getString("AddUnimplementedMethodsAction.error.type_removed_in_editor"));
return;
}
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
AddUnimplementedMethodsOperation op= new AddUnimplementedMethodsOperation(type, settings, false);
try {
ProgressMonitorDialog dialog= new ProgressMonitorDialog(shell);
dialog.run(false, true, new WorkbenchRunnableAdapter(op));
IMethod[] res= op.getCreatedMethods();
if (res == null || res.length == 0) {
MessageDialog.openInformation(shell, JavaUIMessages.getString("AddUnimplementedMethodsAction.error.title"), JavaUIMessages.getString("AddUnimplementedMethodsAction.error.nothing_found"));
} else if (editor != null) {
EditorUtility.revealInEditor(editor, res[0]);
}
} catch (InvocationTargetException e) {
JavaPlugin.log(e);
MessageDialog.openError(shell, JavaUIMessages.getString("AddUnimplementedMethodsAction.error.title"), e.getTargetException().getMessage());
} catch (InterruptedException e) {
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddUnimplementedMethodsAction.java
|
}
} catch (CoreException e) {
JavaPlugin.log(e);
ErrorDialog.openError(shell, JavaUIMessages.getString("AddUnimplementedMethodsAction.error.title"), null, e.getStatus());
}
}
private IType getSelectedType() throws JavaModelException {
ISelection sel= fSelectionProvider.getSelection();
if (sel instanceof IStructuredSelection) {
Object[] elements= ((IStructuredSelection)sel).toArray();
if (elements.length == 1 && (elements[0] instanceof IType)) {
IType type= (IType) elements[0];
if (type.getCompilationUnit() != null && type.isClass()) {
return type;
}
}
}
return null;
}
public boolean canActionBeAdded() {
try {
return getSelectedType() != null;
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
}
return false;
}
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/OpenSuperImplementationAction.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.actions;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.texteditor.IUpdate;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.ITypeHierarchy;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
/**
* On a selected method; opens the implementation in the super type (if existing)
*/
public class OpenSuperImplementationAction extends Action implements IUpdate, IObjectActionDelegate {
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/OpenSuperImplementationAction.java
|
private StructuredSelectionProvider fSelectionProvider;
/**
* Use only for IWorkbenchWindowActionDelegates!
*/
public OpenSuperImplementationAction() {
this(null);
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/OpenSuperImplementationAction.java
|
}
public OpenSuperImplementationAction(StructuredSelectionProvider provider) {
super();
setText(JavaUIMessages.getString("OpenSuperImplementationAction.label"));
setDescription(JavaUIMessages.getString("OpenSuperImplementationAction.description"));
setToolTipText(JavaUIMessages.getString("OpenSuperImplementationAction.tooltip"));
fSelectionProvider= provider;
}
public void update() {
setEnabled(canOperateOn());
}
private boolean canOperateOn() {
return getMethod() != null;
}
private IMethod getMethod() {
if (fSelectionProvider == null) {
return null;
}
IStructuredSelection selection= fSelectionProvider.getSelection(StructuredSelectionProvider.FLAGS_DO_ELEMENT_AT_OFFSET);
if (selection.size() != 1)
return null;
try {
Object element= selection.getFirstElement();
if (element instanceof IMethod) {
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/OpenSuperImplementationAction.java
|
IMethod method= (IMethod) element;
if (method.exists()) {
int flags= method.getFlags();
if (!Flags.isStatic(flags) && !Flags.isPrivate(flags)) {
return method;
}
}
}
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
return null;
}
public void run() {
IMethod method= getMethod();
if (method == null) {
return;
}
try {
IType declaringType= method.getDeclaringType();
ICompilationUnit cu= declaringType.getCompilationUnit();
if (cu != null && cu.isWorkingCopy()) {
declaringType= (IType) cu.getOriginal(declaringType);
if (!declaringType.exists()) {
return;
}
}
ITypeHierarchy hierarchy= declaringType.newSupertypeHierarchy(null);
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/OpenSuperImplementationAction.java
|
IMethod impl= JavaModelUtil.findMethodImplementationInHierarchy(hierarchy, method.getElementName(), method.getParameterTypes(), method.isConstructor());
if (impl != null) {
IEditorPart part= EditorUtility.openInEditor(impl);
EditorUtility.revealInEditor(part, impl);
}
} catch (CoreException e) {
JavaPlugin.log(e);
String title= JavaUIMessages.getString("OpenSuperImplementationAction.error.title");
String message= JavaUIMessages.getString("OpenSuperImplementationAction.error.message");
ErrorDialog.openError(JavaPlugin.getActiveWorkbenchShell(), title, message, e.getStatus());
}
}
/*
* @see IActionDelegate#run(IAction)
*/
public void run(IAction action) {
run();
}
/*
* @see IActionDelegate#selectionChanged(IAction, ISelection)
*/
public void selectionChanged(IAction action, ISelection selection) {
}
/*
* @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
*/
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
fSelectionProvider= StructuredSelectionProvider.createFrom(targetPart.getSite().getWorkbenchWindow().getSelectionService());
}
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/SelectionStatusDialog.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.dialogs;
import java.util.Arrays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.dialogs.SelectionDialog;
import org.eclipse.core.runtime.IStatus;
/**
* An abstract base class for dialogs with a status bar and ok/cancel buttons.
* The status message must be passed over as StatusInfo object and can be
* an error, warning or ok. The OK button is enabled or disabled depending
* on the status.
*/
public abstract class SelectionStatusDialog extends SelectionDialog {
private MessageLine fStatusLine;
private IStatus fLastStatus;
private Image fImage;
private boolean fStatusLineAboveButtons= false;
/**
* Creates an instance of a <code>SelectionStatusDialog</code>.
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/SelectionStatusDialog.java
|
*/
public SelectionStatusDialog(Shell parent) {
super(parent);
}
/**
* Controls whether status line appears to the left of the buttons (default)
* or above them.
*
* @param aboveButtons if <code>true</code> status line is placed above buttons; if
* <code>false</code> to the right
*/
public void setStatusLineAboveButtons(boolean aboveButtons) {
fStatusLineAboveButtons= aboveButtons;
}
/**
* Sets the image for this dialog.
* @param image the image.
*/
public void setImage(Image image) {
fImage= image;
}
/**
* Returns the first element from the list of results. Returns <code>null</code>
* if no element has been selected.
*
* @return the first result element if one exists. Otherwise <code>null</code> is
* returned.
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/SelectionStatusDialog.java
|
*/
public Object getFirstResult() {
Object[] result= getResult();
if (result == null || result.length == 0)
return null;
return result[0];
}
/**
* Sets a result element at the given position.
*/
protected void setResult(int position, Object element) {
Object[] result= getResult();
result[position]= element;
setResult(Arrays.asList(result));
}
/**
* Compute the result and return it.
*/
protected abstract void computeResult();
/*
* @see Window#configureShell(shell)
*/
protected void configureShell(Shell shell) {
super.configureShell(shell);
if (fImage != null)
shell.setImage(fImage);
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/SelectionStatusDialog.java
|
/**
* Update the dialog's status line to reflect the given status. It is safe to call
* this method before the dialog has been opened.
*/
protected void updateStatus(IStatus status) {
fLastStatus= status;
if (fStatusLine != null && !fStatusLine.isDisposed()) {
updateButtonsEnableState(status);
StatusUtil.applyToStatusLine(fStatusLine, status);
}
}
/**
* Update the status of the ok button to reflect the given status. Subclasses
* may override this method to update additional buttons.
*/
protected void updateButtonsEnableState(IStatus status) {
Button okButton= getOkButton();
if (okButton != null && !okButton.isDisposed())
okButton.setEnabled(!status.matches(IStatus.ERROR));
}
/*
* @see Dialog#okPressed()
*/
protected void okPressed() {
computeResult();
super.okPressed();
}
/*
* @see Window#create()
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/SelectionStatusDialog.java
|
*/
public void create() {
super.create();
if (fLastStatus != null)
updateStatus(fLastStatus);
}
/*
* @see Dialog#createButtonBar(Composite)
*/
protected Control createButtonBar(Composite parent) {
Composite composite= new Composite(parent, SWT.NULL);
GridLayout layout= new GridLayout();
if (fStatusLineAboveButtons) {
layout.verticalSpacing= 0;
} else {
layout.numColumns= 2;
}
layout.marginHeight= 0; layout.marginWidth= 0;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
fStatusLine= new MessageLine(composite);
fStatusLine.setAlignment(SWT.LEFT);
fStatusLine.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
fStatusLine.setMessage("");
super.createButtonBar(composite);
return composite;
}
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java
|
package org.eclipse.jdt.internal.ui.text.java;
import java.util.ArrayList;
import org.eclipse.swt.graphics.Image;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.util.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.ITypeHierarchy;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
import org.eclipse.jdt.internal.corext.codemanipulation.ImportsStructure;
import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
import org.eclipse.jdt.internal.corext.textmanipulation.TextUtil;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.preferences.CodeFormatterPreferencePage;
import org.eclipse.jdt.internal.ui.preferences.ImportOrganizePreferencePage;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
public class AnonymousTypeCompletionProposal extends JavaCompletionProposal {
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java
|
private IType fDeclaringType;
private ICompilationUnit fCompilationUnit;
private ImportsStructure fImportStructure;
public AnonymousTypeCompletionProposal(ICompilationUnit cu, int start, int length, String constructorCompletion, String displayName, String declaringTypeName) {
super(constructorCompletion, start, length, null, displayName);
Assert.isNotNull(cu);
Assert.isNotNull(declaringTypeName);
fCompilationUnit= cu;
fDeclaringType= getDeclaringType(cu.getJavaProject(), declaringTypeName);
setImage(getImageForType(fDeclaringType));
setCursorPosition(constructorCompletion.indexOf('(') + 1);
}
private Image getImageForType(IType type) {
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java
|
String imageName= JavaPluginImages.IMG_OBJS_CLASS;
if (type != null) {
try {
if (type.isInterface()) {
imageName= JavaPluginImages.IMG_OBJS_INTERFACE;
}
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
}
return JavaPluginImages.get(imageName);
}
private IType getDeclaringType(IJavaProject project, String typeName) {
try {
return JavaModelUtil.findType(project, typeName);
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
return null;
}
/*
* @see JavaCompletionProposal#applyImports(IDocument)
*/
protected void applyImports(IDocument document) {
if (fImportStructure != null) {
try {
fImportStructure.create(false, null);
} catch (CoreException e) {
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java
|
JavaPlugin.log(e);
}
}
}
/*
* @see ICompletionProposalExtension#apply(IDocument, char)
*/
public void apply(IDocument document, char trigger) {
try {
String[] prefOrder= ImportOrganizePreferencePage.getImportOrderPreference();
int threshold= ImportOrganizePreferencePage.getImportNumberThreshold();
fImportStructure= new ImportsStructure(fCompilationUnit, prefOrder, threshold, true);
String replacementString= getReplacementString();
StringBuffer buf= new StringBuffer();
buf.append(replacementString);
if (!replacementString.endsWith(")")) {
buf.append(')');
}
buf.append(" {\n");
createStubs(buf, fImportStructure);
buf.append("};");
String lineDelim= StubUtility.getLineDelimiterFor(document);
int tabWidth= CodeFormatterPreferencePage.getTabSize();
IRegion region= document.getLineInformationOfOffset(getReplacementOffset());
int indent= TextUtil.getIndent(document.get(region.getOffset(), region.getLength()), tabWidth);
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java
|
String replacement= StubUtility.codeFormat(buf.toString(), indent, lineDelim);
replacement= TextUtil.removeLeadingWhiteSpaces(replacement);
setReplacementString(replacement);
} catch (BadLocationException e) {
JavaPlugin.log(e);
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
super.apply(document, trigger);
}
private void createStubs(StringBuffer buf, ImportsStructure imports) throws JavaModelException {
if (fDeclaringType == null) {
return;
}
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
ArrayList res= new ArrayList();
ITypeHierarchy hierarchy= fDeclaringType.newSupertypeHierarchy(null);
StubUtility.evalUnimplementedMethods(fDeclaringType, hierarchy, true, settings, res, imports);
for (int i= 0; i < res.size(); i++) {
buf.append((String) res.get(i));
buf.append('\n');
}
}
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.wizards;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
import org.eclipse.swt.widgets.Control;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IBuffer;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.ITypeHierarchy;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.core.search.SearchEngine;
import org.eclipse.jdt.ui.IJavaElementSearchConstants;
import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jdt.internal.compiler.env.IConstants;
import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
import org.eclipse.jdt.internal.corext.codemanipulation.IImportsStructure;
import org.eclipse.jdt.internal.corext.codemanipulation.ImportsStructure;
import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
import org.eclipse.jdt.internal.ui.dialogs.TypeSelectionDialog;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.preferences.CodeGenerationPreferencePage;
import org.eclipse.jdt.internal.ui.preferences.ImportOrganizePreferencePage;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
import org.eclipse.jdt.internal.ui.text.template.Template;
import org.eclipse.jdt.internal.ui.text.template.Templates;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IStringButtonAdapter;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogFieldGroup;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.Separator;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonStatusDialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField;
import org.eclipse.jdt.internal.ui.wizards.swt.MGridData;
/**
* <code>TypePage</code> contains controls and validation routines for a 'New Type WizardPage'
* Implementors decide which components to add and to enable. Implementors can also
* customize the validation code.
* <code>TypePage</code> is intended to serve as base class of all wizards that create types.
* Applets, Servlets, Classes, Interfaces...
* See <code>NewClassCreationWizardPage</code> or <code>NewInterfaceCreationWizardPage</code> for an
* example usage of TypePage.
*/
public abstract class TypePage extends ContainerPage {
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
private final static String PAGE_NAME= "TypePage";
protected final static String PACKAGE= PAGE_NAME + ".package";
protected final static String ENCLOSING= PAGE_NAME + ".enclosing";
protected final static String ENCLOSINGSELECTION= ENCLOSING + ".selection";
protected final static String TYPENAME= PAGE_NAME + ".typename";
protected final static String SUPER= PAGE_NAME + ".superclass";
protected final static String INTERFACES= PAGE_NAME + ".interfaces";
protected final static String MODIFIERS= PAGE_NAME + ".modifiers";
protected final static String METHODS= PAGE_NAME + ".methods";
private class InterfacesListLabelProvider extends LabelProvider {
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
private Image fInterfaceImage;
public InterfacesListLabelProvider() {
super();
fInterfaceImage= JavaPlugin.getDefault().getImageRegistry().get(JavaPluginImages.IMG_OBJS_INTERFACE);
}
public Image getImage(Object element) {
return fInterfaceImage;
}
}
private StringButtonStatusDialogField fPackageDialogField;
private SelectionButtonDialogField fEnclosingTypeSelection;
private StringButtonDialogField fEnclosingTypeDialogField;
private boolean fCanModifyPackage;
private boolean fCanModifyEnclosingType;
private IPackageFragment fCurrPackage;
private IType fCurrEnclosingType;
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
private StringDialogField fTypeNameDialogField;
private StringButtonDialogField fSuperClassDialogField;
private ListDialogField fSuperInterfacesDialogField;
private IType fSuperClass;
private SelectionButtonDialogFieldGroup fAccMdfButtons;
private SelectionButtonDialogFieldGroup fOtherMdfButtons;
private IType fCreatedType;
protected IStatus fEnclosingTypeStatus;
protected IStatus fPackageStatus;
protected IStatus fTypeNameStatus;
protected IStatus fSuperClassStatus;
protected IStatus fModifierStatus;
protected IStatus fSuperInterfacesStatus;
private boolean fIsClass;
private int fStaticMdfIndex;
private final int PUBLIC_INDEX= 0, DEFAULT_INDEX= 1, PRIVATE_INDEX= 2, PROTECTED_INDEX= 3;
private final int ABSTRACT_INDEX= 0, FINAL_INDEX= 1;
public TypePage(boolean isClass, String pageName, IWorkspaceRoot root) {
super(pageName, root);
fCreatedType= null;
fIsClass= isClass;
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
TypeFieldsAdapter adapter= new TypeFieldsAdapter();
fPackageDialogField= new StringButtonStatusDialogField(adapter);
fPackageDialogField.setDialogFieldListener(adapter);
fPackageDialogField.setLabelText(NewWizardMessages.getString("TypePage.package.label"));
fPackageDialogField.setButtonLabel(NewWizardMessages.getString("TypePage.package.button"));
fPackageDialogField.setStatusWidthHint(NewWizardMessages.getString("TypePage.default"));
fEnclosingTypeSelection= new SelectionButtonDialogField(SWT.CHECK);
fEnclosingTypeSelection.setDialogFieldListener(adapter);
fEnclosingTypeSelection.setLabelText(NewWizardMessages.getString("TypePage.enclosing.selection.label"));
fEnclosingTypeDialogField= new StringButtonDialogField(adapter);
fEnclosingTypeDialogField.setDialogFieldListener(adapter);
fEnclosingTypeDialogField.setButtonLabel(NewWizardMessages.getString("TypePage.enclosing.button"));
fTypeNameDialogField= new StringDialogField();
fTypeNameDialogField.setDialogFieldListener(adapter);
fTypeNameDialogField.setLabelText(NewWizardMessages.getString("TypePage.typename.label"));
fSuperClassDialogField= new StringButtonDialogField(adapter);
fSuperClassDialogField.setDialogFieldListener(adapter);
fSuperClassDialogField.setLabelText(NewWizardMessages.getString("TypePage.superclass.label"));
fSuperClassDialogField.setButtonLabel(NewWizardMessages.getString("TypePage.superclass.button"));
String[] addButtons= new String[] {
NewWizardMessages.getString("TypePage.interfaces.add"),
null,
NewWizardMessages.getString("TypePage.interfaces.remove")
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
};
fSuperInterfacesDialogField= new ListDialogField(adapter, addButtons, new InterfacesListLabelProvider());
fSuperInterfacesDialogField.setDialogFieldListener(adapter);
String interfaceLabel= fIsClass ? NewWizardMessages.getString("TypePage.interfaces.class.label") : NewWizardMessages.getString("TypePage.interfaces.ifc.label");
fSuperInterfacesDialogField.setLabelText(interfaceLabel);
fSuperInterfacesDialogField.setRemoveButtonIndex(2);
String[] buttonNames1= new String[] {
NewWizardMessages.getString("TypePage.modifiers.public"),
NewWizardMessages.getString("TypePage.modifiers.default"),
NewWizardMessages.getString("TypePage.modifiers.private"),
NewWizardMessages.getString("TypePage.modifiers.protected")
};
fAccMdfButtons= new SelectionButtonDialogFieldGroup(SWT.RADIO, buttonNames1, 4);
fAccMdfButtons.setDialogFieldListener(adapter);
fAccMdfButtons.setLabelText(NewWizardMessages.getString("TypePage.modifiers.acc.label"));
fAccMdfButtons.setSelection(0, true);
String[] buttonNames2;
if (fIsClass) {
buttonNames2= new String[] {
NewWizardMessages.getString("TypePage.modifiers.abstract"),
NewWizardMessages.getString("TypePage.modifiers.final"),
NewWizardMessages.getString("TypePage.modifiers.static")
};
fStaticMdfIndex= 2;
} else {
buttonNames2= new String[] {
NewWizardMessages.getString("TypePage.modifiers.static")
};
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
fStaticMdfIndex= 0;
}
fOtherMdfButtons= new SelectionButtonDialogFieldGroup(SWT.CHECK, buttonNames2, 4);
fOtherMdfButtons.setDialogFieldListener(adapter);
fAccMdfButtons.enableSelectionButton(PRIVATE_INDEX, false);
fAccMdfButtons.enableSelectionButton(PROTECTED_INDEX, false);
fOtherMdfButtons.enableSelectionButton(fStaticMdfIndex, false);
fPackageStatus= new StatusInfo();
fEnclosingTypeStatus= new StatusInfo();
fCanModifyPackage= true;
fCanModifyEnclosingType= true;
updateEnableState();
fTypeNameStatus= new StatusInfo();
fSuperClassStatus= new StatusInfo();
fSuperInterfacesStatus= new StatusInfo();
fModifierStatus= new StatusInfo();
}
/**
* Initializes all fields provided by the type page with a given
* Java element as selection.
* @param elem The initial selection of this page or null if no
* selection was available
*/
protected void initTypePage(IJavaElement elem) {
String initSuperclass= "java.lang.Object";
ArrayList initSuperinterfaces= new ArrayList(5);
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
IPackageFragment pack= null;
IType enclosingType= null;
if (elem != null) {
pack= (IPackageFragment) JavaModelUtil.findElementOfKind(elem, IJavaElement.PACKAGE_FRAGMENT);
IType typeInCU= (IType) JavaModelUtil.findElementOfKind(elem, IJavaElement.TYPE);
if (typeInCU != null) {
if (typeInCU.getCompilationUnit() != null) {
enclosingType= typeInCU;
}
} else {
ICompilationUnit cu= (ICompilationUnit) JavaModelUtil.findElementOfKind(elem, IJavaElement.COMPILATION_UNIT);
if (cu != null) {
enclosingType= JavaModelUtil.findPrimaryType(cu);
}
}
try {
IType type= null;
if (elem.getElementType() == IJavaElement.TYPE) {
type= (IType)elem;
if (type.exists()) {
String superName= JavaModelUtil.getFullyQualifiedName(type);
if (type.isInterface()) {
initSuperinterfaces.add(superName);
} else {
initSuperclass= superName;
}
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
}
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
}
}
setPackageFragment(pack, true);
setEnclosingType(enclosingType, true);
setEnclosingTypeSelection(false, true);
setTypeName("", true);
setSuperClass(initSuperclass, true);
setSuperInterfaces(initSuperinterfaces, true);
}
/**
* Creates a separator line.
* @param composite The parent composite
* @param nColumns Number of columns to span
*/
protected void createSeparator(Composite composite, int nColumns) {
(new Separator(SWT.SEPARATOR | SWT.HORIZONTAL)).doFillIntoGrid(composite, nColumns, convertHeightInCharsToPixels(1));
}
/**
* Creates the controls for the package name field.
* @param composite The parent composite
* @param nColumns Number of columns to span
*/
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
protected void createPackageControls(Composite composite, int nColumns) {
fPackageDialogField.doFillIntoGrid(composite, 4);
LayoutUtil.setWidthHint(fPackageDialogField.getTextControl(null), getMaxFieldWidth());
}
/**
* Creates the controls for the enclosing type name field.
* @param composite The parent composite
* @param nColumns Number of columns to span
*/
protected void createEnclosingTypeControls(Composite composite, int nColumns) {
fEnclosingTypeSelection.doFillIntoGrid(composite, 1);
Control c= fEnclosingTypeDialogField.getTextControl(composite);
MGridData gd= new MGridData(MGridData.FILL_HORIZONTAL);
gd.widthHint= getMaxFieldWidth();
gd.horizontalSpan= 2;
c.setLayoutData(gd);
c= fEnclosingTypeDialogField.getChangeControl(composite);
c.setLayoutData(new MGridData(MGridData.HORIZONTAL_ALIGN_FILL));
}
/**
* Creates the controls for the type name field.
* @param composite The parent composite
* @param nColumns Number of columns to span
*/
protected void createTypeNameControls(Composite composite, int nColumns) {
fTypeNameDialogField.doFillIntoGrid(composite, nColumns - 1);
DialogField.createEmptySpace(composite);
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
LayoutUtil.setWidthHint(fTypeNameDialogField.getTextControl(null), getMaxFieldWidth());
}
/**
* Creates the controls for the modifiers radio/ceckbox buttons.
* @param composite The parent composite
* @param nColumns Number of columns to span
*/
protected void createModifierControls(Composite composite, int nColumns) {
LayoutUtil.setHorizontalSpan(fAccMdfButtons.getLabelControl(composite), 1);
Control control= fAccMdfButtons.getSelectionButtonsGroup(composite);
MGridData gd= new MGridData(MGridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan= nColumns - 2;
control.setLayoutData(gd);
DialogField.createEmptySpace(composite);
DialogField.createEmptySpace(composite);
control= fOtherMdfButtons.getSelectionButtonsGroup(composite);
gd= new MGridData(MGridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan= nColumns - 2;
control.setLayoutData(gd);
DialogField.createEmptySpace(composite);
}
/**
* Creates the controls for the superclass name field.
* @param composite The parent composite
* @param nColumns Number of columns to span
*/
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
protected void createSuperClassControls(Composite composite, int nColumns) {
fSuperClassDialogField.doFillIntoGrid(composite, nColumns);
LayoutUtil.setWidthHint(fSuperClassDialogField.getTextControl(null), getMaxFieldWidth());
}
/**
* Creates the controls for the superclass name field.
* @param composite The parent composite
* @param nColumns Number of columns to span
*/
protected void createSuperInterfacesControls(Composite composite, int nColumns) {
fSuperInterfacesDialogField.doFillIntoGrid(composite, nColumns);
MGridData gd= (MGridData)fSuperInterfacesDialogField.getListControl(null).getLayoutData();
if (fIsClass) {
gd.heightHint= convertHeightInCharsToPixels(3);
} else {
gd.heightHint= convertHeightInCharsToPixels(6);
}
gd.grabExcessVerticalSpace= false;
gd.widthHint= getMaxFieldWidth();
}
/**
* Sets the focus on the container if empty, elso on type name.
*/
protected void setFocus() {
fTypeNameDialogField.setFocus();
}
private class TypeFieldsAdapter implements IStringButtonAdapter, IDialogFieldListener, IListAdapter {
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
public void changeControlPressed(DialogField field) {
typePageChangeControlPressed(field);
}
public void customButtonPressed(DialogField field, int index) {
typePageCustomButtonPressed(field, index);
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
public void selectionChanged(DialogField field) {}
public void dialogFieldChanged(DialogField field) {
typePageDialogFieldChanged(field);
}
}
private void typePageChangeControlPressed(DialogField field) {
if (field == fPackageDialogField) {
IPackageFragment pack= choosePackage();
if (pack != null) {
fPackageDialogField.setText(pack.getElementName());
}
} else if (field == fEnclosingTypeDialogField) {
IType type= chooseEnclosingType();
if (type != null) {
fEnclosingTypeDialogField.setText(JavaModelUtil.getFullyQualifiedName(type));
}
} else if (field == fSuperClassDialogField) {
IType type= chooseSuperType();
if (type != null) {
fSuperClassDialogField.setText(JavaModelUtil.getFullyQualifiedName(type));
}
}
}
private void typePageCustomButtonPressed(DialogField field, int index) {
if (field == fSuperInterfacesDialogField) {
chooseSuperInterfaces();
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
}
}
/*
* A field on the type has changed. The fields' status and all dependend
* status are updated.
*/
private void typePageDialogFieldChanged(DialogField field) {
String fieldName= null;
if (field == fPackageDialogField) {
fPackageStatus= packageChanged();
updatePackageStatusLabel();
fTypeNameStatus= typeNameChanged();
fSuperClassStatus= superClassChanged();
fieldName= PACKAGE;
} else if (field == fEnclosingTypeDialogField) {
fEnclosingTypeStatus= enclosingTypeChanged();
fTypeNameStatus= typeNameChanged();
fSuperClassStatus= superClassChanged();
fieldName= ENCLOSING;
} else if (field == fEnclosingTypeSelection) {
updateEnableState();
boolean isEnclosedType= isEnclosingTypeSelected();
if (!isEnclosedType) {
if (fAccMdfButtons.isSelected(PRIVATE_INDEX) || fAccMdfButtons.isSelected(PROTECTED_INDEX)) {
fAccMdfButtons.setSelection(PRIVATE_INDEX, false);
fAccMdfButtons.setSelection(PROTECTED_INDEX, false);
fAccMdfButtons.setSelection(PUBLIC_INDEX, true);
}
if (fOtherMdfButtons.isSelected(fStaticMdfIndex)) {
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
fOtherMdfButtons.setSelection(fStaticMdfIndex, false);
}
}
fAccMdfButtons.enableSelectionButton(PRIVATE_INDEX, isEnclosedType && fIsClass);
fAccMdfButtons.enableSelectionButton(PROTECTED_INDEX, isEnclosedType && fIsClass);
fOtherMdfButtons.enableSelectionButton(fStaticMdfIndex, isEnclosedType);
fTypeNameStatus= typeNameChanged();
fSuperClassStatus= superClassChanged();
fieldName= ENCLOSINGSELECTION;
} else if (field == fTypeNameDialogField) {
fTypeNameStatus= typeNameChanged();
fieldName= TYPENAME;
} else if (field == fSuperClassDialogField) {
fSuperClassStatus= superClassChanged();
fieldName= SUPER;
} else if (field == fSuperInterfacesDialogField) {
fSuperInterfacesStatus= superInterfacesChanged();
fieldName= INTERFACES;
} else if (field == fOtherMdfButtons) {
fModifierStatus= modifiersChanged();
fieldName= MODIFIERS;
} else {
fieldName= METHODS;
}
handleFieldChanged(fieldName);
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
/**
* Called whenever a content of a field has changed.
* Implementors of TypePage can hook in.
* @see ContainerPage#handleFieldChanged
*/
protected void handleFieldChanged(String fieldName) {
super.handleFieldChanged(fieldName);
if (fieldName == CONTAINER) {
fPackageStatus= packageChanged();
fEnclosingTypeStatus= enclosingTypeChanged();
fTypeNameStatus= typeNameChanged();
fSuperClassStatus= superClassChanged();
fSuperInterfacesStatus= superInterfacesChanged();
}
}
/**
* Gets the text of package field.
*/
public String getPackageText() {
return fPackageDialogField.getText();
}
/**
* Gets the text of enclosing type field.
*/
public String getEnclosingTypeText() {
return fEnclosingTypeDialogField.getText();
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
}
/**
* Returns the package fragment corresponding to the current input.
* @return Returns <code>null</code> if the input could not be resolved.
*/
public IPackageFragment getPackageFragment() {
if (!isEnclosingTypeSelected()) {
return fCurrPackage;
} else {
if (fCurrEnclosingType != null) {
return fCurrEnclosingType.getPackageFragment();
}
}
return null;
}
/**
* Sets the package fragment.
* This will update model and the text of the control.
* @param canBeModified Selects if the package fragment can be changed by the user
*/
public void setPackageFragment(IPackageFragment pack, boolean canBeModified) {
fCurrPackage= pack;
fCanModifyPackage= canBeModified;
String str= (pack == null) ? "" : pack.getElementName();
fPackageDialogField.setText(str);
updateEnableState();
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
/**
* Returns the encloding type corresponding to the current input.
* @return Returns <code>null</code> if enclosing type is not selected or the input could not
* be resolved.
*/
public IType getEnclosingType() {
if (isEnclosingTypeSelected()) {
return fCurrEnclosingType;
}
return null;
}
/**
* Sets the package fragment.
* This will update model and the text of the control.
* @param canBeModified Selects if the enclosing type can be changed by the user
*/
public void setEnclosingType(IType type, boolean canBeModified) {
fCurrEnclosingType= type;
fCanModifyEnclosingType= canBeModified;
String str= (type == null) ? "" : JavaModelUtil.getFullyQualifiedName(type);
fEnclosingTypeDialogField.setText(str);
updateEnableState();
}
/**
* Returns <code>true</code> if the enclosing type selection check box is enabled.
*/
public boolean isEnclosingTypeSelected() {
return fEnclosingTypeSelection.isSelected();
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
/**
* Sets the enclosing type selection checkbox.
* @param canBeModified Selects if the enclosing type selection can be changed by the user
*/
public void setEnclosingTypeSelection(boolean isSelected, boolean canBeModified) {
fEnclosingTypeSelection.setSelection(isSelected);
fEnclosingTypeSelection.setEnabled(canBeModified);
updateEnableState();
}
/**
* Gets the type name.
*/
public String getTypeName() {
return fTypeNameDialogField.getText();
}
/**
* Sets the type name.
* @param canBeModified Selects if the type name can be changed by the user
*/
public void setTypeName(String name, boolean canBeModified) {
fTypeNameDialogField.setText(name);
fTypeNameDialogField.setEnabled(canBeModified);
}
/**
* Gets the selected modifiers.
* @see Flags
*/
public int getModifiers() {
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
int mdf= 0;
if (fAccMdfButtons.isSelected(PUBLIC_INDEX)) {
mdf+= IConstants.AccPublic;
} else if (fAccMdfButtons.isSelected(PRIVATE_INDEX)) {
mdf+= IConstants.AccPrivate;
} else if (fAccMdfButtons.isSelected(PROTECTED_INDEX)) {
mdf+= IConstants.AccProtected;
}
if (fOtherMdfButtons.isSelected(ABSTRACT_INDEX) && (fStaticMdfIndex != 0)) {
mdf+= IConstants.AccAbstract;
}
if (fOtherMdfButtons.isSelected(FINAL_INDEX)) {
mdf+= IConstants.AccFinal;
}
if (fOtherMdfButtons.isSelected(fStaticMdfIndex)) {
mdf+= IConstants.AccStatic;
}
return mdf;
}
/**
* Sets the modifiers.
* @param canBeModified Selects if the modifiers can be changed by the user
* @see IConstants
*/
public void setModifiers(int modifiers, boolean canBeModified) {
if (Flags.isPublic(modifiers)) {
fAccMdfButtons.setSelection(PUBLIC_INDEX, true);
} else if (Flags.isPrivate(modifiers)) {
fAccMdfButtons.setSelection(PRIVATE_INDEX, true);
} else if (Flags.isProtected(modifiers)) {
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
fAccMdfButtons.setSelection(PROTECTED_INDEX, true);
} else {
fAccMdfButtons.setSelection(DEFAULT_INDEX, true);
}
if (Flags.isAbstract(modifiers)) {
fOtherMdfButtons.setSelection(ABSTRACT_INDEX, true);
}
if (Flags.isFinal(modifiers)) {
fOtherMdfButtons.setSelection(FINAL_INDEX, true);
}
if (Flags.isStatic(modifiers)) {
fOtherMdfButtons.setSelection(fStaticMdfIndex, true);
}
fAccMdfButtons.setEnabled(canBeModified);
fOtherMdfButtons.setEnabled(canBeModified);
}
/**
* Gets the content of the super class text field.
*/
public String getSuperClass() {
return fSuperClassDialogField.getText();
}
/**
* Sets the super class name.
* @param canBeModified Selects if the super class can be changed by the user
*/
public void setSuperClass(String name, boolean canBeModified) {
fSuperClassDialogField.setText(name);
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
fSuperClassDialogField.setEnabled(canBeModified);
}
/**
* Gets the currently chosen super interfaces.
* @return returns a list of String
*/
public List getSuperInterfaces() {
return fSuperInterfacesDialogField.getElements();
}
/**
* Sets the super interfaces.
* @param interfacesNames a list of String
*/
public void setSuperInterfaces(List interfacesNames, boolean canBeModified) {
fSuperInterfacesDialogField.setElements(interfacesNames);
fSuperInterfacesDialogField.setEnabled(canBeModified);
}
/**
* Called when the package field has changed.
* The method validates the package name and returns the status of the validation
* This also updates the package fragment model.
* Can be extended to add more validation
*/
protected IStatus packageChanged() {
StatusInfo status= new StatusInfo();
fPackageDialogField.enableButton(getPackageFragmentRoot() != null);
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
String packName= getPackageText();
if (packName.length() > 0) {
IStatus val= JavaConventions.validatePackageName(packName);
if (val.getSeverity() == IStatus.ERROR) {
status.setError(NewWizardMessages.getFormattedString("TypePage.error.InvalidPackageName", val.getMessage()));
return status;
} else if (val.getSeverity() == IStatus.WARNING) {
status.setWarning(NewWizardMessages.getFormattedString("TypePage.warning.DiscouragedPackageName", val.getMessage()));
}
}
IPackageFragmentRoot root= getPackageFragmentRoot();
if (root != null) {
IPackageFragment pack= root.getPackageFragment(packName);
try {
IPath rootPath= root.getPath();
IPath outputPath= root.getJavaProject().getOutputLocation();
if (rootPath.isPrefixOf(outputPath) && !rootPath.equals(outputPath)) {
IPath packagePath= pack.getUnderlyingResource().getFullPath();
if (outputPath.isPrefixOf(packagePath)) {
status.setError(NewWizardMessages.getString("TypePage.error.ClashOutputLocation"));
return status;
}
}
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
}
fCurrPackage= pack;
} else {
status.setError("");
}
return status;
}
/*
* Updates the 'default' label next to the package field.
*/
private void updatePackageStatusLabel() {
String packName= fPackageDialogField.getText();
if (packName.length() == 0) {
fPackageDialogField.setStatus(NewWizardMessages.getString("TypePage.default"));
} else {
fPackageDialogField.setStatus("");
}
}
/*
* Updates the enable state of buttons related to the enclosing type selection checkbox.
*/
private void updateEnableState() {
boolean enclosing= isEnclosingTypeSelected();
fPackageDialogField.setEnabled(fCanModifyPackage && !enclosing);
fEnclosingTypeDialogField.setEnabled(fCanModifyEnclosingType && enclosing);
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
/**
* Called when the enclosing type name has changed.
* The method validates the enclosing type and returns the status of the validation
* This also updates the enclosing type model.
* Can be extended to add more validation
*/
protected IStatus enclosingTypeChanged() {
StatusInfo status= new StatusInfo();
fCurrEnclosingType= null;
IPackageFragmentRoot root= getPackageFragmentRoot();
fEnclosingTypeDialogField.enableButton(root != null);
if (root == null) {
status.setError("");
return status;
}
String enclName= getEnclosingTypeText();
if (enclName.length() == 0) {
status.setError(NewWizardMessages.getString("TypePage.error.EnclosingTypeEnterName"));
return status;
}
try {
IType type= JavaModelUtil.findType(root.getJavaProject(), enclName);
if (type == null) {
status.setError(NewWizardMessages.getString("TypePage.error.EnclosingTypeNotExists"));
return status;
}
if (type.getCompilationUnit() == null) {
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
status.setError(NewWizardMessages.getString("TypePage.error.EnclosingNotInCU"));
return status;
}
fCurrEnclosingType= type;
return status;
} catch (JavaModelException e) {
status.setError(NewWizardMessages.getString("TypePage.error.EnclosingTypeNotExists"));
JavaPlugin.log(e.getStatus());
return status;
}
}
/**
* Called when the type name has changed.
* The method validates the type name and returns the status of the validation.
* Can be extended to add more validation
*/
protected IStatus typeNameChanged() {
StatusInfo status= new StatusInfo();
String typeName= getTypeName();
if (typeName.length() == 0) {
status.setError(NewWizardMessages.getString("TypePage.error.EnterTypeName"));
return status;
}
if (typeName.indexOf('.') != -1) {
status.setError(NewWizardMessages.getString("TypePage.error.QualifiedName"));
return status;
}
IStatus val= JavaConventions.validateJavaTypeName(typeName);
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
if (val.getSeverity() == IStatus.ERROR) {
status.setError(NewWizardMessages.getFormattedString("TypePage.error.InvalidTypeName", val.getMessage()));
return status;
} else if (val.getSeverity() == IStatus.WARNING) {
status.setWarning(NewWizardMessages.getFormattedString("TypePage.warning.TypeNameDiscouraged", val.getMessage()));
}
if (!isEnclosingTypeSelected()) {
IPackageFragment pack= getPackageFragment();
if (pack != null) {
ICompilationUnit cu= pack.getCompilationUnit(typeName + ".java");
if (cu.exists()) {
status.setError(NewWizardMessages.getString("TypePage.error.TypeNameExists"));
return status;
}
}
} else {
IType type= getEnclosingType();
if (type != null) {
IType member= type.getType(typeName);
if (member.exists()) {
status.setError(NewWizardMessages.getString("TypePage.error.TypeNameExists"));
return status;
}
}
}
return status;
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
/**
* Called when the superclass name has changed.
* The method validates the superclass name and returns the status of the validation.
* Can be extended to add more validation
*/
protected IStatus superClassChanged() {
StatusInfo status= new StatusInfo();
IPackageFragmentRoot root= getPackageFragmentRoot();
fSuperClassDialogField.enableButton(root != null);
fSuperClass= null;
String sclassName= getSuperClass();
if (sclassName.length() == 0) {
return status;
}
IStatus val= JavaConventions.validateJavaTypeName(sclassName);
if (!val.isOK()) {
status.setError(NewWizardMessages.getString("TypePage.error.InvalidSuperClassName"));
return status;
}
if (root != null) {
try {
IType type= resolveSuperTypeName(root.getJavaProject(), sclassName);
if (type == null) {
status.setWarning(NewWizardMessages.getString("TypePage.warning.SuperClassNotExists"));
return status;
} else {
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
if (type.isInterface()) {
status.setWarning(NewWizardMessages.getFormattedString("TypePage.warning.SuperClassIsNotClass", sclassName));
return status;
}
int flags= type.getFlags();
if (Flags.isFinal(flags)) {
status.setWarning(NewWizardMessages.getFormattedString("TypePage.warning.SuperClassIsFinal", sclassName));
return status;
} else if (!JavaModelUtil.isVisible(type, getPackageFragment())) {
status.setWarning(NewWizardMessages.getFormattedString("TypePage.warning.SuperClassIsNotVisible", sclassName));
return status;
}
}
fSuperClass= type;
} catch (JavaModelException e) {
status.setError(NewWizardMessages.getString("TypePage.error.InvalidSuperClassName"));
JavaPlugin.log(e.getStatus());
}
} else {
status.setError("");
}
return status;
}
private IType resolveSuperTypeName(IJavaProject jproject, String sclassName) throws JavaModelException {
IType type= null;
if (isEnclosingTypeSelected()) {
IType enclosingType= getEnclosingType();
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
if (enclosingType != null) {
String[][] res= enclosingType.resolveType(sclassName);
if (res != null && res.length > 0) {
type= JavaModelUtil.findType(jproject, res[0][0], res[0][1]);
}
}
} else {
IPackageFragment currPack= getPackageFragment();
if (type == null && currPack != null) {
String packName= currPack.getElementName();
if (!currPack.isDefaultPackage()) {
type= JavaModelUtil.findType(jproject, packName, sclassName);
}
if (type == null && !"java.lang".equals(packName)) {
type= JavaModelUtil.findType(jproject, "java.lang", sclassName);
}
}
if (type == null) {
type= JavaModelUtil.findType(jproject, sclassName);
}
}
return type;
}
/**
* Called when the list of super interface has changed.
* The method validates the superinterfaces and returns the status of the validation.
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
* Can be extended to add more validation.
*/
protected IStatus superInterfacesChanged() {
StatusInfo status= new StatusInfo();
IPackageFragmentRoot root= getPackageFragmentRoot();
fSuperInterfacesDialogField.enableButton(0, root != null);
if (root != null) {
List elements= fSuperInterfacesDialogField.getElements();
int nElements= elements.size();
for (int i= 0; i < nElements; i++) {
String intfname= (String)elements.get(i);
try {
IType type= JavaModelUtil.findType(root.getJavaProject(), intfname);
if (type == null) {
status.setWarning(NewWizardMessages.getFormattedString("TypePage.warning.InterfaceNotExists", intfname));
return status;
} else {
if (type.isClass()) {
status.setWarning(NewWizardMessages.getFormattedString("TypePage.warning.InterfaceIsNotInterface", intfname));
return status;
}
if (!JavaModelUtil.isVisible(type, getPackageFragment())) {
status.setWarning(NewWizardMessages.getFormattedString("TypePage.warning.InterfaceIsNotVisible", intfname));
return status;
}
}
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
}
}
}
return status;
}
/**
* Called when the modifiers have changed.
* The method validates the modifiers and returns the status of the validation.
* Can be extended to add more validation.
*/
protected IStatus modifiersChanged() {
StatusInfo status= new StatusInfo();
int modifiers= getModifiers();
if (Flags.isFinal(modifiers) && Flags.isAbstract(modifiers)) {
status.setError(NewWizardMessages.getString("TypePage.error.ModifiersFinalAndAbstract"));
}
return status;
}
private IPackageFragment choosePackage() {
IPackageFragmentRoot froot= getPackageFragmentRoot();
IJavaElement[] packages= null;
try {
if (froot != null) {
packages= froot.getChildren();
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
} catch (JavaModelException e) {
}
if (packages == null) {
packages= new IJavaElement[0];
}
ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT));
dialog.setIgnoreCase(false);
dialog.setTitle(NewWizardMessages.getString("TypePage.ChoosePackageDialog.title"));
dialog.setMessage(NewWizardMessages.getString("TypePage.ChoosePackageDialog.description"));
dialog.setEmptyListMessage(NewWizardMessages.getString("TypePage.ChoosePackageDialog.empty"));
dialog.setElements(packages);
if (fCurrPackage != null) {
dialog.setInitialSelections(new Object[] { fCurrPackage });
}
if (dialog.open() == dialog.OK) {
return (IPackageFragment) dialog.getFirstResult();
}
return null;
}
private IType chooseEnclosingType() {
IPackageFragmentRoot root= getPackageFragmentRoot();
if (root == null) {
return null;
}
IJavaElement[] elements= new IJavaElement[] { root.getJavaProject() };
IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements);
TypeSelectionDialog dialog= new TypeSelectionDialog(getShell(), getWizard().getContainer(), scope, IJavaElementSearchConstants.CONSIDER_TYPES);
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
dialog.setTitle(NewWizardMessages.getString("TypePage.ChooseEnclosingTypeDialog.title"));
dialog.setMessage(NewWizardMessages.getString("TypePage.ChooseEnclosingTypeDialog.description"));
if (fCurrEnclosingType != null) {
dialog.setInitialSelections(new Object[] { fCurrEnclosingType });
dialog.setFilter(fCurrEnclosingType.getElementName().substring(0, 1));
}
if (dialog.open() == dialog.OK) {
return (IType) dialog.getFirstResult();
}
return null;
}
private IType chooseSuperType() {
IPackageFragmentRoot root= getPackageFragmentRoot();
if (root == null) {
return null;
}
IJavaElement[] elements= new IJavaElement[] { root.getJavaProject() };
IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements);
TypeSelectionDialog dialog= new TypeSelectionDialog(getShell(), getWizard().getContainer(), scope, IJavaElementSearchConstants.CONSIDER_CLASSES);
dialog.setTitle(NewWizardMessages.getString("TypePage.SuperClassDialog.title"));
dialog.setMessage(NewWizardMessages.getString("TypePage.SuperClassDialog.message"));
if (fSuperClass != null) {
dialog.setFilter(fSuperClass.getElementName());
}
if (dialog.open() == dialog.OK) {
return (IType) dialog.getFirstResult();
}
return null;
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
}
private void chooseSuperInterfaces() {
IPackageFragmentRoot root= getPackageFragmentRoot();
if (root == null) {
return;
}
IJavaProject project= root.getJavaProject();
SuperInterfaceSelectionDialog dialog= new SuperInterfaceSelectionDialog(getShell(), getWizard().getContainer(), fSuperInterfacesDialogField, project);
dialog.setTitle(NewWizardMessages.getString("TypePage.InterfacesDialog.title"));
dialog.setMessage(NewWizardMessages.getString("TypePage.InterfacesDialog.message"));
dialog.open();
return;
}
/**
* Creates a type using the current field values.
*/
public void createType(IProgressMonitor monitor) throws CoreException, InterruptedException {
monitor.beginTask(NewWizardMessages.getString("TypePage.operationdesc"), 10);
IPackageFragmentRoot root= getPackageFragmentRoot();
IPackageFragment pack= getPackageFragment();
if (pack == null) {
pack= root.getPackageFragment("");
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
if (!pack.exists()) {
String packName= pack.getElementName();
pack= root.createPackageFragment(packName, true, null);
}
monitor.worked(1);
String clName= fTypeNameDialogField.getText();
boolean isInnerClass= isEnclosingTypeSelected();
IType createdType;
ImportsStructure imports;
int indent= 0;
String[] prefOrder= ImportOrganizePreferencePage.getImportOrderPreference();
int threshold= ImportOrganizePreferencePage.getImportNumberThreshold();
String lineDelimiter= null;
if (!isInnerClass) {
ICompilationUnit parentCU= pack.getCompilationUnit(clName + ".java");
imports= new ImportsStructure(parentCU, prefOrder, threshold, false);
lineDelimiter= StubUtility.getLineDelimiterUsed(parentCU);
String content= createTypeBody(imports, lineDelimiter);
createdType= parentCU.createType(content, null, false, new SubProgressMonitor(monitor, 5));
String fileComment= getFileComment();
if (fileComment != null) {
parentCU.getBuffer().replace(0, 0, fileComment + lineDelimiter);
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
} else {
IType enclosingType= getEnclosingType();
IType workingCopy= (IType) EditorUtility.getWorkingCopy(enclosingType);
if (workingCopy != null) {
enclosingType= workingCopy;
}
ICompilationUnit parentCU= enclosingType.getCompilationUnit();
imports= new ImportsStructure(parentCU, prefOrder, threshold, true);
lineDelimiter= StubUtility.getLineDelimiterUsed(enclosingType);
String content= createTypeBody(imports, lineDelimiter);
IJavaElement[] elems= enclosingType.getChildren();
IJavaElement sibling= elems.length > 0 ? elems[0] : null;
createdType= enclosingType.createType(content, sibling, false, new SubProgressMonitor(monitor, 1));
indent= StubUtility.getIndentUsed(enclosingType) + 1;
}
imports.create(!isInnerClass, new SubProgressMonitor(monitor, 1));
String[] methods= evalMethods(createdType, imports, new SubProgressMonitor(monitor, 1));
if (methods.length > 0) {
for (int i= 0; i < methods.length; i++) {
createdType.createMethod(methods[i], null, false, null);
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
imports.create(!isInnerClass, null);
}
monitor.worked(1);
ICompilationUnit cu= createdType.getCompilationUnit();
ISourceRange range;
if (isInnerClass) {
synchronized(cu) {
cu.reconcile();
}
range= createdType.getSourceRange();
} else {
range= cu.getSourceRange();
}
IBuffer buf= cu.getBuffer();
String originalContent= buf.getText(range.getOffset(), range.getLength());
String formattedContent= StubUtility.codeFormat(originalContent, indent, lineDelimiter);
buf.replace(range.getOffset(), range.getLength(), formattedContent);
if (!isInnerClass) {
buf.save(new SubProgressMonitor(monitor, 1), false);
} else {
monitor.worked(1);
}
fCreatedType= createdType;
monitor.done();
}
/**
* Returns the created type. Only valid after createType has been invoked
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
*/
public IType getCreatedType() {
return fCreatedType;
}
private void writeSuperClass(StringBuffer buf, IImportsStructure imports) {
String typename= getSuperClass();
if (fIsClass && typename.length() > 0 && !"java.lang.Object".equals(typename)) {
buf.append(" extends ");
buf.append(Signature.getSimpleName(typename));
if (fSuperClass != null) {
imports.addImport(JavaModelUtil.getFullyQualifiedName(fSuperClass));
} else {
imports.addImport(typename);
}
}
}
private void writeSuperInterfaces(StringBuffer buf, IImportsStructure imports) {
List interfaces= getSuperInterfaces();
int last= interfaces.size() - 1;
if (last >= 0) {
if (fIsClass) {
buf.append(" implements ");
} else {
buf.append(" extends ");
}
for (int i= 0; i <= last; i++) {
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
String typename= (String) interfaces.get(i);
imports.addImport(typename);
buf.append(Signature.getSimpleName(typename));
if (i < last) {
buf.append(", ");
}
}
}
}
/*
* Called from createType to construct the source for this type
*/
private String createTypeBody(IImportsStructure imports, String lineDelimiter) {
StringBuffer buf= new StringBuffer();
String typeComment= getTypeComment();
if (typeComment != null) {
buf.append(typeComment);
buf.append(lineDelimiter);
}
int modifiers= getModifiers();
buf.append(Flags.toString(modifiers));
if (modifiers != 0) {
buf.append(' ');
}
buf.append(fIsClass ? "class " : "interface ");
buf.append(getTypeName());
writeSuperClass(buf, imports);
writeSuperInterfaces(buf, imports);
buf.append(" {");
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
buf.append(lineDelimiter);
buf.append(lineDelimiter);
buf.append('}');
buf.append(lineDelimiter);
return buf.toString();
}
/**
* Called from createType to allow adding methods for the newly created type
* Returns array of sources of the methods that have to be added
* @param parent The type where the methods will be added to
*/
protected String[] evalMethods(IType parent, IImportsStructure imports, IProgressMonitor monitor) throws CoreException {
return new String[0];
}
/**
* Called from createType to get a file comment. By default the content of template
* 'filecomment' is taken.
* Returns source or null, if no file comment should be added
*/
protected String getFileComment() {
if (CodeGenerationPreferencePage.doFileComments()) {
return getTemplate("filecomment");
}
return null;
}
/**
* Called from createType to get a type comment.
* Returns source or null, if no type comment should be added
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
*/
protected String getTypeComment() {
if (CodeGenerationPreferencePage.doCreateComments()) {
return getTemplate("typecomment");
}
return null;
}
protected String getTemplate(String name) {
Template[] templates= Templates.getInstance().getTemplates();
for (int i= 0; i < templates.length; i++) {
if (name.equals(templates[i].getName())) {
return templates[i].getPattern();
}
}
return null;
}
/**
* Creates the bodies of all unimplemented methods or/and all constructors
* Can be used by implementors of TypePage to add method stub checkboxes
*/
protected String[] constructInheritedMethods(IType type, boolean doConstructors, boolean doUnimplementedMethods, IImportsStructure imports, IProgressMonitor monitor) throws CoreException {
List newMethods= new ArrayList();
ITypeHierarchy hierarchy= type.newSupertypeHierarchy(monitor);
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
if (doConstructors) {
IType superclass= hierarchy.getSuperclass(type);
if (superclass != null) {
StubUtility.evalConstructors(type, superclass, settings, newMethods, imports);
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
|
}
}
if (doUnimplementedMethods) {
StubUtility.evalUnimplementedMethods(type, hierarchy, false, settings, newMethods, imports);
}
return (String[]) newMethods.toArray(new String[newMethods.size()]);
}
/**
* @see NewElementWizardPage#getRunnable
*/
public IRunnableWithProgress getRunnable() {
return new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
if (monitor == null) {
monitor= new NullProgressMonitor();
}
createType(monitor);
} catch (CoreException e) {
throw new InvocationTargetException(e);
}
}
};
}
}
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/ITypeHierarchyViewPart.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.ui;
import org.eclipse.ui.IViewPart;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IType;
/**
* The standard type hierarchy view presents a type hierarchy for a given input class
* or interface. Visually, this view consists of a pair of viewers, one showing the type
* hierarchy, the other showing the members of the type selected in the first.
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @see JavaUI#ID_TYPE_HIERARCHY
*/
public interface ITypeHierarchyViewPart extends IViewPart {
/**
* Sets the input element of this type hierarchy view to a type.
*
* @param type the input element of this type hierarchy view, or <code>null</code>
* to clear any input element
* @deprecated use getInputElement instead
|
6,638 |
Bug 6638 "Add Method Overrides" menu pick
|
It would be nice to have an "Add Method Overrides" menu pick (analogous to the "Add Unimplemented Methods" menu pick in certain context menus) that would bring up a selection box of currently-unoverridden base-class methods and insert stubs for the selected methods.
|
verified fixed
|
3042550
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-13T18:58:39Z | 2001-12-06T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/ITypeHierarchyViewPart.java
|
*/
public void setInput(IType type);
/**
* Sets the input element of this type hierarchy view. The element must be of type
* <code>IType</code> or <code>IPackageFragment</code>.
*
* @param type the input element of this type hierarchy view, or <code>null</code>
* to clear any input element
*/
public void setInputElement(IJavaElement element);
/**
* Returns the input element of this type hierarchy view
*
* @return the input element, or <code>null</code> if no input element is set
* or the input is not a type
* @see #setInput
* @deprecated use getInputElement instead
*/
public IType getInput();
/**
* Returns the input element of this type hierarchy view.
*
* @return the input element, or <code>null</code> if no input element is set
* @see #setInput
*/
public IJavaElement getInputElement();
}
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.actions;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.corext.codemanipulation.AddMethodStubOperation;
import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
import org.eclipse.jdt.internal.corext.codemanipulation.IRequestQuery;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
|
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabels;
/**
* Creates method stubs in a type.
* The type has to be set before usage (init)
* Always forces the type to open in an editor. The result is unsaved,
* so the user can decide if the changes are acceptable.
*/
public class AddMethodStubAction extends Action {
private ISelection fSelection;
private IType fParentType;
public AddMethodStubAction() {
super(JavaUIMessages.getString("AddMethodStubAction.label"));
setDescription(JavaUIMessages.getString("AddMethodStubAction.description"));
setToolTipText(JavaUIMessages.getString("AddMethodStubAction.tooltip"));
WorkbenchHelp.setHelp(this, new Object[] { IJavaHelpContextIds.ADD_METHODSTUB_ACTION });
}
public boolean init(IType parentType, ISelection selection) {
if (canActionBeAdded(parentType, selection)) {
fParentType= parentType;
fSelection= selection;
if (parentType != null) {
setText(JavaUIMessages.getFormattedString("AddMethodStubAction.detailedlabel", parentType.getElementName()));
} else {
setText(JavaUIMessages.getString("AddMethodStubAction.label"));
}
return true;
}
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
|
fParentType= null;
fSelection= null;
return false;
}
public void run() {
if (!canActionBeAdded(fParentType, fSelection)) {
return;
}
Shell shell= JavaPlugin.getActiveWorkbenchShell();
try {
IEditorPart editor= EditorUtility.openInEditor(fParentType);
IType usedType= (IType)EditorUtility.getWorkingCopy(fParentType);
if (usedType == null) {
MessageDialog.openError(shell, JavaUIMessages.getString("AddMethodStubAction.error.title"), JavaUIMessages.getString("AddMethodStubAction.error.type_removed_in_editor"));
return;
}
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
List list= ((IStructuredSelection)fSelection).toList();
IMethod[] methods= (IMethod[]) list.toArray(new IMethod[list.size()]);
AddMethodStubOperation op= new AddMethodStubOperation(usedType, methods, settings, createOverrideQuery(), createReplaceQuery(), false);
ProgressMonitorDialog dialog= new ProgressMonitorDialog(shell);
dialog.run(false, true, new WorkbenchRunnableAdapter(op));
IMethod[] res= op.getCreatedMethods();
if (res != null && res.length > 0 && editor != null) {
EditorUtility.revealInEditor(editor, res[0]);
}
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
|
} catch (InvocationTargetException e) {
MessageDialog.openError(shell, JavaUIMessages.getString("AddMethodStubAction.error.title"), e.getTargetException().getMessage());
JavaPlugin.log(e.getTargetException());
} catch (CoreException e) {
ErrorDialog.openError(shell, JavaUIMessages.getString("AddMethodStubAction.error.title"), null, e.getStatus());
JavaPlugin.log(e.getStatus());
} catch (InterruptedException e) {
}
}
private IRequestQuery createOverrideQuery() {
return new IRequestQuery() {
public int doQuery(IMember method) {
String methodName= JavaElementLabels.getElementLabel(method, JavaElementLabels.M_PARAMETER_TYPES);
String declTypeName= JavaElementLabels.getElementLabel(method.getDeclaringType(), 0);
String formattedMessage;
try {
if (Flags.isFinal(method.getFlags())) {
formattedMessage= JavaUIMessages.getFormattedString("AddMethodStubAction.OverridesFinalDialog.message", new String[] { methodName, declTypeName });
} else {
formattedMessage= JavaUIMessages.getFormattedString("AddMethodStubAction.OverridesPrivateDialog.message", new String[] { methodName, declTypeName });
}
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
return IRequestQuery.CANCEL;
}
return showQueryDialog(formattedMessage);
}
};
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
|
}
private IRequestQuery createReplaceQuery() {
return new IRequestQuery() {
public int doQuery(IMember method) {
String methodName= JavaElementLabels.getElementLabel(method, JavaElementLabels.M_PARAMETER_TYPES);
String formattedMessage= JavaUIMessages.getFormattedString("AddMethodStubAction.ReplaceExistingDialog.message", methodName);
return showQueryDialog(formattedMessage);
}
};
}
private int showQueryDialog(final String message) {
int[] returnCodes= {IRequestQuery.YES, IRequestQuery.NO, IRequestQuery.YES_ALL, IRequestQuery.CANCEL};
final Shell shell= JavaPlugin.getActiveWorkbenchShell();
if (shell == null) {
JavaPlugin.logErrorMessage("AddMethodStubAction.showQueryDialog: No active shell found");
return IRequestQuery.CANCEL;
}
final int[] result= { MessageDialog.CANCEL };
shell.getDisplay().syncExec(new Runnable() {
public void run() {
String title= JavaUIMessages.getString("AddMethodStubAction.QueryDialog.title");
String[] options= {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.CANCEL_LABEL};
MessageDialog dialog= new MessageDialog(shell, title, null, message, MessageDialog.QUESTION, options, 0);
result[0]= dialog.open();
}
});
int returnVal= result[0];
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
|
return returnVal < 0 ? IRequestQuery.CANCEL : returnCodes[returnVal];
}
/**
* Tests if the action can run with given arguments
*/
public static boolean canActionBeAdded(IType parentType, ISelection selection) {
if (parentType == null || parentType.getCompilationUnit() == null ||
!(selection instanceof IStructuredSelection) || selection.isEmpty()) {
return false;
}
Object[] elems= ((IStructuredSelection)selection).toArray();
int nSelected= elems.length;
if (nSelected > 0) {
for (int i= 0; i < nSelected; i++) {
Object elem= elems[i];
if (!(elem instanceof IMethod)) {
return false;
}
IMethod meth= (IMethod)elem;
if (meth.getDeclaringType().equals(parentType)) {
return false;
}
}
return true;
}
return false;
}
}
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddUnimplementedMethodsAction.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.actions;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorPart;
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddUnimplementedMethodsAction.java
|
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.corext.codemanipulation.AddUnimplementedMethodsOperation;
import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext;
/**
* Evaluates unimplemented methods of a type.
* Will open an editor for the type. Changes are unsaved.
*/
public class AddUnimplementedMethodsAction extends Action {
private ISelectionProvider fSelectionProvider;
public AddUnimplementedMethodsAction(ISelectionProvider selProvider) {
super(JavaUIMessages.getString("AddUnimplementedMethodsAction.label"));
setDescription(JavaUIMessages.getString("AddUnimplementedMethodsAction.description"));
setToolTipText(JavaUIMessages.getString("AddUnimplementedMethodsAction.tooltip"));
fSelectionProvider= selProvider;
WorkbenchHelp.setHelp(this, new Object[] { IJavaHelpContextIds.ADD_UNIMPLEMENTED_METHODS_ACTION });
}
public void run() {
Shell shell= JavaPlugin.getActiveWorkbenchShell();
try {
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddUnimplementedMethodsAction.java
|
IType type= getSelectedType();
if (type == null) {
return;
}
IEditorPart editor= EditorUtility.openInEditor(type);
type= (IType)EditorUtility.getWorkingCopy(type);
if (type == null) {
MessageDialog.openError(shell, JavaUIMessages.getString("AddUnimplementedMethodsAction.error.title"), JavaUIMessages.getString("AddUnimplementedMethodsAction.error.type_removed_in_editor"));
return;
}
ImplementMethodQuery selectionQuery= new ImplementMethodQuery(shell, false);
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
AddUnimplementedMethodsOperation op= new AddUnimplementedMethodsOperation(type, settings, selectionQuery, false);
try {
BusyIndicatorRunnableContext context= new BusyIndicatorRunnableContext();
context.run(false, true, new WorkbenchRunnableAdapter(op));
IMethod[] res= op.getCreatedMethods();
if (res == null || res.length == 0) {
MessageDialog.openInformation(shell, JavaUIMessages.getString("AddUnimplementedMethodsAction.error.title"), JavaUIMessages.getString("AddUnimplementedMethodsAction.error.nothing_found"));
} else if (editor != null) {
EditorUtility.revealInEditor(editor, res[0]);
}
} catch (InvocationTargetException e) {
JavaPlugin.log(e);
MessageDialog.openError(shell, JavaUIMessages.getString("AddUnimplementedMethodsAction.error.title"), e.getTargetException().getMessage());
} catch (InterruptedException e) {
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddUnimplementedMethodsAction.java
|
}
} catch (CoreException e) {
JavaPlugin.log(e);
ErrorDialog.openError(shell, JavaUIMessages.getString("AddUnimplementedMethodsAction.error.title"), null, e.getStatus());
}
}
private IType getSelectedType() throws JavaModelException {
ISelection sel= fSelectionProvider.getSelection();
if (sel instanceof IStructuredSelection) {
Object[] elements= ((IStructuredSelection)sel).toArray();
if (elements.length == 1 && (elements[0] instanceof IType)) {
IType type= (IType) elements[0];
if (type.getCompilationUnit() != null && type.isClass()) {
return type;
}
}
}
return null;
}
public boolean canActionBeAdded() {
try {
return getSelectedType() != null;
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
}
return false;
}
}
|
3,523 |
Bug 3523 'Override in ...' should be renamed to 'Implement in...' for interfaces (1G4CNPH)
|
AK (11/13/00 12:30:39 PM) if i select a method in a superinterface of my class i want to "implement" it, not "override" it. however, since interfaces "extend" other interfaces, not "implement them", in interfaces you "override" methods from superinterfaces. (would have to check that one in the lang spec) NOTES: EG (24.07.2001 23:28:38) we have gone back and forth on the name, should do one more iteration. MA (07.08.2001 15:43:40) The name is 'Create in ...' now, and for works for interfaces / classes, for super or sub types. EG(13.08.2001 12:16:32) "Create in" isn't intuitive to me. Why can't the string be more sensitive?
|
verified fixed
|
460d05b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-14T14:35:21Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ImplementMethodQuery.java
|
package org.eclipse.jdt.internal.ui.actions;
import java.util.ArrayList;
import java.util.HashSet;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.ITypeHierarchy;
import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jdt.internal.corext.codemanipulation.IImplementMethodQuery;
import org.eclipse.jdt.internal.ui.dialogs.CheckedTreeSelectionDialog;
import org.eclipse.jdt.internal.ui.dialogs.ISelectionValidator;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
public class ImplementMethodQuery implements IImplementMethodQuery {
private static class ImplementMethodContentProvider implements ITreeContentProvider {
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.