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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
/**
* Gets the typeComparator.
* @return Returns a JavaElementTypeComparator
*/
protected Comparator getTypeComparator() {
return fTypeComparator;
}
/**
* Links to editor (if option enabled)
*/
private void linkToEditor(IStructuredSelection selection) {
if (selection == null || selection.isEmpty())
return;
Object obj= selection.getFirstElement();
Object element= null;
if (selection.size() == 1) {
if (obj instanceof IJavaElement) {
IJavaElement cu= ((IJavaElement)obj).getAncestor(IJavaElement.COMPILATION_UNIT);
if (cu != null)
element= getResourceFor(cu);
if (element == null)
element= ((IJavaElement)obj).getAncestor(IJavaElement.CLASS_FILE);
}
else if (obj instanceof IFile)
element= obj;
if (element == null)
return;
IWorkbenchPage page= getSite().getPage();
IEditorPart editorArray[]= page.getEditors();
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
for (int i= 0; i < editorArray.length; ++i) {
IEditorPart editor= editorArray[i];
Object input= getElementOfInput(editor.getEditorInput());
if (input != null && input.equals(element)) {
page.bringToTop(editor);
if (obj instanceof IJavaElement)
EditorUtility.revealInEditor(editor, (IJavaElement) obj);
return;
}
}
}
}
private void setSelectionFromEditor(IWorkbenchPart part) {
if (part == null)
return;
IWorkbenchPartSite site= part.getSite();
if (site == null)
return;
ISelectionProvider provider= site.getSelectionProvider();
if (provider != null)
setSelectionFromEditor(part, provider.getSelection());
}
private void setSelectionFromEditor(IWorkbenchPart part, ISelection selection) {
if (part instanceof IEditorPart && JavaBrowsingPreferencePage.linkViewSelectionToEditor()) {
IEditorInput ei= ((IEditorPart)part).getEditorInput();
if (selection instanceof ITextSelection) {
int offset= ((ITextSelection)selection).getOffset();
IJavaElement element= getElementForInputAt(ei, offset);
if (element != null) {
adjustInputAndSetSelection(element);
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
return;
}
}
if (ei instanceof IFileEditorInput) {
IFile file= ((IFileEditorInput)ei).getFile();
IJavaElement je= (IJavaElement)file.getAdapter(IJavaElement.class);
if (je == null) {
setSelection(null, false);
return;
}
adjustInputAndSetSelection(je);
} else if (ei instanceof IClassFileEditorInput) {
IClassFile cf= ((IClassFileEditorInput)ei).getClassFile();
adjustInputAndSetSelection(cf);
}
return;
}
}
/**
* Returns the element contained in the EditorInput
*/
Object getElementOfInput(IEditorInput input) {
if (input instanceof IClassFileEditorInput)
return ((IClassFileEditorInput)input).getClassFile();
else if (input instanceof IFileEditorInput)
return ((IFileEditorInput)input).getFile();
else if (input instanceof JarEntryEditorInput)
return ((JarEntryEditorInput)input).getStorage();
return null;
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
}
private IResource getResourceFor(Object element) {
if (element instanceof IJavaElement) {
if (element instanceof IWorkingCopy) {
IWorkingCopy wc= (IWorkingCopy)element;
IJavaElement original= wc.getOriginalElement();
if (original != null)
element= original;
}
try {
element= ((IJavaElement)element).getUnderlyingResource();
} catch (JavaModelException e) {
return null;
}
}
if (!(element instanceof IResource) || ((IResource)element).isPhantom()) {
return null;
}
return (IResource)element;
}
private void setSelection(ISelection selection, boolean reveal) {
if (selection != null && selection.equals(fViewer.getSelection()))
return;
fProcessSelectionEvents= false;
fViewer.setSelection(selection, reveal);
fProcessSelectionEvents= true;
}
/**
* Tries to find the given element in a workingcopy.
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
*/
protected static IJavaElement getWorkingCopy(IJavaElement input) {
try {
if (input instanceof ICompilationUnit)
return ((ICompilationUnit)input).findSharedWorkingCopy(JavaUI.getBufferFactory());
else
return EditorUtility.getWorkingCopy(input, false);
} catch (JavaModelException ex) {
}
return null;
}
/**
* Returns the original element from which the specified working copy
* element was created from. This is a handle only method, the
* returned element may or may not exist.
*
* @param workingCopy the element for which to get the original
* @return the original Java element or <code>null</code> if this is not a working copy element
*/
protected static IJavaElement getOriginal(IJavaElement workingCopy) {
ICompilationUnit cu= getCompilationUnit(workingCopy);
if (cu != null)
return ((IWorkingCopy)cu).getOriginal(workingCopy);
return null;
}
/**
* Returns the compilation unit for the given java element.
*
* @param element the java element whose compilation unit is searched for
* @return the compilation unit of the given java element
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
*/
protected static ICompilationUnit getCompilationUnit(IJavaElement element) {
if (element == null)
return null;
if (element instanceof IMember)
return ((IMember) element).getCompilationUnit();
int type= element.getElementType();
if (IJavaElement.COMPILATION_UNIT == type)
return (ICompilationUnit) element;
if (IJavaElement.CLASS_FILE == type)
return null;
return getCompilationUnit(element.getParent());
}
/**
* Converts the given Java element to one which is suitable for this
* view. It takes into account wether the view shows working copies or not.
*
* @param element the Java element to be converted
* @return an element suitable for this view
*/
protected IJavaElement getSuitableJavaElement(Object obj) {
if (!(obj instanceof IJavaElement))
return null;
IJavaElement element= (IJavaElement)obj;
if (fTypeComparator.compare(element, IJavaElement.COMPILATION_UNIT) > 0)
return element;
if (element.getElementType() == IJavaElement.CLASS_FILE)
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
return element;
if (((BaseJavaElementContentProvider)getViewer().getContentProvider()).getProvideWorkingCopy()) {
IJavaElement wc= getWorkingCopy(element);
if (wc != null)
element= wc;
return element;
}
else {
ICompilationUnit cu= getCompilationUnit(element);
if (cu != null && ((IWorkingCopy)cu).isWorkingCopy())
return ((IWorkingCopy)cu).getOriginal(element);
else
return element;
}
}
/**
* @see JavaEditor#getElementAt(int)
*/
protected IJavaElement getElementForInputAt(IEditorInput input, int offset) {
if (input instanceof IClassFileEditorInput) {
try {
return ((IClassFileEditorInput)input).getClassFile().getElementAt(offset);
} catch (JavaModelException ex) {
return null;
}
}
IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();
ICompilationUnit unit= manager.getWorkingCopy(input);
if (unit != null)
try {
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
unit.reconcile();
return unit.getElementAt(offset);
} catch (JavaModelException ex) {
}
return null;
}
protected IType getTypeForCU(ICompilationUnit cu) {
cu= (ICompilationUnit)getSuitableJavaElement(cu);
IType primaryType= cu.findPrimaryType();
if (primaryType != null)
return primaryType;
try {
IType[] types= cu.getTypes();
if (types.length > 0)
return types[0];
else
return null;
} catch (JavaModelException ex) {
return null;
}
}
void setProcessSelectionEvents(boolean state) {
fProcessSelectionEvents= state;
}
}
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
/*******************************************************************************
* Copyright (c) 2002 International Business Machines Corp. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.jdt.internal.ui.packageview;
import org.eclipse.core.resources.IContainer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.actions.ActionGroup;
import org.eclipse.ui.actions.NewWizardMenu;
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
import org.eclipse.ui.actions.OpenInNewWindowAction;
import org.eclipse.ui.actions.RefreshAction;
import org.eclipse.ui.views.framelist.BackAction;
import org.eclipse.ui.views.framelist.ForwardAction;
import org.eclipse.ui.views.framelist.FrameList;
import org.eclipse.ui.views.framelist.GoIntoAction;
import org.eclipse.ui.views.framelist.UpAction;
import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IOpenable;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.IContextMenuConstants;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jdt.ui.actions.BuildActionGroup;
import org.eclipse.jdt.ui.actions.CCPActionGroup;
import org.eclipse.jdt.ui.actions.GenerateActionGroup;
import org.eclipse.jdt.ui.actions.ImportActionGroup;
import org.eclipse.jdt.ui.actions.JavaSearchActionGroup;
import org.eclipse.jdt.ui.actions.JdtActionConstants;
import org.eclipse.jdt.ui.actions.MemberFilterActionGroup;
import org.eclipse.jdt.ui.actions.NavigateActionGroup;
import org.eclipse.jdt.ui.actions.OpenAction;
import org.eclipse.jdt.ui.actions.RefactorActionGroup;
import org.eclipse.jdt.ui.actions.ShowActionGroup;
import org.eclipse.jdt.internal.ui.actions.CompositeActionGroup;
import org.eclipse.jdt.internal.ui.preferences.JavaBasePreferencePage;
import org.eclipse.jdt.internal.ui.workingsets.WorkingSetFilterActionGroup;
public class PackageExplorerActionGroup extends CompositeActionGroup {
private PackageExplorerPart fPart;
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
private GoIntoAction fZoomInAction;
private BackAction fBackAction;
private ForwardAction fForwardAction;
private UpAction fUpAction;
private GotoTypeAction fGotoTypeAction;
private GotoPackageAction fGotoPackageAction;
private NavigateActionGroup fNavigateActionGroup;
private BuildActionGroup fBuildActionGroup;
private CCPActionGroup fCCPActionGroup;
private WorkingSetFilterActionGroup fWorkingSetFilterActionGroup;
private MemberFilterActionGroup fMemberFilterActionGroup;
private ShowLibrariesAction fShowLibrariesAction;
private FilterSelectionAction fFilterAction;
public PackageExplorerActionGroup(PackageExplorerPart part) {
super();
fPart= part;
Shell shell= fPart.getSite().getShell();
setGroups(new ActionGroup[] {
fNavigateActionGroup= new NavigateActionGroup(fPart),
new ShowActionGroup(fPart),
fCCPActionGroup= new CCPActionGroup(fPart),
new RefactorActionGroup(fPart),
new ImportActionGroup(fPart),
new GenerateActionGroup(fPart),
fBuildActionGroup= new BuildActionGroup(fPart),
new JavaSearchActionGroup(fPart, fPart.getViewer()),
fWorkingSetFilterActionGroup= new WorkingSetFilterActionGroup(part.getViewer(), JavaUI.ID_PACKAGES, shell, createTitleUpdater())});
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
PackagesFrameSource frameSource= new PackagesFrameSource(fPart);
FrameList frameList= new FrameList(frameSource);
frameSource.connectTo(frameList);
fZoomInAction= new GoIntoAction(frameList);
fBackAction= new BackAction(frameList);
fForwardAction= new ForwardAction(frameList);
fUpAction= new UpAction(frameList);
fGotoTypeAction= new GotoTypeAction(fPart);
fGotoPackageAction= new GotoPackageAction(fPart);
fMemberFilterActionGroup= new MemberFilterActionGroup(fPart.getViewer(), "PackageView");
fShowLibrariesAction = new ShowLibrariesAction(fPart, PackagesMessages.getString("PackageExplorer.referencedLibs"));
fFilterAction = new FilterSelectionAction(shell, fPart, PackagesMessages.getString("PackageExplorer.filters"));
}
void restoreState(IMemento memento) {
fMemberFilterActionGroup.restoreState(memento);
fWorkingSetFilterActionGroup.restoreState(memento);
}
void saveState(IMemento memento) {
fMemberFilterActionGroup.saveState(memento);
fWorkingSetFilterActionGroup.saveState(memento);
}
public void fillActionBars(IActionBars actionBars) {
super.fillActionBars(actionBars);
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
setGlobalActionHandlers(actionBars);
fillToolBar(actionBars.getToolBarManager());
fillViewMenu(actionBars.getMenuManager());
}
private void setGlobalActionHandlers(IActionBars actionBars) {
actionBars.setGlobalActionHandler(IWorkbenchActionConstants.GO_INTO, fZoomInAction);
actionBars.setGlobalActionHandler(IWorkbenchActionConstants.BACK, fBackAction);
actionBars.setGlobalActionHandler(IWorkbenchActionConstants.FORWARD, fForwardAction);
actionBars.setGlobalActionHandler(IWorkbenchActionConstants.UP, fUpAction);
actionBars.setGlobalActionHandler(JdtActionConstants.GOTO_TYPE, fGotoTypeAction);
actionBars.setGlobalActionHandler(JdtActionConstants.GOTO_PACKAGE, fGotoPackageAction);
}
void fillToolBar(IToolBarManager toolBar) {
toolBar.removeAll();
toolBar.add(fBackAction);
toolBar.add(fForwardAction);
toolBar.add(fUpAction);
if (JavaBasePreferencePage.showCompilationUnitChildren()) {
toolBar.add(new Separator());
fMemberFilterActionGroup.contributeToToolBar(toolBar);
}
}
void fillViewMenu(IMenuManager menu) {
menu.add(fFilterAction);
menu.add(fShowLibrariesAction);
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end"));
}
void handleSelectionChanged(SelectionChangedEvent event) {
fZoomInAction.update();
}
public void fillContextMenu(IMenuManager menu) {
IStructuredSelection selection= (IStructuredSelection)getContext().getSelection();
int size= selection.size();
Object element= selection.getFirstElement();
IJavaElement jElement= element instanceof IJavaElement ? (IJavaElement)element : null;
if (size == 0 || (size == 1 &&isNewTarget(jElement))) {
IMenuManager newMenu= new MenuManager(PackagesMessages.getString("PackageExplorer.new"));
menu.appendToGroup(IContextMenuConstants.GROUP_NEW, newMenu);
new NewWizardMenu(newMenu, fPart.getSite().getWorkbenchWindow(), false);
}
addGotoMenu(menu, element, size);
addOpenNewWindowAction(menu, element);
super.fillContextMenu(menu);
}
private void addGotoMenu(IMenuManager menu, Object element, int size) {
if (size == 1 && fPart.getViewer().isExpandable(element) && isGoIntoTarget(element))
menu.appendToGroup(IContextMenuConstants.GROUP_GOTO, fZoomInAction);
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
}
private boolean isNewTarget(IJavaElement element) {
if (element == null)
return false;
int type= element.getElementType();
return type == IJavaElement.JAVA_PROJECT ||
type == IJavaElement.PACKAGE_FRAGMENT_ROOT ||
type == IJavaElement.PACKAGE_FRAGMENT;
}
private boolean isGoIntoTarget(Object element) {
if (element == null)
return false;
if (element instanceof IJavaElement) {
int type= ((IJavaElement)element).getElementType();
return type == IJavaElement.JAVA_PROJECT ||
type == IJavaElement.PACKAGE_FRAGMENT_ROOT ||
type == IJavaElement.PACKAGE_FRAGMENT;
}
return false;
}
private void addOpenNewWindowAction(IMenuManager menu, Object element) {
if (element instanceof IJavaElement) {
try {
element= ((IJavaElement)element).getCorrespondingResource();
} catch(JavaModelException e) {
}
}
if (!(element instanceof IContainer))
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
return;
menu.appendToGroup(
IContextMenuConstants.GROUP_OPEN,
new OpenInNewWindowAction(fPart.getSite().getWorkbenchWindow(), (IContainer)element));
}
void handleDoubleClick(DoubleClickEvent event) {
OpenAction openAction= fNavigateActionGroup.getOpenAction();
if (openAction != null && openAction.isEnabled()) {
openAction.run();
return;
}
TreeViewer viewer= fPart.getViewer();
Object element= ((IStructuredSelection)event.getSelection()).getFirstElement();
if (viewer.isExpandable(element)) {
if (JavaBasePreferencePage.doubleClickGoesInto()) {
if (element instanceof IOpenable &&
!(element instanceof ICompilationUnit) &&
!(element instanceof IClassFile)) {
fZoomInAction.run();
}
} else {
viewer.setExpandedState(element, !viewer.getExpandedState(element));
}
}
}
void handleKeyEvent(KeyEvent event) {
if (event.stateMask != 0)
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
return;
if (event.keyCode == SWT.F5) {
RefreshAction action= fBuildActionGroup.getRefreshAction();
if (action.isEnabled())
action.run();
} else if (event.character == SWT.DEL) {
IAction delete= fCCPActionGroup.getDeleteAction();
if (delete.isEnabled())
delete.run();
}
}
private IPropertyChangeListener createTitleUpdater() {
return new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
String property= event.getProperty();
if (IWorkingSetManager.CHANGE_WORKING_SET_NAME_CHANGE.equals(property)) {
IWorkingSet workingSet= (IWorkingSet)event.getNewValue();
String workingSetName= null;
if (workingSet != null)
workingSetName= workingSet.getName();
fPart.setWorkingSetName(workingSetName);
fPart.updateTitle();
}
}
};
}
}
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/BuildActionGroup.java
|
/*******************************************************************************
* Copyright (c) 2002 International Business Machines Corp. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.jdt.ui.actions;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.ui.IActionBars;
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/BuildActionGroup.java
|
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.ui.actions.ActionGroup;
import org.eclipse.ui.actions.BuildAction;
import org.eclipse.ui.actions.RefreshAction;
import org.eclipse.jdt.internal.ui.actions.ActionMessages;
import org.eclipse.jdt.ui.IContextMenuConstants;
/**
* Contributes all build related actions to the context menu and installs action handlers
* for them in the global menu bar.
*
* @since 2.0
*/
public class BuildActionGroup extends ActionGroup {
private IWorkbenchSite fSite;
private BuildAction fBuildAction;
private BuildAction fFullBuildAction;
private RefreshAction fRefreshAction;
/**
* Creates a new <code>BuildActionGroup</code>.
*
* @param part the view part that owns this action group
*/
public BuildActionGroup(IViewPart part) {
fSite= part.getSite();
Shell shell= fSite.getShell();
ISelectionProvider provider= fSite.getSelectionProvider();
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/BuildActionGroup.java
|
fBuildAction= new BuildAction(shell, IncrementalProjectBuilder.INCREMENTAL_BUILD);
fBuildAction.setText(ActionMessages.getString("BuildAction.label"));
fFullBuildAction= new BuildAction(shell, IncrementalProjectBuilder.FULL_BUILD);
fFullBuildAction.setText(ActionMessages.getString("RebuildAction.label"));
fRefreshAction= new RefreshAction(shell);
provider.addSelectionChangedListener(fBuildAction);
provider.addSelectionChangedListener(fFullBuildAction);
provider.addSelectionChangedListener(fRefreshAction);
}
/**
* Returns the refresh action managed by this group.
*
* @return the refresh action. If this group doesn't manage a refresh action
* <code>null</code> is returned.
*/
public RefreshAction getRefreshAction() {
return fRefreshAction;
}
/* (non-Javadoc)
* Method declared in ActionGroup
*/
public void fillActionBars(IActionBars actionBar) {
super.fillActionBars(actionBar);
setGlobalActionHandlers(actionBar);
}
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/BuildActionGroup.java
|
/* (non-Javadoc)
* Method declared in ActionGroup
*/
public void fillContextMenu(IMenuManager menu) {
super.fillContextMenu(menu);
}
/* (non-Javadoc)
* Method declared in ActionGroup
*/
public void dispose() {
ISelectionProvider provider= fSite.getSelectionProvider();
provider.removeSelectionChangedListener(fBuildAction);
provider.removeSelectionChangedListener(fFullBuildAction);
provider.removeSelectionChangedListener(fRefreshAction);
super.dispose();
}
private void setGlobalActionHandlers(IActionBars actionBar) {
actionBar.setGlobalActionHandler(IWorkbenchActionConstants.BUILD_PROJECT, fBuildAction);
actionBar.setGlobalActionHandler(IWorkbenchActionConstants.REBUILD_PROJECT, fFullBuildAction);
actionBar.setGlobalActionHandler(IWorkbenchActionConstants.REFRESH, fRefreshAction);
}
private void appendToGroup(IMenuManager menu, IAction action) {
if (action.isEnabled())
menu.appendToGroup(IContextMenuConstants.GROUP_BUILD, action);
}
}
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ImportActionGroup.java
|
/*******************************************************************************
* Copyright (c) 2002 International Business Machines Corp. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.jdt.ui.actions;
import java.util.Iterator;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.actions.ActionGroup;
import org.eclipse.ui.actions.ExportResourcesAction;
import org.eclipse.ui.actions.ImportResourcesAction;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.ui.IContextMenuConstants;
/**
* Action group to add the Import and Export action to a view part's
* context menu.
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ImportActionGroup.java
|
*
* @sine 2.0
*/
public class ImportActionGroup extends ActionGroup {
private static final String GROUP_IMPORT= "group.import";
private ImportResourcesAction fImportAction;
private ExportResourcesAction fExportAction;
/**
* Creates a new <code>ImportActionGroup</code>.
*
* @param part the view part that owns this action group
*/
public ImportActionGroup(IViewPart part) {
IWorkbench workbench = part.getSite().getWorkbenchWindow().getWorkbench();
fImportAction= new ImportResourcesAction(workbench);
fExportAction= new ExportResourcesAction(workbench);
}
/* (non-Javadoc)
* Method declared in ActionGroup
*/
public void fillContextMenu(IMenuManager menu) {
IStructuredSelection selection= getStructuredSelection();
if (selection == null)
return;
if (checkSelection(selection)) {
menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, new Separator(GROUP_IMPORT));
if (selection.size() == 1)
menu.appendToGroup(GROUP_IMPORT, fImportAction);
|
15,157 |
Bug 15157 New-> menu disappears when folder is selected
|
Build: 20020501 The New-> menu in the packages view is not added to the pop-up menu when a folder is selected. It is added when a source folder is selected.
|
resolved fixed
|
a6f6f3f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T11:00:09Z | 2002-05-02T22:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ImportActionGroup.java
|
menu.appendToGroup(GROUP_IMPORT, fExportAction);
}
super.fillContextMenu(menu);
}
private void appendToGroup(IMenuManager menu, IAction action) {
if (action.isEnabled())
menu.appendToGroup(GROUP_IMPORT, action);
}
private IStructuredSelection getStructuredSelection() {
ISelection selection= getContext().getSelection();
if (selection instanceof IStructuredSelection)
return (IStructuredSelection)selection;
return null;
}
private boolean checkSelection(IStructuredSelection selection) {
for (Iterator iter= selection.iterator(); iter.hasNext();) {
Object element= (Object) iter.next();
if (!(element instanceof IJavaElement))
return false;
int type= ((IJavaElement)element).getElementType();
if (type != IJavaElement.JAVA_PROJECT && type != IJavaElement.PACKAGE_FRAGMENT_ROOT && type != IJavaElement.PACKAGE_FRAGMENT)
return false;
}
return true;
}
}
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/CompositeActionGroup.java
|
/*******************************************************************************
* Copyright (c) 2002 International Business Machines Corp. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.jdt.internal.ui.actions;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.util.Assert;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.actions.ActionContext;
import org.eclipse.ui.actions.ActionGroup;
public class CompositeActionGroup extends ActionGroup {
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/CompositeActionGroup.java
|
private ActionGroup[] fGroups;
private static final ActionGroup[] EMPTY_ARRAY= new ActionGroup[0];
public CompositeActionGroup() {
this(EMPTY_ARRAY);
}
public CompositeActionGroup(ActionGroup[] groups) {
setGroups(groups);
}
protected void setGroups(ActionGroup[] groups) {
Assert.isNotNull(groups);
fGroups= groups;
}
public void dispose() {
super.dispose();
for (int i= 0; i < fGroups.length; i++) {
fGroups[i].dispose();
}
}
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/CompositeActionGroup.java
|
public void fillActionBars(IActionBars actionBars) {
super.fillActionBars(actionBars);
for (int i= 0; i < fGroups.length; i++) {
fGroups[i].fillActionBars(actionBars);
}
}
public void fillContextMenu(IMenuManager menu) {
super.fillContextMenu(menu);
for (int i= 0; i < fGroups.length; i++) {
fGroups[i].fillContextMenu(menu);
}
}
public void setContext(ActionContext context) {
super.setContext(context);
for (int i= 0; i < fGroups.length; i++) {
fGroups[i].setContext(context);
}
}
public void updateActionBars() {
super.updateActionBars();
for (int i= 0; i < fGroups.length; i++) {
fGroups[i].updateActionBars();
}
}
public ActionGroup get(int index) {
return fGroups[index];
}
}
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.browsing;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DragSource;
import org.eclipse.swt.dnd.DragSourceEvent;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.DecoratingLabelProvider;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IPartListener;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionContext;
import org.eclipse.ui.actions.ActionGroup;
import org.eclipse.ui.actions.NewWizardMenu;
import org.eclipse.ui.part.ResourceTransfer;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.IWorkingCopy;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.IContextMenuConstants;
import org.eclipse.jdt.ui.IWorkingCopyManager;
import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jdt.ui.JavaElementSorter;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jdt.ui.actions.BuildActionGroup;
import org.eclipse.jdt.ui.actions.CCPActionGroup;
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
import org.eclipse.jdt.ui.actions.GenerateActionGroup;
import org.eclipse.jdt.ui.actions.ImportActionGroup;
import org.eclipse.jdt.ui.actions.JavaSearchActionGroup;
import org.eclipse.jdt.ui.actions.OpenEditorActionGroup;
import org.eclipse.jdt.ui.actions.OpenViewActionGroup;
import org.eclipse.jdt.ui.actions.RefactorActionGroup;
import org.eclipse.jdt.ui.actions.ShowActionGroup;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.CompositeActionGroup;
import org.eclipse.jdt.internal.ui.dnd.DelegatingDragAdapter;
import org.eclipse.jdt.internal.ui.dnd.DelegatingDropAdapter;
import org.eclipse.jdt.internal.ui.dnd.LocalSelectionTransfer;
import org.eclipse.jdt.internal.ui.dnd.ResourceTransferDragAdapter;
import org.eclipse.jdt.internal.ui.dnd.TransferDragSourceListener;
import org.eclipse.jdt.internal.ui.dnd.TransferDropTargetListener;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.javaeditor.IClassFileEditorInput;
import org.eclipse.jdt.internal.ui.javaeditor.JarEntryEditorInput;
import org.eclipse.jdt.internal.ui.packageview.PackagesMessages;
import org.eclipse.jdt.internal.ui.packageview.SelectionTransferDragAdapter;
import org.eclipse.jdt.internal.ui.packageview.SelectionTransferDropAdapter;
import org.eclipse.jdt.internal.ui.util.JavaUIHelp;
import org.eclipse.jdt.internal.ui.viewsupport.AppearanceAwareLabelProvider;
import org.eclipse.jdt.internal.ui.viewsupport.BaseJavaElementContentProvider;
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider;
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabels;
import org.eclipse.jdt.internal.ui.viewsupport.ProblemTableViewer;
import org.eclipse.jdt.internal.ui.viewsupport.StatusBarUpdater;
import org.eclipse.jdt.internal.ui.workingsets.WorkingSetFilterActionGroup;
abstract class JavaBrowsingPart extends ViewPart implements IMenuListener, ISelectionListener {
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
private ILabelProvider fLabelProvider;
private ILabelProvider fTitleProvider;
private StructuredViewer fViewer;
private IMemento fMemento;
private JavaElementTypeComparator fTypeComparator;
private WorkingSetFilterActionGroup fWorkingSetFilterActionGroup;
private CCPActionGroup fCCPActionGroup;
private BuildActionGroup fBuildActionGroup;
private CompositeActionGroup fActionGroups;
private Menu fContextMenu;
private IWorkbenchPart fPreviousSelectionProvider;
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
private Object fPreviousSelectedElement;
private Image fOriginalTitleImage;
/*
* Ensure selection changed events being processed only if
* initiated by user interaction with this part.
*/
private boolean fProcessSelectionEvents= true;
private IPartListener fPartListener= new IPartListener() {
public void partActivated(IWorkbenchPart part) {
setSelectionFromEditor(part);
}
public void partBroughtToTop(IWorkbenchPart part) {
}
public void partClosed(IWorkbenchPart part) {
}
public void partDeactivated(IWorkbenchPart part) {
}
public void partOpened(IWorkbenchPart part) {
}
};
/*
* Implements method from IViewPart.
*/
public void init(IViewSite site, IMemento memento) throws PartInitException {
super.init(site, memento);
fMemento= memento;
}
/*
* Implements method from IViewPart.
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
*/
public void saveState(IMemento memento) {
if (fViewer == null) {
if (fMemento != null)
memento.putMemento(fMemento);
return;
}
fWorkingSetFilterActionGroup.saveState(memento);
}
protected void restoreState(IMemento memento) {
fWorkingSetFilterActionGroup.restoreState(memento);
}
/**
* Creates the search list inner viewer.
*/
public void createPartControl(Composite parent) {
Assert.isTrue(fViewer == null);
fTypeComparator= new JavaElementTypeComparator();
fViewer= createViewer(parent);
fLabelProvider= createLabelProvider();
ILabelDecorator decorationMgr= PlatformUI.getWorkbench().getDecoratorManager();
fViewer.setLabelProvider(new DecoratingLabelProvider(fLabelProvider, decorationMgr));
fViewer.setSorter(new JavaElementSorter());
fViewer.setUseHashlookup(true);
fTitleProvider= createTitleProvider();
MenuManager menuMgr= new MenuManager("#PopupMenu");
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(this);
fContextMenu= menuMgr.createContextMenu(fViewer.getControl());
fViewer.getControl().setMenu(fContextMenu);
getSite().registerContextMenu(menuMgr, fViewer);
getSite().setSelectionProvider(fViewer);
createActions();
addKeyListener();
if (fMemento != null)
restoreState(fMemento);
fMemento= null;
getSite().setSelectionProvider(fViewer);
IStatusLineManager slManager= getViewSite().getActionBars().getStatusLineManager();
fViewer.addSelectionChangedListener(new StatusBarUpdater(slManager));
hookViewerListeners();
addFilters();
fViewer.setContentProvider(createContentProvider());
setInitialInput();
initDragAndDrop();
setInitialSelection();
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
getViewSite().getWorkbenchWindow().getSelectionService().addSelectionListener(this);
getViewSite().getPage().addPartListener(fPartListener);
fillActionBars();
setHelp();
}
private void initDragAndDrop() {
int ops= DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
Transfer[] transfers= new Transfer[] {
LocalSelectionTransfer.getInstance(),
ResourceTransfer.getInstance()};
TransferDropTargetListener[] dropListeners= new TransferDropTargetListener[] {
new SelectionTransferDropAdapter(fViewer)
};
fViewer.addDropSupport(ops, transfers, new DelegatingDropAdapter(dropListeners));
Control control= fViewer.getControl();
TransferDragSourceListener[] dragListeners= new TransferDragSourceListener[] {
new SelectionTransferDragAdapter(fViewer),
new ResourceTransferDragAdapter(fViewer)
};
DragSource source= new DragSource(control, ops);
source.addDragListener(new DelegatingDragAdapter(dragListeners) {
public void dragStart(DragSourceEvent event) {
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
IStructuredSelection selection= (IStructuredSelection)getSelectionProvider().getSelection();
for (Iterator iter= selection.iterator(); iter.hasNext(); ) {
if (iter.next() instanceof IMember) {
setPossibleListeners(new TransferDragSourceListener[] {new SelectionTransferDragAdapter(fViewer)});
break;
}
}
super.dragStart(event);
}
});
}
protected void fillActionBars() {
IActionBars actionBars= getViewSite().getActionBars();
IToolBarManager toolBar= actionBars.getToolBarManager();
fillToolBar(toolBar);
fWorkingSetFilterActionGroup.fillActionBars(getViewSite().getActionBars());
actionBars.updateActionBars();
fActionGroups.fillActionBars(actionBars);
}
public void setFocus() {
fViewer.getControl().setFocus();
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
}
public void dispose() {
if (fViewer != null) {
getViewSite().getWorkbenchWindow().getSelectionService().removeSelectionListener(this);
getViewSite().getPage().removePartListener(fPartListener);
fViewer= null;
}
if (fActionGroups != null)
fActionGroups.dispose();
super.dispose();
}
/**
* Adds the KeyListener
*/
protected void addKeyListener() {
fViewer.getControl().addKeyListener(new KeyAdapter() {
public void keyReleased(KeyEvent event) {
handleKeyReleased(event);
}
});
}
protected void handleKeyReleased(KeyEvent event) {
if (event.stateMask != 0)
return;
int key= event.keyCode;
IAction action;
if (key == SWT.F5) {
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
action= fBuildActionGroup.getRefreshAction();
if (action.isEnabled())
action.run();
} if (event.character == SWT.DEL) {
action= fCCPActionGroup.getDeleteAction();
if (action.isEnabled())
action.run();
}
}
protected void fillToolBar(IToolBarManager tbm) {
}
/**
* Called when the context menu is about to open.
* Override to add your own context dependent menu contributions.
*/
public void menuAboutToShow(IMenuManager menu) {
JavaPlugin.createStandardGroups(menu);
IStructuredSelection selection= (IStructuredSelection) fViewer.getSelection();
int size= selection.size();
Object element= selection.getFirstElement();
IJavaElement jElement= element instanceof IJavaElement ? (IJavaElement)element : null;
if (size == 0 || (size == 1 && (isNewTarget(jElement) || element instanceof IContainer))) {
MenuManager newMenu= new MenuManager(PackagesMessages.getString("PackageExplorer.new"));
menu.appendToGroup(IContextMenuConstants.GROUP_NEW, newMenu);
new NewWizardMenu(newMenu, getSite().getWorkbenchWindow(), false);
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
}
if (size == 1)
addOpenNewWindowAction(menu, element);
fActionGroups.setContext(new ActionContext(selection));
fActionGroups.fillContextMenu(menu);
fActionGroups.setContext(null);
}
private boolean isNewTarget(IJavaElement element) {
if (element == null)
return false;
int type= element.getElementType();
return type == IJavaElement.JAVA_PROJECT ||
type == IJavaElement.PACKAGE_FRAGMENT_ROOT ||
type == IJavaElement.PACKAGE_FRAGMENT ||
type == IJavaElement.COMPILATION_UNIT ||
type == IJavaElement.TYPE;
}
private void addOpenNewWindowAction(IMenuManager menu, Object element) {
if (element instanceof IJavaElement) {
try {
element= ((IJavaElement)element).getCorrespondingResource();
} catch(JavaModelException e) {
}
}
if (!(element instanceof IContainer))
return;
menu.appendToGroup(
IContextMenuConstants.GROUP_OPEN,
new PatchedOpenInNewWindowAction(getSite().getWorkbenchWindow(), (IContainer)element));
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
}
private void createActions() {
fActionGroups= new CompositeActionGroup(new ActionGroup[] {
new OpenEditorActionGroup(this),
new OpenViewActionGroup(this),
new ShowActionGroup(this),
fCCPActionGroup= new CCPActionGroup(this),
new RefactorActionGroup(this),
new ImportActionGroup(this),
new GenerateActionGroup(this),
fBuildActionGroup= new BuildActionGroup(this),
new JavaSearchActionGroup(this, getViewer())});
String viewId= getConfigurationElement().getAttribute("id");
Assert.isNotNull(viewId);
IPropertyChangeListener titleUpdater= new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
String property= event.getProperty();
if (IWorkingSetManager.CHANGE_WORKING_SET_NAME_CHANGE.equals(property))
updateTitle();
}
};
fWorkingSetFilterActionGroup= new WorkingSetFilterActionGroup(fViewer, viewId, getShell(), titleUpdater);
}
/**
* Returns the shell to use for opening dialogs.
* Used in this class, and in the actions.
*/
private Shell getShell() {
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
return fViewer.getControl().getShell();
}
protected final Display getDisplay() {
return fViewer.getControl().getDisplay();
}
/**
* Returns the selection provider.
*/
ISelectionProvider getSelectionProvider() {
return fViewer;
}
/**
* Answers if the given <code>element</code> is a valid
* input for this part.
*
* @param element the object to test
* @return <true> if the given element is a valid input
*/
abstract protected boolean isValidInput(Object element);
/**
* Answers if the given <code>element</code> is a valid
* element for this part.
*
* @param element the object to test
* @return <true> if the given element is a valid element
*/
protected boolean isValidElement(Object element) {
if (element == null)
return false;
element= getSuitableJavaElement(element);
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
if (element == null)
return false;
Object input= getViewer().getInput();
if (input == null)
return false;
if (input instanceof Collection)
return ((Collection)input).contains(element);
else
return input.equals(element);
}
private boolean isInputResetBy(Object newInput, Object input, IWorkbenchPart part) {
if (newInput == null)
return part == fPreviousSelectionProvider;
if (input instanceof IJavaElement && newInput instanceof IJavaElement)
return getTypeComparator().compare(newInput, input) > 0;
else
return false;
}
private boolean isInputResetBy(IWorkbenchPart part) {
if (!(part instanceof JavaBrowsingPart))
return true;
Object thisInput= getViewer().getInput();
Object partInput= ((JavaBrowsingPart)part).getViewer().getInput();
if (thisInput instanceof IJavaElement && partInput instanceof IJavaElement)
return getTypeComparator().compare(partInput, thisInput) > 0;
else
return true;
}
protected boolean isAncestorOf(Object ancestor, Object element) {
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
if (element instanceof IJavaElement && ancestor instanceof IJavaElement)
return !element.equals(ancestor) && internalIsAncestorOf((IJavaElement)ancestor, (IJavaElement)element);
return false;
}
private boolean internalIsAncestorOf(IJavaElement ancestor, IJavaElement element) {
if (element != null)
return element.equals(ancestor) || internalIsAncestorOf(ancestor, element.getParent());
else
return false;
}
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
if (!fProcessSelectionEvents || part == this || !(selection instanceof IStructuredSelection))
return;
Object selectedElement= getSingleElementFromSelection(selection);
if (selectedElement != null && part.equals(fPreviousSelectionProvider) && selectedElement.equals(fPreviousSelectedElement))
return;
fPreviousSelectedElement= selectedElement;
Object currentInput= (IJavaElement)getViewer().getInput();
if (selectedElement != null && selectedElement.equals(currentInput)) {
IJavaElement elementToSelect= findElementToSelect(getSingleElementFromSelection(selection));
if (elementToSelect != null && getTypeComparator().compare(selectedElement, elementToSelect) < 0)
setSelection(new StructuredSelection(elementToSelect), true);
fPreviousSelectionProvider= part;
return;
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
}
if (part != fPreviousSelectionProvider && selectedElement != null && !selectedElement.equals(currentInput) && isInputResetBy(selectedElement, currentInput, part)) {
if (!isAncestorOf(selectedElement, currentInput))
setInput(null);
fPreviousSelectionProvider= part;
return;
} else if (selection.isEmpty() && !isInputResetBy(part)) {
fPreviousSelectionProvider= part;
return;
} else if (selectedElement == null && part == fPreviousSelectionProvider) {
setInput(null);
fPreviousSelectionProvider= part;
return;
}
fPreviousSelectionProvider= part;
if (selectedElement instanceof IJavaElement)
adjustInputAndSetSelection((IJavaElement)selectedElement);
else
setSelection(StructuredSelection.EMPTY, true);
}
protected void setInput(Object input) {
if (input == null)
setTitleImage(fOriginalTitleImage);
else if (input instanceof Collection) {
if (((Collection)input).isEmpty())
setTitleImage(fOriginalTitleImage);
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
else {
Object firstElement= ((Collection)input).iterator().next();
setTitleImage(fTitleProvider.getImage(firstElement));
}
} else
setTitleImage(fTitleProvider.getImage(input));
setViewerInput(input);
updateTitle();
}
private void setViewerInput(Object input) {
fProcessSelectionEvents= false;
fViewer.setInput(input);
fProcessSelectionEvents= true;
}
void updateTitle() {
setTitleToolTip(getToolTipText(fViewer.getInput()));
}
/**
* Returns the tool tip text for the given element.
*/
String getToolTipText(Object element) {
String result;
if (!(element instanceof IResource)) {
result= JavaElementLabels.getTextLabel(element, AppearanceAwareLabelProvider.DEFAULT_TEXTFLAGS);
} else {
IPath path= ((IResource) element).getFullPath();
if (path.isRoot()) {
result= getConfigurationElement().getAttribute("name");
} else {
result= path.makeRelative().toString();
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
}
}
if (fWorkingSetFilterActionGroup == null || fWorkingSetFilterActionGroup.getWorkingSet() == null)
return result;
IWorkingSet ws= fWorkingSetFilterActionGroup.getWorkingSet();
String wsstr= JavaBrowsingMessages.getFormattedString("JavaBrowsingPart.toolTip", new String[] { ws.getName() });
if (result.length() == 0)
return wsstr;
return JavaBrowsingMessages.getFormattedString("JavaBrowsingPart.toolTip2", new String[] { result, ws.getName() });
}
public String getTitleToolTip() {
if (fViewer == null)
return super.getTitleToolTip();
return getToolTipText(fViewer.getInput());
}
/**
* Sets or clears the title image of this part and
* store the orignal image on the first call.
*/
protected void setTitleImage(Image titleImage) {
if (fOriginalTitleImage == null)
fOriginalTitleImage= getTitleImage();
if (titleImage == null)
titleImage= fOriginalTitleImage;
super.setTitleImage(titleImage);
}
protected final StructuredViewer getViewer() {
return fViewer;
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
}
protected ILabelProvider createLabelProvider() {
return new AppearanceAwareLabelProvider(
AppearanceAwareLabelProvider.DEFAULT_TEXTFLAGS,
AppearanceAwareLabelProvider.DEFAULT_IMAGEFLAGS | JavaElementImageProvider.SMALL_ICONS,
AppearanceAwareLabelProvider.getDecorators(true, null)
);
}
protected ILabelProvider createTitleProvider() {
return new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_BASICS | JavaElementLabelProvider.SHOW_SMALL_ICONS);
}
protected final ILabelProvider getLabelProvider() {
return fLabelProvider;
}
protected final ILabelProvider getTitleProvider() {
return fTitleProvider;
}
/**
* Creates the the viewer of this part.
*
* @param parent the parent for the viewer
*/
protected StructuredViewer createViewer(Composite parent) {
return new ProblemTableViewer(parent, SWT.MULTI);
}
protected int getLabelProviderFlags() {
return JavaElementLabelProvider.SHOW_BASICS | JavaElementLabelProvider.SHOW_OVERLAY_ICONS |
JavaElementLabelProvider.SHOW_SMALL_ICONS | JavaElementLabelProvider.SHOW_VARIABLE | JavaElementLabelProvider.SHOW_PARAMETERS;
}
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
/**
* Adds filters the viewer of this part.
*/
protected void addFilters() {
}
/**
* Creates the the content provider of this part.
*/
protected BaseJavaElementContentProvider createContentProvider() {
return new JavaElementContentProvider(true, this);
}
protected void setInitialInput() {
ISelection selection= getSite().getPage().getSelection();
Object input= getSingleElementFromSelection(selection);
if (!(input instanceof IJavaElement)) {
input= getSite().getPage().getInput();
if (!(input instanceof IJavaElement) && input instanceof IAdaptable)
input= ((IAdaptable)input).getAdapter(IJavaElement.class);
}
setInput(findInputForJavaElement((IJavaElement)input));
}
protected void setInitialSelection() {
Object input;
ISelection selection= getSite().getPage().getSelection();
if (selection != null && !selection.isEmpty())
input= getSingleElementFromSelection(selection);
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
else {
input= getSite().getPage().getInput();
if (!(input instanceof IJavaElement)) {
if (input instanceof IAdaptable)
input= ((IAdaptable)input).getAdapter(IJavaElement.class);
else
return;
}
}
if (findElementToSelect((IJavaElement)input) != null)
adjustInputAndSetSelection((IJavaElement)input);
}
final protected void setHelp() {
JavaUIHelp.setHelp(fViewer, getHelpContextId());
}
/**
* Returns the context ID for the Help system
*
* @return the string used as ID for the Help context
*/
abstract protected String getHelpContextId();
/**
* Adds additional listeners to this view.
*/
protected void hookViewerListeners() {
fViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
if (!fProcessSelectionEvents)
return;
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
IWorkbenchPage page= getSite().getPage();
if (page == null)
return;
if (JavaBrowsingPreferencePage.openEditorOnSingleClick())
new ShowInEditorAction().run(event.getSelection(), page);
else if (page.equals(JavaPlugin.getActivePage()) && JavaBrowsingPart.this.equals(page.getActivePart()))
linkToEditor((IStructuredSelection)event.getSelection());
}
});
fViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
if (fProcessSelectionEvents && !JavaBrowsingPreferencePage.openEditorOnSingleClick())
new ShowInEditorAction().run(event.getSelection(), getSite().getPage());
}
});
}
void adjustInputAndSetSelection(IJavaElement je) {
je= getSuitableJavaElement(je);
IJavaElement elementToSelect= findElementToSelect(je);
IJavaElement newInput= findInputForJavaElement(je);
if (elementToSelect == null && !isValidInput(newInput))
setInput(null);
else if (elementToSelect == null || getViewer().testFindItem(elementToSelect) == null)
setInput(findInputForJavaElement(je));
if (elementToSelect != null)
setSelection(new StructuredSelection(elementToSelect), true);
else
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
setSelection(StructuredSelection.EMPTY, true);
}
/**
* Finds the closest Java element which can be used as input for
* this part and has the given Java element as child
*
* @param je the Java element for which to search the closest input
* @return the closest Java element used as input for this part
*/
protected IJavaElement findInputForJavaElement(IJavaElement je) {
if (je == null || !je.exists())
return null;
if (isValidInput(je))
return je;
return findInputForJavaElement(je.getParent());
}
final protected IJavaElement findElementToSelect(Object obj) {
if (obj instanceof IJavaElement)
return findElementToSelect((IJavaElement)obj);
return null;
}
/**
* Finds the element which has to be selected in this part.
*
* @param je the Java element which has the focus
*/
abstract protected IJavaElement findElementToSelect(IJavaElement je);
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
private Object getSingleElementFromSelection(ISelection selection) {
if (!(selection instanceof StructuredSelection) || selection.isEmpty())
return null;
Iterator iter= ((StructuredSelection)selection).iterator();
Object firstElement= iter.next();
if (!(firstElement instanceof IJavaElement)) {
if (firstElement instanceof IAdaptable)
return (IJavaElement)((IAdaptable)firstElement).getAdapter(IJavaElement.class);
else
return firstElement;
}
Object currentInput= (IJavaElement)getViewer().getInput();
if (currentInput == null || !currentInput.equals(findInputForJavaElement((IJavaElement)firstElement)))
if (iter.hasNext())
return null;
else
return firstElement;
while (iter.hasNext()) {
Object element= iter.next();
if (!(element instanceof IJavaElement))
return null;
if (!currentInput.equals(findInputForJavaElement((IJavaElement)element)))
return null;
}
return firstElement;
}
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
/**
* Gets the typeComparator.
* @return Returns a JavaElementTypeComparator
*/
protected Comparator getTypeComparator() {
return fTypeComparator;
}
/**
* Links to editor (if option enabled)
*/
private void linkToEditor(IStructuredSelection selection) {
if (selection == null || selection.isEmpty())
return;
Object obj= selection.getFirstElement();
Object element= null;
if (selection.size() == 1) {
if (obj instanceof IJavaElement) {
IJavaElement cu= ((IJavaElement)obj).getAncestor(IJavaElement.COMPILATION_UNIT);
if (cu != null)
element= getResourceFor(cu);
if (element == null)
element= ((IJavaElement)obj).getAncestor(IJavaElement.CLASS_FILE);
}
else if (obj instanceof IFile)
element= obj;
if (element == null)
return;
IWorkbenchPage page= getSite().getPage();
IEditorPart editorArray[]= page.getEditors();
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
for (int i= 0; i < editorArray.length; ++i) {
IEditorPart editor= editorArray[i];
Object input= getElementOfInput(editor.getEditorInput());
if (input != null && input.equals(element)) {
page.bringToTop(editor);
if (obj instanceof IJavaElement)
EditorUtility.revealInEditor(editor, (IJavaElement) obj);
return;
}
}
}
}
private void setSelectionFromEditor(IWorkbenchPart part) {
if (part == null)
return;
IWorkbenchPartSite site= part.getSite();
if (site == null)
return;
ISelectionProvider provider= site.getSelectionProvider();
if (provider != null)
setSelectionFromEditor(part, provider.getSelection());
}
private void setSelectionFromEditor(IWorkbenchPart part, ISelection selection) {
if (part instanceof IEditorPart && JavaBrowsingPreferencePage.linkViewSelectionToEditor()) {
IEditorInput ei= ((IEditorPart)part).getEditorInput();
if (selection instanceof ITextSelection) {
int offset= ((ITextSelection)selection).getOffset();
IJavaElement element= getElementForInputAt(ei, offset);
if (element != null) {
adjustInputAndSetSelection(element);
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
return;
}
}
if (ei instanceof IFileEditorInput) {
IFile file= ((IFileEditorInput)ei).getFile();
IJavaElement je= (IJavaElement)file.getAdapter(IJavaElement.class);
if (je == null) {
setSelection(null, false);
return;
}
adjustInputAndSetSelection(je);
} else if (ei instanceof IClassFileEditorInput) {
IClassFile cf= ((IClassFileEditorInput)ei).getClassFile();
adjustInputAndSetSelection(cf);
}
return;
}
}
/**
* Returns the element contained in the EditorInput
*/
Object getElementOfInput(IEditorInput input) {
if (input instanceof IClassFileEditorInput)
return ((IClassFileEditorInput)input).getClassFile();
else if (input instanceof IFileEditorInput)
return ((IFileEditorInput)input).getFile();
else if (input instanceof JarEntryEditorInput)
return ((JarEntryEditorInput)input).getStorage();
return null;
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
}
private IResource getResourceFor(Object element) {
if (element instanceof IJavaElement) {
if (element instanceof IWorkingCopy) {
IWorkingCopy wc= (IWorkingCopy)element;
IJavaElement original= wc.getOriginalElement();
if (original != null)
element= original;
}
try {
element= ((IJavaElement)element).getUnderlyingResource();
} catch (JavaModelException e) {
return null;
}
}
if (!(element instanceof IResource) || ((IResource)element).isPhantom()) {
return null;
}
return (IResource)element;
}
private void setSelection(ISelection selection, boolean reveal) {
if (selection != null && selection.equals(fViewer.getSelection()))
return;
fProcessSelectionEvents= false;
fViewer.setSelection(selection, reveal);
fProcessSelectionEvents= true;
}
/**
* Tries to find the given element in a workingcopy.
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
*/
protected static IJavaElement getWorkingCopy(IJavaElement input) {
try {
if (input instanceof ICompilationUnit)
return ((ICompilationUnit)input).findSharedWorkingCopy(JavaUI.getBufferFactory());
else
return EditorUtility.getWorkingCopy(input, false);
} catch (JavaModelException ex) {
}
return null;
}
/**
* Returns the original element from which the specified working copy
* element was created from. This is a handle only method, the
* returned element may or may not exist.
*
* @param workingCopy the element for which to get the original
* @return the original Java element or <code>null</code> if this is not a working copy element
*/
protected static IJavaElement getOriginal(IJavaElement workingCopy) {
ICompilationUnit cu= getCompilationUnit(workingCopy);
if (cu != null)
return ((IWorkingCopy)cu).getOriginal(workingCopy);
return null;
}
/**
* Returns the compilation unit for the given java element.
*
* @param element the java element whose compilation unit is searched for
* @return the compilation unit of the given java element
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
*/
protected static ICompilationUnit getCompilationUnit(IJavaElement element) {
if (element == null)
return null;
if (element instanceof IMember)
return ((IMember) element).getCompilationUnit();
int type= element.getElementType();
if (IJavaElement.COMPILATION_UNIT == type)
return (ICompilationUnit) element;
if (IJavaElement.CLASS_FILE == type)
return null;
return getCompilationUnit(element.getParent());
}
/**
* Converts the given Java element to one which is suitable for this
* view. It takes into account wether the view shows working copies or not.
*
* @param element the Java element to be converted
* @return an element suitable for this view
*/
protected IJavaElement getSuitableJavaElement(Object obj) {
if (!(obj instanceof IJavaElement))
return null;
IJavaElement element= (IJavaElement)obj;
if (fTypeComparator.compare(element, IJavaElement.COMPILATION_UNIT) > 0)
return element;
if (element.getElementType() == IJavaElement.CLASS_FILE)
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
return element;
if (((BaseJavaElementContentProvider)getViewer().getContentProvider()).getProvideWorkingCopy()) {
IJavaElement wc= getWorkingCopy(element);
if (wc != null)
element= wc;
return element;
}
else {
ICompilationUnit cu= getCompilationUnit(element);
if (cu != null && ((IWorkingCopy)cu).isWorkingCopy())
return ((IWorkingCopy)cu).getOriginal(element);
else
return element;
}
}
/**
* @see JavaEditor#getElementAt(int)
*/
protected IJavaElement getElementForInputAt(IEditorInput input, int offset) {
if (input instanceof IClassFileEditorInput) {
try {
return ((IClassFileEditorInput)input).getClassFile().getElementAt(offset);
} catch (JavaModelException ex) {
return null;
}
}
IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();
ICompilationUnit unit= manager.getWorkingCopy(input);
if (unit != null)
try {
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
|
unit.reconcile();
return unit.getElementAt(offset);
} catch (JavaModelException ex) {
}
return null;
}
protected IType getTypeForCU(ICompilationUnit cu) {
cu= (ICompilationUnit)getSuitableJavaElement(cu);
IType primaryType= cu.findPrimaryType();
if (primaryType != null)
return primaryType;
try {
IType[] types= cu.getTypes();
if (types.length > 0)
return types[0];
else
return null;
} catch (JavaModelException ex) {
return null;
}
}
void setProcessSelectionEvents(boolean state) {
fProcessSelectionEvents= state;
}
}
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/ProjectsView.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.browsing;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaModel;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.viewsupport.BaseJavaElementContentProvider;
import org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer;
public class ProjectsView extends JavaBrowsingPart {
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/ProjectsView.java
|
/**
* Creates the the viewer of this part.
*
* @param parent the parent for the viewer
*/
protected StructuredViewer createViewer(Composite parent) {
return new ProblemTreeViewer(parent, SWT.MULTI);
}
/**
* Creates the the content provider of this part.
*/
protected BaseJavaElementContentProvider createContentProvider() {
return new ProjectAndSourceFolderContentProvider(this);
}
/**
* Returns the context ID for the Help system.
*
* @return the string used as ID for the Help context
*/
protected String getHelpContextId() {
return IJavaHelpContextIds.PROJECTS_VIEW;
}
/**
* Adds additional listeners to this view.
*/
protected void hookViewerListeners() {
}
protected void setInitialInput() {
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/ProjectsView.java
|
IJavaElement root= JavaCore.create(JavaPlugin.getDefault().getWorkspace().getRoot());
getViewer().setInput(root);
updateTitle();
}
/**
* Answers if the given <code>element</code> is a valid
* input for this part.
*
* @param element the object to test
* @return <true> if the given element is a valid input
*/
protected boolean isValidInput(Object element) {
return element instanceof IJavaModel;
}
/**
* Answers if the given <code>element</code> is a valid
* element for this part.
*
* @param element the object to test
* @return <true> if the given element is a valid element
*/
protected boolean isValidElement(Object element) {
return element instanceof IJavaProject || element instanceof IPackageFragmentRoot;
}
/**
* Finds the element which has to be selected in this part.
*
* @param je the Java element which has the focus
*/
protected IJavaElement findElementToSelect(IJavaElement je) {
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/ProjectsView.java
|
if (je == null)
return null;
switch (je.getElementType()) {
case IJavaElement.JAVA_MODEL :
return null;
case IJavaElement.JAVA_PROJECT:
return je;
case IJavaElement.PACKAGE_FRAGMENT_ROOT:
if (je.getElementName().equals(IPackageFragmentRoot.DEFAULT_PACKAGEROOT_PATH))
return je.getParent();
else
return je;
default :
return findElementToSelect(je.getParent());
}
}
/*
* @see JavaBrowsingPart#setInput(Object)
*/
protected void setInput(Object input) {
if (input != null)
super.setInput(input);
else
getViewer().setSelection(null);
}
}
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
/*******************************************************************************
* Copyright (c) 2002 International Business Machines Corp. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.jdt.internal.ui.packageview;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.actions.ActionGroup;
import org.eclipse.ui.actions.MoveResourceAction;
import org.eclipse.ui.actions.NewWizardMenu;
import org.eclipse.ui.actions.OpenInNewWindowAction;
import org.eclipse.ui.actions.RefreshAction;
import org.eclipse.ui.actions.RenameResourceAction;
import org.eclipse.ui.views.framelist.BackAction;
import org.eclipse.ui.views.framelist.ForwardAction;
import org.eclipse.ui.views.framelist.FrameList;
import org.eclipse.ui.views.framelist.GoIntoAction;
import org.eclipse.ui.views.framelist.UpAction;
import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
import org.eclipse.jdt.core.IOpenable;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.IContextMenuConstants;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jdt.ui.actions.BuildActionGroup;
import org.eclipse.jdt.ui.actions.CCPActionGroup;
import org.eclipse.jdt.ui.actions.GenerateActionGroup;
import org.eclipse.jdt.ui.actions.ImportActionGroup;
import org.eclipse.jdt.ui.actions.JavaSearchActionGroup;
import org.eclipse.jdt.ui.actions.JdtActionConstants;
import org.eclipse.jdt.ui.actions.MemberFilterActionGroup;
import org.eclipse.jdt.ui.actions.NavigateActionGroup;
import org.eclipse.jdt.ui.actions.OpenAction;
import org.eclipse.jdt.ui.actions.RefactorActionGroup;
import org.eclipse.jdt.ui.actions.ShowActionGroup;
import org.eclipse.jdt.internal.ui.actions.CompositeActionGroup;
import org.eclipse.jdt.internal.ui.preferences.JavaBasePreferencePage;
import org.eclipse.jdt.internal.ui.workingsets.WorkingSetFilterActionGroup;
public class PackageExplorerActionGroup extends CompositeActionGroup implements ISelectionChangedListener {
private PackageExplorerPart fPart;
private GoIntoAction fZoomInAction;
private BackAction fBackAction;
private ForwardAction fForwardAction;
private UpAction fUpAction;
private GotoTypeAction fGotoTypeAction;
private GotoPackageAction fGotoPackageAction;
private RenameResourceAction fRenameResourceAction;
private MoveResourceAction fMoveResourceAction;
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
private NavigateActionGroup fNavigateActionGroup;
private BuildActionGroup fBuildActionGroup;
private CCPActionGroup fCCPActionGroup;
private WorkingSetFilterActionGroup fWorkingSetFilterActionGroup;
private MemberFilterActionGroup fMemberFilterActionGroup;
private ShowLibrariesAction fShowLibrariesAction;
private FilterSelectionAction fFilterAction;
public PackageExplorerActionGroup(PackageExplorerPart part) {
super();
fPart= part;
Shell shell= fPart.getSite().getShell();
ISelectionProvider provider= fPart.getSite().getSelectionProvider();
IStructuredSelection selection= (IStructuredSelection) provider.getSelection();
setGroups(new ActionGroup[] {
fNavigateActionGroup= new NavigateActionGroup(fPart),
new ShowActionGroup(fPart),
fCCPActionGroup= new CCPActionGroup(fPart),
new RefactorActionGroup(fPart),
new ImportActionGroup(fPart),
new GenerateActionGroup(fPart),
fBuildActionGroup= new BuildActionGroup(fPart),
new JavaSearchActionGroup(fPart, fPart.getViewer()),
fWorkingSetFilterActionGroup= new WorkingSetFilterActionGroup(part.getViewer(), JavaUI.ID_PACKAGES, shell, createTitleUpdater())});
PackagesFrameSource frameSource= new PackagesFrameSource(fPart);
FrameList frameList= new FrameList(frameSource);
frameSource.connectTo(frameList);
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
fZoomInAction= new GoIntoAction(frameList);
fBackAction= new BackAction(frameList);
fForwardAction= new ForwardAction(frameList);
fUpAction= new UpAction(frameList);
fRenameResourceAction= new RenameResourceAction(shell);
fMoveResourceAction= new MoveResourceAction(shell);
fGotoTypeAction= new GotoTypeAction(fPart);
fGotoPackageAction= new GotoPackageAction(fPart);
fMemberFilterActionGroup= new MemberFilterActionGroup(fPart.getViewer(), "PackageView");
fShowLibrariesAction = new ShowLibrariesAction(fPart, PackagesMessages.getString("PackageExplorer.referencedLibs"));
fFilterAction = new FilterSelectionAction(shell, fPart, PackagesMessages.getString("PackageExplorer.filters"));
provider.addSelectionChangedListener(this);
update(selection);
}
public void dispose() {
ISelectionProvider provider= fPart.getSite().getSelectionProvider();
provider.removeSelectionChangedListener(this);
super.dispose();
}
public void selectionChanged(SelectionChangedEvent event) {
fRenameResourceAction.selectionChanged(event);
fMoveResourceAction.selectionChanged(event);
IStructuredSelection selection= (IStructuredSelection)event.getSelection();
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
update(selection);
}
private void update(IStructuredSelection selection) {
int size= selection.size();
Object element= selection.getFirstElement();
IActionBars actionBars= fPart.getViewSite().getActionBars();
if (size == 1 && element instanceof IResource) {
actionBars.setGlobalActionHandler(IWorkbenchActionConstants.RENAME, fRenameResourceAction);
actionBars.setGlobalActionHandler(IWorkbenchActionConstants.MOVE, fMoveResourceAction);
} else {
actionBars.setGlobalActionHandler(IWorkbenchActionConstants.RENAME, null);
actionBars.setGlobalActionHandler(IWorkbenchActionConstants.MOVE, null);
}
actionBars.updateActionBars();
}
void restoreState(IMemento memento) {
fMemberFilterActionGroup.restoreState(memento);
fWorkingSetFilterActionGroup.restoreState(memento);
}
void saveState(IMemento memento) {
fMemberFilterActionGroup.saveState(memento);
fWorkingSetFilterActionGroup.saveState(memento);
}
public void fillActionBars(IActionBars actionBars) {
super.fillActionBars(actionBars);
setGlobalActionHandlers(actionBars);
fillToolBar(actionBars.getToolBarManager());
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
fillViewMenu(actionBars.getMenuManager());
}
private void setGlobalActionHandlers(IActionBars actionBars) {
actionBars.setGlobalActionHandler(IWorkbenchActionConstants.GO_INTO, fZoomInAction);
actionBars.setGlobalActionHandler(IWorkbenchActionConstants.BACK, fBackAction);
actionBars.setGlobalActionHandler(IWorkbenchActionConstants.FORWARD, fForwardAction);
actionBars.setGlobalActionHandler(IWorkbenchActionConstants.UP, fUpAction);
actionBars.setGlobalActionHandler(JdtActionConstants.GOTO_TYPE, fGotoTypeAction);
actionBars.setGlobalActionHandler(JdtActionConstants.GOTO_PACKAGE, fGotoPackageAction);
}
void fillToolBar(IToolBarManager toolBar) {
toolBar.removeAll();
toolBar.add(fBackAction);
toolBar.add(fForwardAction);
toolBar.add(fUpAction);
if (JavaBasePreferencePage.showCompilationUnitChildren()) {
toolBar.add(new Separator());
fMemberFilterActionGroup.contributeToToolBar(toolBar);
}
}
void fillViewMenu(IMenuManager menu) {
menu.add(fFilterAction);
menu.add(fShowLibrariesAction);
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end"));
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
}
void handleSelectionChanged(SelectionChangedEvent event) {
fZoomInAction.update();
}
public void fillContextMenu(IMenuManager menu) {
IStructuredSelection selection= (IStructuredSelection)getContext().getSelection();
int size= selection.size();
Object element= selection.getFirstElement();
IJavaElement jElement= element instanceof IJavaElement ? (IJavaElement)element : null;
if (size == 0 || (size == 1 && (isNewTarget(jElement) || element instanceof IContainer))) {
IMenuManager newMenu= new MenuManager(PackagesMessages.getString("PackageExplorer.new"));
menu.appendToGroup(IContextMenuConstants.GROUP_NEW, newMenu);
new NewWizardMenu(newMenu, fPart.getSite().getWorkbenchWindow(), false);
}
addGotoMenu(menu, element, size);
addOpenNewWindowAction(menu, element);
super.fillContextMenu(menu);
}
private void addGotoMenu(IMenuManager menu, Object element, int size) {
if (size == 1 && fPart.getViewer().isExpandable(element) && (isGoIntoTarget(element) || element instanceof IContainer))
menu.appendToGroup(IContextMenuConstants.GROUP_GOTO, fZoomInAction);
}
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
private boolean isNewTarget(IJavaElement element) {
if (element == null)
return false;
int type= element.getElementType();
return type == IJavaElement.JAVA_PROJECT ||
type == IJavaElement.PACKAGE_FRAGMENT_ROOT ||
type == IJavaElement.PACKAGE_FRAGMENT ||
type == IJavaElement.COMPILATION_UNIT ||
type == IJavaElement.TYPE;
}
private boolean isGoIntoTarget(Object element) {
if (element == null)
return false;
if (element instanceof IJavaElement) {
int type= ((IJavaElement)element).getElementType();
return type == IJavaElement.JAVA_PROJECT ||
type == IJavaElement.PACKAGE_FRAGMENT_ROOT ||
type == IJavaElement.PACKAGE_FRAGMENT;
}
return false;
}
private void addOpenNewWindowAction(IMenuManager menu, Object element) {
if (element instanceof IJavaElement) {
try {
element= ((IJavaElement)element).getCorrespondingResource();
} catch(JavaModelException e) {
}
}
if (!(element instanceof IContainer))
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
return;
menu.appendToGroup(
IContextMenuConstants.GROUP_OPEN,
new OpenInNewWindowAction(fPart.getSite().getWorkbenchWindow(), (IContainer)element));
}
void handleDoubleClick(DoubleClickEvent event) {
OpenAction openAction= fNavigateActionGroup.getOpenAction();
if (openAction != null && openAction.isEnabled()) {
openAction.run();
return;
}
TreeViewer viewer= fPart.getViewer();
Object element= ((IStructuredSelection)event.getSelection()).getFirstElement();
if (viewer.isExpandable(element)) {
if (JavaBasePreferencePage.doubleClickGoesInto()) {
if (element instanceof IOpenable &&
!(element instanceof ICompilationUnit) &&
!(element instanceof IClassFile)) {
fZoomInAction.run();
}
} else {
viewer.setExpandedState(element, !viewer.getExpandedState(element));
}
}
}
void handleKeyEvent(KeyEvent event) {
if (event.stateMask != 0)
|
3,733 |
Bug 3733 'close project' not available in the package view (1GEHFLT)
|
AK (5/29/01 12:05:55 PM) should the 'close project' action be available also in the package view? NOTES: EG (5/29/01 5:31:26 PM) not for June EG (7/12/01 2:23:28 PM) this requires JavaModel support so that closed projects show up in the UI. Otherwise closing a project makes it disappear.
|
resolved fixed
|
d988952
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T14:36:32Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerActionGroup.java
|
return;
if (event.keyCode == SWT.F5) {
RefreshAction action= fBuildActionGroup.getRefreshAction();
if (action.isEnabled())
action.run();
} else if (event.character == SWT.DEL) {
IAction delete= fCCPActionGroup.getDeleteAction();
if (delete.isEnabled())
delete.run();
}
}
private IPropertyChangeListener createTitleUpdater() {
return new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
String property= event.getProperty();
if (IWorkingSetManager.CHANGE_WORKING_SET_NAME_CHANGE.equals(property)) {
IWorkingSet workingSet= (IWorkingSet)event.getNewValue();
String workingSetName= null;
if (workingSet != null)
workingSetName= workingSet.getName();
fPart.setWorkingSetName(workingSetName);
fPart.updateTitle();
}
}
};
}
}
|
12,720 |
Bug 12720 Can't DND into non-source folder in Packages view
|
Build 20020321 In the Packages view, I can drag a file from the file system onto a project, a package or a source folder. However I cannot drag it onto a non-source folder. I can, however, drag the file onto the project, and then drag it into the non- source folder from within the packages view. The packages view should allow me to drag a file into any folder, just like in the Navigator view.
|
resolved fixed
|
5dacc76
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:25:51Z | 2002-04-03T18:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.packageview;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;
import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DropTargetEvent;
import org.eclipse.swt.dnd.FileTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.dialogs.Dialog;
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.AbstractTreeViewer;
|
12,720 |
Bug 12720 Can't DND into non-source folder in Packages view
|
Build 20020321 In the Packages view, I can drag a file from the file system onto a project, a package or a source folder. However I cannot drag it onto a non-source folder. I can, however, drag the file onto the project, and then drag it into the non- source folder from within the packages view. The packages view should allow me to drag a file into any folder, just like in the Navigator view.
|
resolved fixed
|
5dacc76
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:25:51Z | 2002-04-03T18:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java
|
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.ui.dialogs.IOverwriteQuery;
import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
import org.eclipse.ui.wizards.datatransfer.ImportOperation;
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.JavaModelException;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.dnd.JdtViewerDropAdapter;
import org.eclipse.jdt.internal.ui.dnd.TransferDropTargetListener;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
import org.eclipse.jdt.internal.ui.util.SWTUtil;
/**
* Adapter to handle file drop from other applications.
*/
class FileTransferDropAdapter extends JdtViewerDropAdapter implements IOverwriteQuery, TransferDropTargetListener {
FileTransferDropAdapter(AbstractTreeViewer viewer) {
super(viewer, DND.FEEDBACK_SCROLL | DND.FEEDBACK_EXPAND);
}
public String queryOverwrite(String file) {
String[] returnCodes= {YES, NO, ALL, CANCEL};
int returnVal= openDialog(getViewer().getControl(), file);
return returnVal < 0 ? CANCEL : returnCodes[returnVal];
|
12,720 |
Bug 12720 Can't DND into non-source folder in Packages view
|
Build 20020321 In the Packages view, I can drag a file from the file system onto a project, a package or a source folder. However I cannot drag it onto a non-source folder. I can, however, drag the file onto the project, and then drag it into the non- source folder from within the packages view. The packages view should allow me to drag a file into any folder, just like in the Navigator view.
|
resolved fixed
|
5dacc76
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:25:51Z | 2002-04-03T18:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java
|
}
private int openDialog(final Control control, final String file) {
final int[] result= { Dialog.CANCEL };
control.getDisplay().syncExec(new Runnable() {
public void run() {
String title= PackagesMessages.getString("DropAdapter.question");
String msg= PackagesMessages.getFormattedString("DropAdapter.alreadyExists", file);
String[] options= {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.CANCEL_LABEL};
MessageDialog dialog= new MessageDialog(control.getShell(), title, null, msg, MessageDialog.QUESTION, options, 0);
result[0]= dialog.open();
}
});
return result[0];
}
public Transfer getTransfer() {
return FileTransfer.getInstance();
}
public void validateDrop(Object target, DropTargetEvent event, int operation) {
event.detail= DND.DROP_NONE;
boolean isPackageFragment= target instanceof IPackageFragment;
boolean isJavaProject= target instanceof IJavaProject;
boolean isPackageFragmentRoot= target instanceof IPackageFragmentRoot;
|
12,720 |
Bug 12720 Can't DND into non-source folder in Packages view
|
Build 20020321 In the Packages view, I can drag a file from the file system onto a project, a package or a source folder. However I cannot drag it onto a non-source folder. I can, however, drag the file onto the project, and then drag it into the non- source folder from within the packages view. The packages view should allow me to drag a file into any folder, just like in the Navigator view.
|
resolved fixed
|
5dacc76
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:25:51Z | 2002-04-03T18:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java
|
if (!(isPackageFragment || isJavaProject || isPackageFragmentRoot))
return;
IJavaElement element= (IJavaElement)target;
if (!element.isReadOnly())
event.detail= DND.DROP_COPY;
return;
}
public void drop(Object javaTarget, DropTargetEvent event) {
int operation= event.detail;
event.detail= DND.DROP_NONE;
Object data= event.data;
if (data == null || operation != DND.DROP_COPY)
return;
IContainer target= null;
try {
target= (IContainer)((IJavaElement)javaTarget).getCorrespondingResource();
} catch (JavaModelException e) {
return;
}
List files= checkFiles(SWTUtil.getShell(event.widget),(String[])data, target.getLocation());
if (files.size() > 0) {
Shell shell= JavaPlugin.getActiveWorkbenchShell();
ImportOperation op= new ImportOperation(target.getFullPath(), FileSystemStructureProvider.INSTANCE, this, files);
op.setCreateContainerStructure(false);
|
12,720 |
Bug 12720 Can't DND into non-source folder in Packages view
|
Build 20020321 In the Packages view, I can drag a file from the file system onto a project, a package or a source folder. However I cannot drag it onto a non-source folder. I can, however, drag the file onto the project, and then drag it into the non- source folder from within the packages view. The packages view should allow me to drag a file into any folder, just like in the Navigator view.
|
resolved fixed
|
5dacc76
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:25:51Z | 2002-04-03T18:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java
|
ProgressMonitorDialog dialog= new ProgressMonitorDialog(shell);
try {
dialog.run(true, true, op);
} catch (InvocationTargetException e) {
String title= PackagesMessages.getString("DropAdapter.errorTitle");
String message= PackagesMessages.getString("DropAdapter.errorMessage");
ExceptionHandler.handle(e, title, message);
return;
} catch (InterruptedException e) {
return;
}
IStatus status= op.getStatus();
if (! status.isOK()) {
String title= PackagesMessages.getString("DropAdapter.errorTitle");
String message= PackagesMessages.getString("DropAdapter.errorMessage");
ErrorDialog.openError(shell,
title,
message,
status, IStatus.ERROR | IStatus.WARNING);
return;
}
event.data= files.toArray(new String[files.size()]);
event.detail= DND.DROP_COPY;
return;
|
12,720 |
Bug 12720 Can't DND into non-source folder in Packages view
|
Build 20020321 In the Packages view, I can drag a file from the file system onto a project, a package or a source folder. However I cannot drag it onto a non-source folder. I can, however, drag the file onto the project, and then drag it into the non- source folder from within the packages view. The packages view should allow me to drag a file into any folder, just like in the Navigator view.
|
resolved fixed
|
5dacc76
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:25:51Z | 2002-04-03T18:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java
|
} else {
event.data= null;
return;
}
}
private List checkFiles(Shell shell, String[] files, IPath target) {
List result= new ArrayList(10);
int lengthCompare= target.segmentCount() + 1;
for (int i= 0; i < files.length; i++) {
String file= files[i];
IPath path= new Path(file);
String error= null;
if (path.equals(target)) {
error= PackagesMessages.getFormattedString("DropAdapter.errorSame", target.lastSegment());
} else if (path.isPrefixOf(target)) {
error= PackagesMessages.getFormattedString("DropAdapter.errorSubfolder", path.lastSegment());
}
if (error != null) {
MessageDialog.openError(shell, PackagesMessages.getString("DropAdapter.errorTitle"), error);
return new ArrayList(0);
}
if (target.isPrefixOf(path) && lengthCompare == path.segmentCount())
continue;
result.add(new File(file));
}
return result;
}
}
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java
|
/*******************************************************************************
* Copyright (c) 2000, 2002 International Business Machines Corp. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.jdt.internal.ui.text.correction;
import java.util.List;
import org.eclipse.jdt.core.IBuffer;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.ToolFactory;
import org.eclipse.jdt.core.compiler.IScanner;
import org.eclipse.jdt.core.compiler.InvalidInputException;
import org.eclipse.jdt.core.dom.ASTNode;
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java
|
import org.eclipse.jdt.core.dom.ArrayAccess;
import org.eclipse.jdt.core.dom.ArrayCreation;
import org.eclipse.jdt.core.dom.Assignment;
import org.eclipse.jdt.core.dom.BodyDeclaration;
import org.eclipse.jdt.core.dom.CastExpression;
import org.eclipse.jdt.core.dom.ClassInstanceCreation;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.ConditionalExpression;
import org.eclipse.jdt.core.dom.ConstructorInvocation;
import org.eclipse.jdt.core.dom.Expression;
import org.eclipse.jdt.core.dom.FieldDeclaration;
import org.eclipse.jdt.core.dom.IMethodBinding;
import org.eclipse.jdt.core.dom.ITypeBinding;
import org.eclipse.jdt.core.dom.InfixExpression;
import org.eclipse.jdt.core.dom.Initializer;
import org.eclipse.jdt.core.dom.InstanceofExpression;
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.MethodInvocation;
import org.eclipse.jdt.core.dom.Modifier;
import org.eclipse.jdt.core.dom.PrefixExpression;
import org.eclipse.jdt.core.dom.SimpleName;
import org.eclipse.jdt.core.dom.Statement;
import org.eclipse.jdt.core.dom.SuperConstructorInvocation;
import org.eclipse.jdt.core.dom.SwitchStatement;
import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
import org.eclipse.jdt.internal.corext.dom.ASTNodes;
import org.eclipse.jdt.internal.corext.dom.Selection;
import org.eclipse.jdt.internal.corext.dom.SelectionAnalyzer;
public class ASTResolving {
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java
|
public static ASTNode findSelectedNode(CompilationUnit cuNode, int offset, int length) {
SelectionAnalyzer analyzer= new SelectionAnalyzer(Selection.createFromStartLength(offset, length), true);
cuNode.accept(analyzer);
return analyzer.getFirstSelectedNode();
}
public static ITypeBinding getTypeBinding(ASTNode node) {
ITypeBinding binding= getPossibleTypeBinding(node);
if (binding != null) {
String name= binding.getName();
if ("null".equals(name) || "void".equals(name)) {
return node.getAST().resolveWellKnownType("java.lang.Object");
} else if (binding.isAnonymous()) {
return binding.getSuperclass();
}
}
return binding;
}
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java
|
private static ITypeBinding getPossibleTypeBinding(ASTNode node) {
ASTNode parent= node.getParent();
switch (parent.getNodeType()) {
case ASTNode.ASSIGNMENT:
Assignment assignment= (Assignment) parent;
if (node.equals(assignment.getLeftHandSide())) {
return assignment.getRightHandSide().resolveTypeBinding();
}
return assignment.getLeftHandSide().resolveTypeBinding();
case ASTNode.INFIX_EXPRESSION:
InfixExpression infix= (InfixExpression) parent;
if (node.equals(infix.getLeftOperand())) {
return infix.getRightOperand().resolveTypeBinding();
}
InfixExpression.Operator op= infix.getOperator();
if (op == InfixExpression.Operator.LEFT_SHIFT || op == InfixExpression.Operator.RIGHT_SHIFT_UNSIGNED
|| op == InfixExpression.Operator.RIGHT_SHIFT_SIGNED) {
return infix.getAST().resolveWellKnownType("int");
}
return infix.getLeftOperand().resolveTypeBinding();
case ASTNode.INSTANCEOF_EXPRESSION:
InstanceofExpression instanceofExpression= (InstanceofExpression) parent;
return instanceofExpression.getRightOperand().resolveBinding();
case ASTNode.VARIABLE_DECLARATION_FRAGMENT:
VariableDeclarationFragment frag= (VariableDeclarationFragment) parent;
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java
|
if (frag.getInitializer().equals(node)) {
ASTNode declaration= frag.getParent();
if (declaration instanceof VariableDeclarationStatement) {
return ((VariableDeclarationStatement)declaration).getType().resolveBinding();
} else if (declaration instanceof FieldDeclaration) {
return ((FieldDeclaration)declaration).getType().resolveBinding();
}
}
break;
case ASTNode.METHOD_INVOCATION:
MethodInvocation methodInvocation= (MethodInvocation) parent;
SimpleName name= methodInvocation.getName();
IMethodBinding methodBinding= ASTNodes.getMethodBinding(name);
if (methodBinding != null) {
return getParameterTypeBinding(node, methodInvocation.arguments(), methodBinding);
}
break;
case ASTNode.SUPER_CONSTRUCTOR_INVOCATION:
SuperConstructorInvocation superInvocation= (SuperConstructorInvocation) parent;
IMethodBinding superBinding= superInvocation.resolveConstructorBinding();
if (superBinding != null) {
return getParameterTypeBinding(node, superInvocation.arguments(), superBinding);
}
break;
case ASTNode.CONSTRUCTOR_INVOCATION:
ConstructorInvocation constrInvocation= (ConstructorInvocation) parent;
IMethodBinding constrBinding= constrInvocation.resolveConstructorBinding();
if (constrBinding != null) {
return getParameterTypeBinding(node, constrInvocation.arguments(), constrBinding);
}
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java
|
break;
case ASTNode.CLASS_INSTANCE_CREATION:
ClassInstanceCreation creation= (ClassInstanceCreation) parent;
IMethodBinding creationBinding= creation.resolveConstructorBinding();
if (creationBinding != null) {
return getParameterTypeBinding(node, creation.arguments(), creationBinding);
}
break;
case ASTNode.PARENTHESIZED_EXPRESSION:
return getTypeBinding(parent);
case ASTNode.ARRAY_ACCESS:
if (((ArrayAccess) parent).getIndex().equals(node)) {
return parent.getAST().resolveWellKnownType("int");
}
break;
case ASTNode.ARRAY_CREATION:
if (((ArrayCreation) parent).dimensions().contains(node)) {
return parent.getAST().resolveWellKnownType("int");
}
break;
case ASTNode.ARRAY_INITIALIZER:
ASTNode initializerParent= parent.getParent();
if (initializerParent instanceof ArrayCreation) {
return ((ArrayCreation) initializerParent).getType().getElementType().resolveBinding();
}
break;
case ASTNode.CONDITIONAL_EXPRESSION:
ConditionalExpression expression= (ConditionalExpression) parent;
if (node.equals(expression.getExpression())) {
return parent.getAST().resolveWellKnownType("boolean");
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java
|
}
if (node.equals(expression.getElseExpression())) {
return expression.getThenExpression().resolveTypeBinding();
}
return expression.getElseExpression().resolveTypeBinding();
case ASTNode.POSTFIX_EXPRESSION:
return parent.getAST().resolveWellKnownType("int");
case ASTNode.PREFIX_EXPRESSION:
if (((PrefixExpression) parent).getOperator() == PrefixExpression.Operator.NOT) {
return parent.getAST().resolveWellKnownType("boolean");
}
return parent.getAST().resolveWellKnownType("int");
case ASTNode.IF_STATEMENT:
case ASTNode.WHILE_STATEMENT:
case ASTNode.DO_STATEMENT:
if (node instanceof Expression) {
return parent.getAST().resolveWellKnownType("boolean");
}
break;
case ASTNode.SWITCH_STATEMENT:
if (((SwitchStatement) parent).getExpression().equals(node)) {
return parent.getAST().resolveWellKnownType("int");
}
break;
case ASTNode.RETURN_STATEMENT:
MethodDeclaration decl= findParentMethodDeclaration(parent);
if (decl != null) {
return decl.getReturnType().resolveBinding();
}
break;
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java
|
case ASTNode.CAST_EXPRESSION:
return ((CastExpression) parent).getType().resolveBinding();
}
return null;
}
private static ITypeBinding getParameterTypeBinding(ASTNode node, List args, IMethodBinding binding) {
ITypeBinding[] paramTypes= binding.getParameterTypes();
int index= args.indexOf(node);
if (index >= 0 && index < paramTypes.length) {
return paramTypes[index];
}
return null;
}
private static MethodDeclaration findParentMethodDeclaration(ASTNode node) {
while ((node != null) && (node.getNodeType() != ASTNode.METHOD_DECLARATION)) {
node= node.getParent();
}
return (MethodDeclaration) node;
}
public static BodyDeclaration findParentBodyDeclaration(ASTNode node) {
while ((node != null) && (!(node instanceof BodyDeclaration))) {
node= node.getParent();
}
return (BodyDeclaration) node;
}
public static Statement findParentStatement(ASTNode node) {
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java
|
while ((node != null) && (!(node instanceof Statement))) {
node= node.getParent();
}
return (Statement) node;
}
public static boolean isInStaticContext(ASTNode selectedNode) {
BodyDeclaration decl= ASTResolving.findParentBodyDeclaration(selectedNode);
if (decl instanceof MethodDeclaration) {
return Modifier.isStatic(((MethodDeclaration)decl).getModifiers());
} else if (decl instanceof Initializer) {
return Modifier.isStatic(((Initializer)decl).getModifiers());
} else if (decl instanceof FieldDeclaration) {
return Modifier.isStatic(((FieldDeclaration)decl).getModifiers());
}
return false;
}
public static IScanner createScanner(ICompilationUnit cu, int pos) throws InvalidInputException, JavaModelException {
IScanner scanner= ToolFactory.createScanner(false, false, false, false);
IBuffer buf= cu.getBuffer();
scanner.setSource(buf.getCharacters());
scanner.resetTo(pos, buf.getLength());
return scanner;
}
}
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java
|
/*******************************************************************************
* Copyright (c) 2000, 2002 International Business Machines Corp. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.jdt.internal.ui.text.correction;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java
|
import org.eclipse.swt.graphics.Image;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.core.dom.Expression;
import org.eclipse.jdt.core.dom.IBinding;
import org.eclipse.jdt.core.dom.ITypeBinding;
import org.eclipse.jdt.core.dom.MethodInvocation;
import org.eclipse.jdt.core.dom.Name;
import org.eclipse.jdt.core.dom.SimpleName;
import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
import org.eclipse.jdt.internal.corext.codemanipulation.ImportEdit;
import org.eclipse.jdt.internal.corext.codemanipulation.MemberEdit;
import org.eclipse.jdt.internal.corext.codemanipulation.NameProposer;
import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
import org.eclipse.jdt.internal.corext.dom.Bindings;
import org.eclipse.jdt.internal.corext.refactoring.changes.CompilationUnitChange;
import org.eclipse.jdt.internal.corext.textmanipulation.TextRange;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
public class NewMethodCompletionProposal extends CUCorrectionProposal {
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java
|
private ICompilationUnit fCurrCU;
private IType fDestType;
private MethodInvocation fNode;
private MemberEdit fMemberEdit;
public NewMethodCompletionProposal(String label, MethodInvocation node, ICompilationUnit currCU, IType destType, int relevance) throws CoreException {
super(label, destType.getCompilationUnit(), relevance);
fDestType= destType;
fCurrCU= currCU;
fNode= node;
fMemberEdit= null;
}
private boolean isLocalChange() {
return fDestType.getCompilationUnit().equals(fCurrCU);
}
/*
* @see JavaCorrectionProposal#addEdits(CompilationUnitChange)
*/
protected void addEdits(CompilationUnitChange changeElement) throws CoreException {
ICompilationUnit changedCU= changeElement.getCompilationUnit();
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java
|
ImportEdit importEdit= new ImportEdit(changedCU, settings);
IMethod currMethod= null;
IJavaElement elem= fCurrCU.getElementAt(fNode.getStartPosition());
if (elem != null && elem.getElementType() == IJavaElement.METHOD) {
currMethod= (IMethod) elem;
}
String content= generateStub(importEdit, settings);
int insertPos= MemberEdit.ADD_AT_END;
IJavaElement anchor= fDestType;
if (isLocalChange() && currMethod != null) {
anchor= elem;
insertPos= MemberEdit.INSERT_AFTER;
}
fMemberEdit= new MemberEdit(anchor, insertPos, new String[] { content }, settings.tabWidth);
fMemberEdit.setUseFormatter(true);
if (!importEdit.isEmpty()) {
changeElement.addTextEdit("Add imports", importEdit);
}
changeElement.addTextEdit("Add method", fMemberEdit);
}
private String generateStub(ImportEdit importEdit, CodeGenerationSettings settings) throws CoreException {
String methodName= fNode.getName().getIdentifier();
List arguments= fNode.arguments();
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java
|
boolean isStatic= false;
Expression sender= fNode.getExpression();
if (sender != null) {
if (sender instanceof Name) {
IBinding binding= ((Name) sender).resolveBinding();
if (binding != null) {
isStatic= (binding.getKind() == binding.TYPE);
}
}
} else {
isStatic= ASTResolving.isInStaticContext(fNode);
}
boolean isInterface= fDestType.isInterface();
boolean isSameType= isLocalChange();
ITypeBinding returnType= evaluateMethodType(fNode, importEdit);
String returnTypeName= returnType.getName();
String[] paramTypes= new String[arguments.size()];
for (int i= 0; i < paramTypes.length; i++) {
ITypeBinding binding= evaluateParameterType((Expression) arguments.get(i), importEdit);
paramTypes[i]= (binding != null) ? binding.getName() : "Object";
}
String[] paramNames= getParameterNames(paramTypes, arguments);
StringBuffer buf= new StringBuffer();
if (settings.createComments) {
StubUtility.genJavaDocStub("Method " + methodName, paramNames, Signature.createTypeSignature(returnTypeName, true), null, buf);
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java
|
}
if (isSameType) {
buf.append("private ");
} else if (!isInterface) {
buf.append("public ");
}
if (isStatic) {
buf.append("static ");
}
buf.append(returnTypeName);
buf.append(' ');
buf.append(methodName);
buf.append('(');
if (!arguments.isEmpty()) {
for (int i= 0; i < arguments.size(); i++) {
if (i > 0) {
buf.append(", ");
}
buf.append(paramTypes[i]);
buf.append(' ');
buf.append(paramNames[i]);
}
}
buf.append(')');
if (isInterface) {
buf.append(";\n");
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java
|
} else {
buf.append("{\n");
if (!returnType.isPrimitive()) {
buf.append("return null;\n");
} else if (returnTypeName.equals("boolean")) {
buf.append("return false;\n");
} else if (!returnTypeName.equals("void")) {
buf.append("return 0;\n");
}
buf.append("}\n");
}
return buf.toString();
}
private String[] getParameterNames(String[] paramTypes, List arguments) {
ArrayList names= new ArrayList(paramTypes.length);
NameProposer nameProposer= new NameProposer();
for (int i= 0; i < paramTypes.length; i++) {
String name;
Object currArg= arguments.get(i);
if (currArg instanceof SimpleName) {
name= ((SimpleName) currArg).getIdentifier();
} else {
name= nameProposer.proposeParameterName(paramTypes[i]);
}
while (names.contains(name)) {
name= name + '1';
}
names.add(name);
|
15,330 |
Bug 15330 NPE with quickfix
|
build 0425 JButton desktop=new JButton("Hintergrund"); desktop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JDesktopPane pane=SwingUtilities<ERROR>(JDesktopPane.class,this); } }); <ERROR> it should be SwingUtilities.getAnchestorOfClass Of course the above code snippet produceed an error and quickfix notified to have an idea. I pressed ctrl+1 and got informed it could create a method, short after that a NPE occured. org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StringIndexOutOfBoundsException: String index out of range: 0) at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:96) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403) *** Stack trace of contained exception *** java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:516) at org.eclipse.jdt.internal.corext.codemanipulation.NameProposer.proposeParameterNa me(NameProposer.java:87) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.getParam eterNames(NewMethodCompletionProposal.java:199) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.generate Stub(NewMethodCompletionProposal.java:139) at org.eclipse.jdt.internal.ui.text.correction.NewMethodCompletionProposal.addEdits (NewMethodCompletionProposal.java:91) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getChange (CUCorrectionProposal.java:58) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getCompilationU nitChange(CUCorrectionProposal.java:132) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalPr oposalInfo(CUCorrectionProposal.java:74) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation (AdditionalInfoController.java:185) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation (AbstractInformationControlManager.java:536) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run (AdditionalInfoController.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1389) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1211) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833) at org.eclipse.ui.internal.Workbench.run(Workbench.java:816) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:643) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:160) at org.eclipse.core.launcher.Main.run(Main.java:548) at org.eclipse.core.launcher.Main.main(Main.java:403)
|
resolved fixed
|
0b6a99d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-07T16:53:48Z | 2002-05-06T15:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java
|
}
return (String[]) names.toArray(new String[names.size()]);
}
private ITypeBinding evaluateMethodType(MethodInvocation invocation, ImportEdit importEdit) {
ITypeBinding binding= ASTResolving.getTypeBinding(invocation);
if (binding != null) {
ITypeBinding baseType= binding.isArray() ? binding.getElementType() : binding;
if (!baseType.isPrimitive()) {
importEdit.addImport(Bindings.getFullyQualifiedName(baseType));
}
return binding;
}
return invocation.getAST().resolveWellKnownType("void");
}
private ITypeBinding evaluateParameterType(Expression expr, ImportEdit importEdit) {
ITypeBinding binding= expr.resolveTypeBinding();
if (binding != null) {
ITypeBinding baseType= binding.isArray() ? binding.getElementType() : binding;
if (!baseType.isPrimitive()) {
importEdit.addImport(Bindings.getFullyQualifiedName(baseType));
}
if (binding.getName().equals("null")) {
binding= expr.getAST().resolveWellKnownType("java.lang.Object");
}
}
return binding;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.