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,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
|
/*
* @see ICompletionProposal#getImage()
*/
public Image getImage() {
return JavaPluginImages.get(JavaPluginImages.IMG_MISC_PUBLIC);
}
/* (non-Javadoc)
* @see ICompletionProposal#apply(IDocument)
*/
public void apply(IDocument document) {
try {
IEditorPart part= null;
if (!isLocalChange()) {
part= EditorUtility.openInEditor(fDestType.getCompilationUnit(), true);
}
super.apply(document);
if (part instanceof ITextEditor) {
TextRange range= getCompilationUnitChange().getNewTextRange(fMemberEdit);
((ITextEditor) part).selectAndReveal(range.getOffset(), range.getLength());
}
} catch (PartInitException e) {
JavaPlugin.log(e);
} catch (CoreException e) {
JavaPlugin.log(e);
}
}
}
|
3,913 |
Bug 3913 icons for interface members (1GF5V6P)
|
AK (6/11/01 4:44:53 PM) icons for interface members should be as follows: - for fields: always public static and final - for methods: always public and abstract NOTES: EG (6/11/2001 5:27:23 AM) no action for June.
|
resolved fixed
|
cf8b488
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T08:26:39Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.viewsupport;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.Assert;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.model.IWorkbenchAdapter;
|
3,913 |
Bug 3913 icons for interface members (1GF5V6P)
|
AK (6/11/01 4:44:53 PM) icons for interface members should be as follows: - for fields: always public static and final - for methods: always public and abstract NOTES: EG (6/11/2001 5:27:23 AM) no action for June.
|
resolved fixed
|
cf8b488
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T08:26:39Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.ISourceReference;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.JavaElementImageDescriptor;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
/**
* Default strategy of the Java plugin for the construction of Java element icons.
*/
public class JavaElementImageProvider {
/**
* Flags for the JavaImageLabelProvider:
* Generate images with overlays.
*/
public final static int OVERLAY_ICONS= 0x1;
/**
* Generate small sized images.
*/
public final static int SMALL_ICONS= 0x2;
/**
|
3,913 |
Bug 3913 icons for interface members (1GF5V6P)
|
AK (6/11/01 4:44:53 PM) icons for interface members should be as follows: - for fields: always public static and final - for methods: always public and abstract NOTES: EG (6/11/2001 5:27:23 AM) no action for June.
|
resolved fixed
|
cf8b488
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T08:26:39Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
* Use the 'light' style for rendering types.
*/
public final static int LIGHT_TYPE_ICONS= 0x4;
private static final Point SMALL_SIZE= new Point(16, 16);
private static final Point BIG_SIZE= new Point(22, 16);
private static ImageDescriptor DESC_OBJ_PROJECT_CLOSED;
private static ImageDescriptor DESC_OBJ_PROJECT;
private static ImageDescriptor DESC_OBJ_FOLDER;
{
ISharedImages images= JavaPlugin.getDefault().getWorkbench().getSharedImages();
DESC_OBJ_PROJECT_CLOSED= images.getImageDescriptor(ISharedImages.IMG_OBJ_PROJECT_CLOSED);
DESC_OBJ_PROJECT= images.getImageDescriptor(ISharedImages.IMG_OBJ_PROJECT);
DESC_OBJ_FOLDER= images.getImageDescriptor(ISharedImages.IMG_OBJ_FOLDER);
}
private ImageDescriptorRegistry fRegistry;
public JavaElementImageProvider() {
fRegistry= JavaPlugin.getImageDescriptorRegistry();
}
/**
* Returns the icon for a given element. The icon depends on the element type
* and element properties. If configured, overlay icons are constructed for
* <code>ISourceReference</code>s.
* @param flags Flags as defined by the JavaImageLabelProvider
*/
public Image getImageLabel(Object element, int flags) {
ImageDescriptor descriptor= null;
if (element instanceof IJavaElement) {
|
3,913 |
Bug 3913 icons for interface members (1GF5V6P)
|
AK (6/11/01 4:44:53 PM) icons for interface members should be as follows: - for fields: always public static and final - for methods: always public and abstract NOTES: EG (6/11/2001 5:27:23 AM) no action for June.
|
resolved fixed
|
cf8b488
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T08:26:39Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
descriptor= getJavaImageDescriptor((IJavaElement) element, flags);
} else if (element instanceof IAdaptable) {
descriptor= getWorkbenchImageDescriptor((IAdaptable) element, flags);
}
if (descriptor != null) {
return fRegistry.get(descriptor);
}
return null;
}
private boolean showOverlayIcons(int flags) {
return (flags & OVERLAY_ICONS) != 0;
}
private boolean useSmallSize(int flags) {
return (flags & SMALL_ICONS) != 0;
}
private boolean useLightIcons(int flags) {
return (flags & LIGHT_TYPE_ICONS) != 0;
}
/**
* Returns an image descriptor for a java element. The descriptor includes overlays, if specified.
*/
public ImageDescriptor getJavaImageDescriptor(IJavaElement element, int flags) {
int adornmentFlags= computeJavaAdornmentFlags(element, flags);
Point size= useSmallSize(flags) ? SMALL_SIZE : BIG_SIZE;
return new JavaElementImageDescriptor(getBaseImageDescriptor(element, flags), adornmentFlags, size);
}
|
3,913 |
Bug 3913 icons for interface members (1GF5V6P)
|
AK (6/11/01 4:44:53 PM) icons for interface members should be as follows: - for fields: always public static and final - for methods: always public and abstract NOTES: EG (6/11/2001 5:27:23 AM) no action for June.
|
resolved fixed
|
cf8b488
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T08:26:39Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
/**
* Returns an image descriptor for a IAdaptable. The descriptor includes overlays, if specified (only error ticks apply).
* Returns <code>null</code> if no image could be found.
*/
public ImageDescriptor getWorkbenchImageDescriptor(IAdaptable adaptable, int flags) {
IWorkbenchAdapter wbAdapter= (IWorkbenchAdapter) adaptable.getAdapter(IWorkbenchAdapter.class);
if (wbAdapter == null) {
return null;
}
ImageDescriptor descriptor= wbAdapter.getImageDescriptor(adaptable);
if (descriptor == null) {
return null;
}
Point size= useSmallSize(flags) ? SMALL_SIZE : BIG_SIZE;
return new JavaElementImageDescriptor(descriptor, 0, size);
}
/**
* Returns an image descriptor for a java element. This is the base image, no overlays.
*/
public ImageDescriptor getBaseImageDescriptor(IJavaElement element, int renderFlags) {
try {
switch (element.getElementType()) {
case IJavaElement.INITIALIZER:
case IJavaElement.METHOD:
case IJavaElement.FIELD: {
IMember member= (IMember) element;
|
3,913 |
Bug 3913 icons for interface members (1GF5V6P)
|
AK (6/11/01 4:44:53 PM) icons for interface members should be as follows: - for fields: always public static and final - for methods: always public and abstract NOTES: EG (6/11/2001 5:27:23 AM) no action for June.
|
resolved fixed
|
cf8b488
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T08:26:39Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
if (member.getDeclaringType().isInterface())
return JavaPluginImages.DESC_MISC_PUBLIC;
int flags= member.getFlags();
if (Flags.isPublic(flags))
return JavaPluginImages.DESC_MISC_PUBLIC;
if (Flags.isProtected(flags))
return JavaPluginImages.DESC_MISC_PROTECTED;
if (Flags.isPrivate(flags))
return JavaPluginImages.DESC_MISC_PRIVATE;
return JavaPluginImages.DESC_MISC_DEFAULT;
}
case IJavaElement.PACKAGE_DECLARATION:
return JavaPluginImages.DESC_OBJS_PACKDECL;
case IJavaElement.IMPORT_DECLARATION:
return JavaPluginImages.DESC_OBJS_IMPDECL;
case IJavaElement.IMPORT_CONTAINER:
return JavaPluginImages.DESC_OBJS_IMPCONT;
case IJavaElement.TYPE: {
IType type= (IType) element;
if (useLightIcons(renderFlags)) {
if (type.isClass())
return JavaPluginImages.DESC_OBJS_CLASSALT;
else
return JavaPluginImages.DESC_OBJS_INTERFACEALT;
|
3,913 |
Bug 3913 icons for interface members (1GF5V6P)
|
AK (6/11/01 4:44:53 PM) icons for interface members should be as follows: - for fields: always public static and final - for methods: always public and abstract NOTES: EG (6/11/2001 5:27:23 AM) no action for June.
|
resolved fixed
|
cf8b488
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T08:26:39Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
}
int flags= type.getFlags();
boolean hasVisibility= Flags.isPublic(flags) || Flags.isPrivate(flags) || Flags.isProtected(flags);
if (type.isClass())
return hasVisibility ? JavaPluginImages.DESC_OBJS_CLASS : JavaPluginImages.DESC_OBJS_PCLASS;
return hasVisibility ? JavaPluginImages.DESC_OBJS_INTERFACE : JavaPluginImages.DESC_OBJS_PINTERFACE;
}
case IJavaElement.PACKAGE_FRAGMENT_ROOT: {
IPackageFragmentRoot root= (IPackageFragmentRoot) element;
if (root.isArchive()) {
IPath attach= root.getSourceAttachmentPath();
if (root.isExternal()) {
if (attach == null) {
return JavaPluginImages.DESC_OBJS_EXTJAR;
} else {
return JavaPluginImages.DESC_OBJS_EXTJAR_WSRC;
}
} else {
if (attach == null) {
return JavaPluginImages.DESC_OBJS_JAR;
} else {
return JavaPluginImages.DESC_OBJS_JAR_WSRC;
}
}
} else {
return JavaPluginImages.DESC_OBJS_PACKFRAG_ROOT;
}
}
|
3,913 |
Bug 3913 icons for interface members (1GF5V6P)
|
AK (6/11/01 4:44:53 PM) icons for interface members should be as follows: - for fields: always public static and final - for methods: always public and abstract NOTES: EG (6/11/2001 5:27:23 AM) no action for June.
|
resolved fixed
|
cf8b488
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T08:26:39Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
case IJavaElement.PACKAGE_FRAGMENT:
IPackageFragment fragment= (IPackageFragment)element;
try {
if (!fragment.hasChildren() && (fragment.getNonJavaResources().length >0))
return DESC_OBJ_FOLDER;
} catch(JavaModelException e) {
return DESC_OBJ_FOLDER;
}
return JavaPluginImages.DESC_OBJS_PACKAGE;
case IJavaElement.COMPILATION_UNIT:
return JavaPluginImages.DESC_OBJS_CUNIT;
case IJavaElement.CLASS_FILE:
/* this is too expensive for large packages
try {
IClassFile cfile= (IClassFile)element;
if (cfile.isClass())
return JavaPluginImages.IMG_OBJS_CFILECLASS;
return JavaPluginImages.IMG_OBJS_CFILEINT;
} catch(JavaModelException e) {
// fall through;
}*/
return JavaPluginImages.DESC_OBJS_CFILE;
case IJavaElement.JAVA_PROJECT:
IJavaProject jp= (IJavaProject)element;
if (jp.getProject().isOpen()) {
|
3,913 |
Bug 3913 icons for interface members (1GF5V6P)
|
AK (6/11/01 4:44:53 PM) icons for interface members should be as follows: - for fields: always public static and final - for methods: always public and abstract NOTES: EG (6/11/2001 5:27:23 AM) no action for June.
|
resolved fixed
|
cf8b488
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T08:26:39Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
IProject project= jp.getProject();
IWorkbenchAdapter adapter= (IWorkbenchAdapter)project.getAdapter(IWorkbenchAdapter.class);
if (adapter != null) {
ImageDescriptor result= adapter.getImageDescriptor(project);
if (result != null)
return result;
}
return DESC_OBJ_PROJECT;
}
return DESC_OBJ_PROJECT_CLOSED;
case IJavaElement.JAVA_MODEL:
return JavaPluginImages.DESC_OBJS_JAVA_MODEL;
}
Assert.isTrue(false, JavaUIMessages.getString("JavaImageLabelprovider.assert.wrongImage"));
return null;
} catch (CoreException e) {
JavaPlugin.log(e);
return JavaPluginImages.DESC_OBJS_GHOST;
}
}
private int computeJavaAdornmentFlags(IJavaElement element, int renderFlags) {
int flags= 0;
if (showOverlayIcons(renderFlags) && element instanceof ISourceReference) {
|
3,913 |
Bug 3913 icons for interface members (1GF5V6P)
|
AK (6/11/01 4:44:53 PM) icons for interface members should be as follows: - for fields: always public static and final - for methods: always public and abstract NOTES: EG (6/11/2001 5:27:23 AM) no action for June.
|
resolved fixed
|
cf8b488
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T08:26:39Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
ISourceReference sourceReference= (ISourceReference)element;
int modifiers= getModifiers(sourceReference);
if (Flags.isAbstract(modifiers) && confirmAbstract((IMember) sourceReference))
flags |= JavaElementImageDescriptor.ABSTRACT;
if (Flags.isFinal(modifiers))
flags |= JavaElementImageDescriptor.FINAL;
if (Flags.isSynchronized(modifiers) && confirmSynchronized((IMember) sourceReference))
flags |= JavaElementImageDescriptor.SYNCHRONIZED;
if (Flags.isStatic(modifiers))
flags |= JavaElementImageDescriptor.STATIC;
if (sourceReference instanceof IType) {
try {
if (JavaModelUtil.hasMainMethod((IType)sourceReference))
flags |= JavaElementImageDescriptor.RUNNABLE;
} catch (JavaModelException e) {
}
}
}
return flags;
}
private boolean confirmAbstract(IMember member) {
IType t= member.getDeclaringType();
if (t == null && member instanceof IType)
t= (IType) member;
|
3,913 |
Bug 3913 icons for interface members (1GF5V6P)
|
AK (6/11/01 4:44:53 PM) icons for interface members should be as follows: - for fields: always public static and final - for methods: always public and abstract NOTES: EG (6/11/2001 5:27:23 AM) no action for June.
|
resolved fixed
|
cf8b488
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T08:26:39Z | 2001-10-11T03:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
if (t != null) {
try {
return !t.isInterface();
} catch (JavaModelException x) {
}
}
return true;
}
private boolean confirmSynchronized(IMember member) {
return !(member instanceof IType);
}
private int getModifiers(ISourceReference sourceReference) {
if (sourceReference instanceof IMember) {
try {
return ((IMember) sourceReference).getFlags();
} catch (JavaModelException x) {
}
}
return 0;
}
public void dispose() {
}
}
|
8,595 |
Bug 8595 'Open super implementation' should be disabled
|
In the Outline view, there seems to be a new menu item 'Open super implementation', and a corresponding decoration on methods to indicate thet they have a super implementation. The UI already knows if the method has a super implementation, so it should disable the menu item when there is no super implementation to open to. Currently it just does nothing if you select a method with no super implementation. (Tested against 20020125 build)
|
resolved fixed
|
7a45fc9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T12:56:52Z | 2002-01-28T15:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenSuperImplementationAction.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.ui.actions;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
|
8,595 |
Bug 8595 'Open super implementation' should be disabled
|
In the Outline view, there seems to be a new menu item 'Open super implementation', and a corresponding decoration on methods to indicate thet they have a super implementation. The UI already knows if the method has a super implementation, so it should disable the menu item when there is no super implementation to open to. Currently it just does nothing if you select a method with no super implementation. (Tested against 20020125 build)
|
resolved fixed
|
7a45fc9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T12:56:52Z | 2002-01-28T15:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenSuperImplementationAction.java
|
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.ITypeHierarchy;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.ActionMessages;
import org.eclipse.jdt.internal.ui.actions.OpenActionUtil;
import org.eclipse.jdt.internal.ui.actions.SelectionConverter;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
/**
* This action opens a java editor on the super implementation of a element represented by either
* <ul>
* <li>a text selection inside a Java editor, or </li>
* <li>a structured selection of a view part showing Java elements</li>
* </ul>
*
* <p>
* This class may be instantiated; it is not intended to be subclassed.
* </p>
*
* @since 2.0
*/
public class OpenSuperImplementationAction extends SelectionDispatchAction {
|
8,595 |
Bug 8595 'Open super implementation' should be disabled
|
In the Outline view, there seems to be a new menu item 'Open super implementation', and a corresponding decoration on methods to indicate thet they have a super implementation. The UI already knows if the method has a super implementation, so it should disable the menu item when there is no super implementation to open to. Currently it just does nothing if you select a method with no super implementation. (Tested against 20020125 build)
|
resolved fixed
|
7a45fc9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T12:56:52Z | 2002-01-28T15:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenSuperImplementationAction.java
|
private JavaEditor fEditor;
/* (non-Javadoc)
* Class implements IObjectActionDelegate
*/
public static class ObjectDelegate implements IObjectActionDelegate {
private OpenSuperImplementationAction fAction;
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
fAction= new OpenSuperImplementationAction(targetPart.getSite());
}
public void run(IAction action) {
fAction.run();
}
public void selectionChanged(IAction action, ISelection selection) {
if (fAction == null)
action.setEnabled(false);
}
}
/**
* Creates a new <code>OpenSuperImplementationAction</code>.
*
* @param site the site providing context information for this action
*/
|
8,595 |
Bug 8595 'Open super implementation' should be disabled
|
In the Outline view, there seems to be a new menu item 'Open super implementation', and a corresponding decoration on methods to indicate thet they have a super implementation. The UI already knows if the method has a super implementation, so it should disable the menu item when there is no super implementation to open to. Currently it just does nothing if you select a method with no super implementation. (Tested against 20020125 build)
|
resolved fixed
|
7a45fc9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T12:56:52Z | 2002-01-28T15:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenSuperImplementationAction.java
|
public OpenSuperImplementationAction(IWorkbenchSite site) {
super(site);
setText(ActionMessages.getString("OpenSuperImplementationAction.label"));
setDescription(ActionMessages.getString("OpenSuperImplementationAction.description"));
setToolTipText(ActionMessages.getString("OpenSuperImplementationAction.tooltip"));
}
/**
* Creates a new <code>OpenSuperImplementationAction</code>.
* <p>
* Note: This constructor is for internal use only. Clients should not call this constructor.
* </p>
*/
public OpenSuperImplementationAction(JavaEditor editor) {
this(editor.getEditorSite());
fEditor= editor;
}
/* (non-Javadoc)
* Method declared on SelectionDispatchAction.
*/
protected void selectionChanged(ITextSelection selection) {
setEnabled(fEditor != null);
}
private boolean checkEnabled(ITextSelection selection) {
try {
return fEditor != null && SelectionConverter.getElementAtOffset(fEditor) != null;
} catch (JavaModelException e) {
}
return false;
|
8,595 |
Bug 8595 'Open super implementation' should be disabled
|
In the Outline view, there seems to be a new menu item 'Open super implementation', and a corresponding decoration on methods to indicate thet they have a super implementation. The UI already knows if the method has a super implementation, so it should disable the menu item when there is no super implementation to open to. Currently it just does nothing if you select a method with no super implementation. (Tested against 20020125 build)
|
resolved fixed
|
7a45fc9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T12:56:52Z | 2002-01-28T15:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenSuperImplementationAction.java
|
}
/* (non-Javadoc)
* Method declared on SelectionDispatchAction.
*/
protected void selectionChanged(IStructuredSelection selection) {
setEnabled(getMethod(selection) != null);
}
/* (non-Javadoc)
* Method declared on SelectionDispatchAction.
*/
protected void run(ITextSelection selection) {
run(getMethod(selection));
}
/* (non-Javadoc)
* Method declared on SelectionDispatchAction.
*/
protected void run(IStructuredSelection selection) {
run(getMethod(selection));
}
private void run(IMethod method) {
if (method == null)
return;
try {
IType declaringType= method.getDeclaringType();
ICompilationUnit cu= declaringType.getCompilationUnit();
if (cu != null && cu.isWorkingCopy()) {
declaringType= (IType) cu.getOriginal(declaringType);
|
8,595 |
Bug 8595 'Open super implementation' should be disabled
|
In the Outline view, there seems to be a new menu item 'Open super implementation', and a corresponding decoration on methods to indicate thet they have a super implementation. The UI already knows if the method has a super implementation, so it should disable the menu item when there is no super implementation to open to. Currently it just does nothing if you select a method with no super implementation. (Tested against 20020125 build)
|
resolved fixed
|
7a45fc9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T12:56:52Z | 2002-01-28T15:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenSuperImplementationAction.java
|
if (!declaringType.exists()) {
return;
}
}
ITypeHierarchy hierarchy= declaringType.newSupertypeHierarchy(null);
IMethod impl= JavaModelUtil.findMethodImplementationInHierarchy(hierarchy, declaringType, method.getElementName(), method.getParameterTypes(), method.isConstructor());
if (impl == null) {
impl= JavaModelUtil.findMethodDeclarationInHierarchy(hierarchy, declaringType, method.getElementName(), method.getParameterTypes(), method.isConstructor());
}
if (impl != null) {
OpenActionUtil.open(impl);
}
} catch (CoreException e) {
JavaPlugin.log(e);
String message= ActionMessages.getString("OpenSuperImplementationAction.error.message");
ErrorDialog.openError(getShell(), getDialogTitle(), message, e.getStatus());
}
}
private IMethod getMethod(IStructuredSelection selection) {
if (selection.size() != 1)
return null;
Object element= selection.getFirstElement();
return checkMethod(element);
}
private IMethod getMethod(ITextSelection selection) {
return checkMethod(elementAtOffset());
}
|
8,595 |
Bug 8595 'Open super implementation' should be disabled
|
In the Outline view, there seems to be a new menu item 'Open super implementation', and a corresponding decoration on methods to indicate thet they have a super implementation. The UI already knows if the method has a super implementation, so it should disable the menu item when there is no super implementation to open to. Currently it just does nothing if you select a method with no super implementation. (Tested against 20020125 build)
|
resolved fixed
|
7a45fc9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T12:56:52Z | 2002-01-28T15:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenSuperImplementationAction.java
|
private IMethod checkMethod(Object element) {
try {
if (element instanceof IMethod) {
IMethod method= (IMethod) element;
if (method.exists()) {
int flags= method.getFlags();
if (!Flags.isStatic(flags) && !Flags.isPrivate(flags)) {
return method;
}
}
}
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
return null;
}
private Object elementAtOffset() {
try {
return SelectionConverter.getElementAtOffset(fEditor);
} catch(JavaModelException e) {
}
return null;
}
private static String getDialogTitle() {
return ActionMessages.getString("OpenSuperImplementationAction.error.title");
}
}
|
6,459 |
Bug 6459 usability: working set filter dialog avoidance
|
would it be possible to avoid showing the working set dialog on applying a working set? i mean, it could (in the menu) show me a list of set i have. just like search does (which is a very useful feature)
|
resolved fixed
|
2cd22a4
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T13:04:24Z | 2001-11-30T14:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/WorkingSetComparator.java
|
/*
* (c) Copyright IBM Corp. 2000, 2002.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.search;
import java.text.Collator;
import java.util.Comparator;
import org.eclipse.ui.IWorkingSet;
class WorkingSetComparator implements Comparator {
private Collator fCollator= Collator.getInstance();
/*
* @see Comparator#compare(Object, Object)
*/
public int compare(Object o1, Object o2) {
String name1= null;
String name2= null;
if (o1 instanceof IWorkingSet)
name1= ((IWorkingSet)o1).getName();
if (o2 instanceof IWorkingSet)
name2= ((IWorkingSet)o2).getName();
return fCollator.compare(name1, name2);
}
}
|
9,103 |
Bug 9103 Search reports no references to SWT.Help
|
1) Open class SWT 2) Select field Help 3) References>Workspace Nothing found
|
resolved fixed
|
d3ad2a2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T14:09:55Z | 2002-02-05T14:40:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/FindReferencesAction.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.search;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IImportDeclaration;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IPackageDeclaration;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
public class FindReferencesAction extends ElementSearchAction {
public FindReferencesAction() {
this(SearchMessages.getString("Search.FindReferencesAction.label"), new Class[] {IType.class, IMethod.class, IField.class, IPackageDeclaration.class, IImportDeclaration.class, IPackageFragment.class});
setToolTipText(SearchMessages.getString("Search.FindReferencesAction.tooltip"));
}
public FindReferencesAction(String label, Class[] validTypes) {
super(label, validTypes);
setImageDescriptor(JavaPluginImages.DESC_OBJS_SEARCH_REF);
}
protected int getLimitTo() {
return IJavaSearchConstants.REFERENCES;
}
}
|
9,103 |
Bug 9103 Search reports no references to SWT.Help
|
1) Open class SWT 2) Select field Help 3) References>Workspace Nothing found
|
resolved fixed
|
d3ad2a2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T14:09:55Z | 2002-02-05T14:40:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementAction.java
|
/*
* (c) Copyright IBM Corp. 2000, 2002.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.search;
import org.eclipse.core.resources.IMarker;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.search.ui.ISearchResultViewEntry;
import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.SelectionConverter;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
/**
* Abstract class for actions that run on IJavaElement.
*/
public abstract class JavaElementAction extends Action {
|
9,103 |
Bug 9103 Search reports no references to SWT.Help
|
1) Open class SWT 2) Select field Help 3) References>Workspace Nothing found
|
resolved fixed
|
d3ad2a2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T14:09:55Z | 2002-02-05T14:40:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementAction.java
|
protected static final IJavaElement RETURN_WITHOUT_BEEP= JavaCore.create(JavaPlugin.getDefault().getWorkspace().getRoot());
private Class[] fValidTypes;
public JavaElementAction(String label, Class[] validTypes) {
super(label);
fValidTypes= validTypes;
|
9,103 |
Bug 9103 Search reports no references to SWT.Help
|
1) Open class SWT 2) Select field Help 3) References>Workspace Nothing found
|
resolved fixed
|
d3ad2a2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T14:09:55Z | 2002-02-05T14:40:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementAction.java
|
}
public boolean canOperateOn(IStructuredSelection sel) {
boolean hasSelection= !sel.isEmpty();
if (!hasSelection || fValidTypes == null)
return hasSelection;
if (fValidTypes.length == 0)
return false;
IJavaElement element= getJavaElement(sel, true);
if (element != null) {
for (int i= 0; i < fValidTypes.length; i++) {
if (fValidTypes[i].isInstance(element))
return true;
}
}
return false;
}
public void run() {
if (!canOperateOn(getSelection())) {
beep();
return;
}
IJavaElement element= getJavaElement(getSelection(), false);
if (element == null) {
beep();
return;
}
else if (element == RETURN_WITHOUT_BEEP)
return;
|
9,103 |
Bug 9103 Search reports no references to SWT.Help
|
1) Open class SWT 2) Select field Help 3) References>Workspace Nothing found
|
resolved fixed
|
d3ad2a2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T14:09:55Z | 2002-02-05T14:40:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementAction.java
|
run(element);
}
protected abstract void run(IJavaElement element);
private IJavaElement getJavaElement(IJavaElement o, boolean silent) {
if (o == null)
return null;
switch (o.getElementType()) {
case IJavaElement.COMPILATION_UNIT:
return findType((ICompilationUnit)o, silent);
case IJavaElement.CLASS_FILE:
return findType((IClassFile)o);
}
return o;
}
private IJavaElement getJavaElement(IMarker marker, boolean silent) {
return getJavaElement(SearchUtil.getJavaElement(marker), silent);
}
private IJavaElement getJavaElement(Object o, boolean silent) {
if (o instanceof IJavaElement)
return getJavaElement((IJavaElement)o, silent);
else if (o instanceof IMarker)
return getJavaElement((IMarker)o, silent);
else if (o instanceof ISelection)
return getJavaElement((IStructuredSelection)o, silent);
else if (o instanceof ISearchResultViewEntry)
return getJavaElement((ISearchResultViewEntry)o, silent);
return null;
}
private IJavaElement getJavaElement(ISearchResultViewEntry entry, boolean silent) {
if (entry != null)
|
9,103 |
Bug 9103 Search reports no references to SWT.Help
|
1) Open class SWT 2) Select field Help 3) References>Workspace Nothing found
|
resolved fixed
|
d3ad2a2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T14:09:55Z | 2002-02-05T14:40:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementAction.java
|
return getJavaElement(entry.getSelectedMarker(), silent);
return null;
}
protected IJavaElement getJavaElement(IStructuredSelection selection, boolean silent) {
if (selection.size() == 1)
return getJavaElement(selection.getFirstElement(), silent);
return null;
}
public IStructuredSelection getSelection() {
IWorkbenchPage page= JavaPlugin.getActivePage();
if (page != null) {
IWorkbenchPart part= JavaPlugin.getActivePage().getActivePart();
if (part != null) {
try {
return SelectionConverter.getStructuredSelection(part);
} catch (JavaModelException ex) {
return StructuredSelection.EMPTY;
}
}
}
return StructuredSelection.EMPTY;
}
private IJavaElement chooseFromList(IJavaElement[] openChoices) {
int flags= JavaElementLabelProvider.SHOW_DEFAULT | JavaElementLabelProvider.SHOW_QUALIFIED;
ILabelProvider labelProvider= new JavaElementLabelProvider(flags);
ElementListSelectionDialog dialog= new ElementListSelectionDialog(JavaPlugin.getActiveWorkbenchShell(), labelProvider);
dialog.setTitle(SearchMessages.getString("SearchElementSelectionDialog.title"));
dialog.setMessage(SearchMessages.getString("SearchElementSelectionDialog.message"));
dialog.setElements(openChoices);
|
9,103 |
Bug 9103 Search reports no references to SWT.Help
|
1) Open class SWT 2) Select field Help 3) References>Workspace Nothing found
|
resolved fixed
|
d3ad2a2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T14:09:55Z | 2002-02-05T14:40:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementAction.java
|
if (dialog.open() == dialog.OK)
return (IJavaElement)dialog.getFirstResult();
return null;
}
/**
* Answers if a dialog should prompt the user for a unique Java element
*/
protected boolean shouldUserBePrompted() {
return true;
}
protected void beep() {
Shell shell= JavaPlugin.getActiveWorkbenchShell();
if (shell != null && shell.getDisplay() != null)
shell.getDisplay().beep();
}
protected IJavaElement findType(ICompilationUnit cu, boolean silent) {
IType[] types= null;
try {
types= cu.getAllTypes();
} catch (JavaModelException ex) {
ExceptionHandler.log(ex, SearchMessages.getString("JavaElementAction.error.open.message"));
if (silent)
return RETURN_WITHOUT_BEEP;
else
return null;
}
if (types.length == 1 || (silent && types.length > 0))
return types[0];
|
9,103 |
Bug 9103 Search reports no references to SWT.Help
|
1) Open class SWT 2) Select field Help 3) References>Workspace Nothing found
|
resolved fixed
|
d3ad2a2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T14:09:55Z | 2002-02-05T14:40:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementAction.java
|
if (silent)
return RETURN_WITHOUT_BEEP;
if (types.length == 0)
return null;
String title= SearchMessages.getString("JavaElementAction.typeSelectionDialog.title");
String message = SearchMessages.getString("JavaElementAction.typeSelectionDialog.message");
Shell parent= JavaPlugin.getActiveWorkbenchShell();
int flags= (JavaElementLabelProvider.SHOW_DEFAULT);
ElementListSelectionDialog dialog= new ElementListSelectionDialog(parent, new JavaElementLabelProvider(flags));
dialog.setTitle(title);
dialog.setMessage(message);
dialog.setElements(types);
if (dialog.open() == dialog.OK)
return (IType)dialog.getFirstResult();
else
return RETURN_WITHOUT_BEEP;
}
protected IType findType(IClassFile cf) {
IType mainType;
try {
mainType= cf.getType();
} catch (JavaModelException ex) {
ExceptionHandler.log(ex, SearchMessages.getString("JavaElementAction.error.open.message"));
return null;
}
return mainType;
}
}
|
15,503 |
Bug 15503 JavaModelException in log
|
everytime you move a cu this is dumped in .log this JavaElementImageProvider guy should call exists() before he asks for flags !STACK Java Model Exception: Java Model Status [Test.java does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:478) at org.eclipse.jdt.internal.core.Openable.getUnderlyingResource (Openable.java:237) at org.eclipse.jdt.internal.core.CompilationUnit.getCorrespondingResource (CompilationUnit.java:395) at org.eclipse.jdt.internal.core.Openable.openWhenClosed (Openable.java:380) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:505) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:288) at org.eclipse.jdt.internal.core.Member.getFlags(Member.java:140) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getBaseImageDes criptor(JavaElementImageProvider.java:183) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getJavaImageDes criptor(JavaElementImageProvider.java:117) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getImageLabel (JavaElementImageProvider.java:89) at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getImage (JavaUILabelProvider.java:104) at org.eclipse.jface.viewers.DecoratingLabelProvider.getImage (DecoratingLabelProvider.java:67) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.updateItem (ResourceToItemMapper.java:65) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.resourceChanged (ResourceToItemMapper.java:54) at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderCha nged(ProblemTreeViewer.java:103) at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged (ContentViewer.java:70) at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged (ProblemsLabelDecorator.java:270) at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0 (ProblemsLabelDecorator.java:265) at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged (ProblemsLabelDecorator.java:245) at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run (ProblemMarkerManager.java:151) 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:883) at org.eclipse.ui.internal.Workbench.run(Workbench.java:866) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:733) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:16)
|
resolved fixed
|
91890f2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T15:34:47Z | 2002-05-08T09:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
|
15,503 |
Bug 15503 JavaModelException in log
|
everytime you move a cu this is dumped in .log this JavaElementImageProvider guy should call exists() before he asks for flags !STACK Java Model Exception: Java Model Status [Test.java does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:478) at org.eclipse.jdt.internal.core.Openable.getUnderlyingResource (Openable.java:237) at org.eclipse.jdt.internal.core.CompilationUnit.getCorrespondingResource (CompilationUnit.java:395) at org.eclipse.jdt.internal.core.Openable.openWhenClosed (Openable.java:380) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:505) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:288) at org.eclipse.jdt.internal.core.Member.getFlags(Member.java:140) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getBaseImageDes criptor(JavaElementImageProvider.java:183) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getJavaImageDes criptor(JavaElementImageProvider.java:117) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getImageLabel (JavaElementImageProvider.java:89) at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getImage (JavaUILabelProvider.java:104) at org.eclipse.jface.viewers.DecoratingLabelProvider.getImage (DecoratingLabelProvider.java:67) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.updateItem (ResourceToItemMapper.java:65) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.resourceChanged (ResourceToItemMapper.java:54) at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderCha nged(ProblemTreeViewer.java:103) at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged (ContentViewer.java:70) at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged (ProblemsLabelDecorator.java:270) at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0 (ProblemsLabelDecorator.java:265) at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged (ProblemsLabelDecorator.java:245) at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run (ProblemMarkerManager.java:151) 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:883) at org.eclipse.ui.internal.Workbench.run(Workbench.java:866) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:733) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:16)
|
resolved fixed
|
91890f2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T15:34:47Z | 2002-05-08T09:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
*/
package org.eclipse.jdt.internal.ui.viewsupport;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.Assert;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.model.IWorkbenchAdapter;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.ISourceReference;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.JavaElementImageDescriptor;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
/**
* Default strategy of the Java plugin for the construction of Java element icons.
*/
public class JavaElementImageProvider {
|
15,503 |
Bug 15503 JavaModelException in log
|
everytime you move a cu this is dumped in .log this JavaElementImageProvider guy should call exists() before he asks for flags !STACK Java Model Exception: Java Model Status [Test.java does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:478) at org.eclipse.jdt.internal.core.Openable.getUnderlyingResource (Openable.java:237) at org.eclipse.jdt.internal.core.CompilationUnit.getCorrespondingResource (CompilationUnit.java:395) at org.eclipse.jdt.internal.core.Openable.openWhenClosed (Openable.java:380) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:505) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:288) at org.eclipse.jdt.internal.core.Member.getFlags(Member.java:140) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getBaseImageDes criptor(JavaElementImageProvider.java:183) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getJavaImageDes criptor(JavaElementImageProvider.java:117) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getImageLabel (JavaElementImageProvider.java:89) at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getImage (JavaUILabelProvider.java:104) at org.eclipse.jface.viewers.DecoratingLabelProvider.getImage (DecoratingLabelProvider.java:67) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.updateItem (ResourceToItemMapper.java:65) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.resourceChanged (ResourceToItemMapper.java:54) at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderCha nged(ProblemTreeViewer.java:103) at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged (ContentViewer.java:70) at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged (ProblemsLabelDecorator.java:270) at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0 (ProblemsLabelDecorator.java:265) at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged (ProblemsLabelDecorator.java:245) at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run (ProblemMarkerManager.java:151) 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:883) at org.eclipse.ui.internal.Workbench.run(Workbench.java:866) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:733) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:16)
|
resolved fixed
|
91890f2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T15:34:47Z | 2002-05-08T09:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
/**
* Flags for the JavaImageLabelProvider:
* Generate images with overlays.
*/
public final static int OVERLAY_ICONS= 0x1;
/**
* Generate small sized images.
*/
public final static int SMALL_ICONS= 0x2;
/**
* Use the 'light' style for rendering types.
*/
public final static int LIGHT_TYPE_ICONS= 0x4;
private static final Point SMALL_SIZE= new Point(16, 16);
private static final Point BIG_SIZE= new Point(22, 16);
private static ImageDescriptor DESC_OBJ_PROJECT_CLOSED;
private static ImageDescriptor DESC_OBJ_PROJECT;
private static ImageDescriptor DESC_OBJ_FOLDER;
{
ISharedImages images= JavaPlugin.getDefault().getWorkbench().getSharedImages();
DESC_OBJ_PROJECT_CLOSED= images.getImageDescriptor(ISharedImages.IMG_OBJ_PROJECT_CLOSED);
DESC_OBJ_PROJECT= images.getImageDescriptor(ISharedImages.IMG_OBJ_PROJECT);
DESC_OBJ_FOLDER= images.getImageDescriptor(ISharedImages.IMG_OBJ_FOLDER);
}
private ImageDescriptorRegistry fRegistry;
public JavaElementImageProvider() {
|
15,503 |
Bug 15503 JavaModelException in log
|
everytime you move a cu this is dumped in .log this JavaElementImageProvider guy should call exists() before he asks for flags !STACK Java Model Exception: Java Model Status [Test.java does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:478) at org.eclipse.jdt.internal.core.Openable.getUnderlyingResource (Openable.java:237) at org.eclipse.jdt.internal.core.CompilationUnit.getCorrespondingResource (CompilationUnit.java:395) at org.eclipse.jdt.internal.core.Openable.openWhenClosed (Openable.java:380) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:505) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:288) at org.eclipse.jdt.internal.core.Member.getFlags(Member.java:140) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getBaseImageDes criptor(JavaElementImageProvider.java:183) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getJavaImageDes criptor(JavaElementImageProvider.java:117) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getImageLabel (JavaElementImageProvider.java:89) at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getImage (JavaUILabelProvider.java:104) at org.eclipse.jface.viewers.DecoratingLabelProvider.getImage (DecoratingLabelProvider.java:67) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.updateItem (ResourceToItemMapper.java:65) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.resourceChanged (ResourceToItemMapper.java:54) at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderCha nged(ProblemTreeViewer.java:103) at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged (ContentViewer.java:70) at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged (ProblemsLabelDecorator.java:270) at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0 (ProblemsLabelDecorator.java:265) at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged (ProblemsLabelDecorator.java:245) at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run (ProblemMarkerManager.java:151) 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:883) at org.eclipse.ui.internal.Workbench.run(Workbench.java:866) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:733) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:16)
|
resolved fixed
|
91890f2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T15:34:47Z | 2002-05-08T09:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
fRegistry= JavaPlugin.getImageDescriptorRegistry();
}
/**
* Returns the icon for a given element. The icon depends on the element type
* and element properties. If configured, overlay icons are constructed for
* <code>ISourceReference</code>s.
* @param flags Flags as defined by the JavaImageLabelProvider
*/
public Image getImageLabel(Object element, int flags) {
ImageDescriptor descriptor= null;
if (element instanceof IJavaElement) {
descriptor= getJavaImageDescriptor((IJavaElement) element, flags);
} else if (element instanceof IAdaptable) {
descriptor= getWorkbenchImageDescriptor((IAdaptable) element, flags);
}
if (descriptor != null) {
return fRegistry.get(descriptor);
}
return null;
}
private boolean showOverlayIcons(int flags) {
return (flags & OVERLAY_ICONS) != 0;
}
private boolean useSmallSize(int flags) {
return (flags & SMALL_ICONS) != 0;
}
|
15,503 |
Bug 15503 JavaModelException in log
|
everytime you move a cu this is dumped in .log this JavaElementImageProvider guy should call exists() before he asks for flags !STACK Java Model Exception: Java Model Status [Test.java does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:478) at org.eclipse.jdt.internal.core.Openable.getUnderlyingResource (Openable.java:237) at org.eclipse.jdt.internal.core.CompilationUnit.getCorrespondingResource (CompilationUnit.java:395) at org.eclipse.jdt.internal.core.Openable.openWhenClosed (Openable.java:380) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:505) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:288) at org.eclipse.jdt.internal.core.Member.getFlags(Member.java:140) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getBaseImageDes criptor(JavaElementImageProvider.java:183) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getJavaImageDes criptor(JavaElementImageProvider.java:117) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getImageLabel (JavaElementImageProvider.java:89) at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getImage (JavaUILabelProvider.java:104) at org.eclipse.jface.viewers.DecoratingLabelProvider.getImage (DecoratingLabelProvider.java:67) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.updateItem (ResourceToItemMapper.java:65) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.resourceChanged (ResourceToItemMapper.java:54) at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderCha nged(ProblemTreeViewer.java:103) at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged (ContentViewer.java:70) at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged (ProblemsLabelDecorator.java:270) at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0 (ProblemsLabelDecorator.java:265) at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged (ProblemsLabelDecorator.java:245) at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run (ProblemMarkerManager.java:151) 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:883) at org.eclipse.ui.internal.Workbench.run(Workbench.java:866) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:733) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:16)
|
resolved fixed
|
91890f2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T15:34:47Z | 2002-05-08T09:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
private boolean useLightIcons(int flags) {
return (flags & LIGHT_TYPE_ICONS) != 0;
}
/**
* Returns an image descriptor for a java element. The descriptor includes overlays, if specified.
*/
public ImageDescriptor getJavaImageDescriptor(IJavaElement element, int flags) {
int adornmentFlags= computeJavaAdornmentFlags(element, flags);
Point size= useSmallSize(flags) ? SMALL_SIZE : BIG_SIZE;
return new JavaElementImageDescriptor(getBaseImageDescriptor(element, flags), adornmentFlags, size);
}
/**
* Returns an image descriptor for a IAdaptable. The descriptor includes overlays, if specified (only error ticks apply).
* Returns <code>null</code> if no image could be found.
*/
public ImageDescriptor getWorkbenchImageDescriptor(IAdaptable adaptable, int flags) {
IWorkbenchAdapter wbAdapter= (IWorkbenchAdapter) adaptable.getAdapter(IWorkbenchAdapter.class);
if (wbAdapter == null) {
return null;
}
ImageDescriptor descriptor= wbAdapter.getImageDescriptor(adaptable);
if (descriptor == null) {
return null;
}
Point size= useSmallSize(flags) ? SMALL_SIZE : BIG_SIZE;
return new JavaElementImageDescriptor(descriptor, 0, size);
}
|
15,503 |
Bug 15503 JavaModelException in log
|
everytime you move a cu this is dumped in .log this JavaElementImageProvider guy should call exists() before he asks for flags !STACK Java Model Exception: Java Model Status [Test.java does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:478) at org.eclipse.jdt.internal.core.Openable.getUnderlyingResource (Openable.java:237) at org.eclipse.jdt.internal.core.CompilationUnit.getCorrespondingResource (CompilationUnit.java:395) at org.eclipse.jdt.internal.core.Openable.openWhenClosed (Openable.java:380) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:505) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:288) at org.eclipse.jdt.internal.core.Member.getFlags(Member.java:140) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getBaseImageDes criptor(JavaElementImageProvider.java:183) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getJavaImageDes criptor(JavaElementImageProvider.java:117) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getImageLabel (JavaElementImageProvider.java:89) at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getImage (JavaUILabelProvider.java:104) at org.eclipse.jface.viewers.DecoratingLabelProvider.getImage (DecoratingLabelProvider.java:67) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.updateItem (ResourceToItemMapper.java:65) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.resourceChanged (ResourceToItemMapper.java:54) at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderCha nged(ProblemTreeViewer.java:103) at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged (ContentViewer.java:70) at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged (ProblemsLabelDecorator.java:270) at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0 (ProblemsLabelDecorator.java:265) at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged (ProblemsLabelDecorator.java:245) at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run (ProblemMarkerManager.java:151) 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:883) at org.eclipse.ui.internal.Workbench.run(Workbench.java:866) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:733) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:16)
|
resolved fixed
|
91890f2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T15:34:47Z | 2002-05-08T09:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
/**
* Returns an image descriptor for a java element. This is the base image, no overlays.
*/
public ImageDescriptor getBaseImageDescriptor(IJavaElement element, int renderFlags) {
try {
switch (element.getElementType()) {
case IJavaElement.INITIALIZER:
case IJavaElement.METHOD:
case IJavaElement.FIELD: {
IMember member= (IMember) element;
if (member.getDeclaringType().isInterface())
return JavaPluginImages.DESC_MISC_PUBLIC;
int flags= member.getFlags();
if (Flags.isPublic(flags))
return JavaPluginImages.DESC_MISC_PUBLIC;
if (Flags.isProtected(flags))
return JavaPluginImages.DESC_MISC_PROTECTED;
if (Flags.isPrivate(flags))
return JavaPluginImages.DESC_MISC_PRIVATE;
return JavaPluginImages.DESC_MISC_DEFAULT;
}
case IJavaElement.PACKAGE_DECLARATION:
return JavaPluginImages.DESC_OBJS_PACKDECL;
case IJavaElement.IMPORT_DECLARATION:
return JavaPluginImages.DESC_OBJS_IMPDECL;
|
15,503 |
Bug 15503 JavaModelException in log
|
everytime you move a cu this is dumped in .log this JavaElementImageProvider guy should call exists() before he asks for flags !STACK Java Model Exception: Java Model Status [Test.java does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:478) at org.eclipse.jdt.internal.core.Openable.getUnderlyingResource (Openable.java:237) at org.eclipse.jdt.internal.core.CompilationUnit.getCorrespondingResource (CompilationUnit.java:395) at org.eclipse.jdt.internal.core.Openable.openWhenClosed (Openable.java:380) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:505) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:288) at org.eclipse.jdt.internal.core.Member.getFlags(Member.java:140) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getBaseImageDes criptor(JavaElementImageProvider.java:183) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getJavaImageDes criptor(JavaElementImageProvider.java:117) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getImageLabel (JavaElementImageProvider.java:89) at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getImage (JavaUILabelProvider.java:104) at org.eclipse.jface.viewers.DecoratingLabelProvider.getImage (DecoratingLabelProvider.java:67) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.updateItem (ResourceToItemMapper.java:65) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.resourceChanged (ResourceToItemMapper.java:54) at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderCha nged(ProblemTreeViewer.java:103) at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged (ContentViewer.java:70) at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged (ProblemsLabelDecorator.java:270) at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0 (ProblemsLabelDecorator.java:265) at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged (ProblemsLabelDecorator.java:245) at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run (ProblemMarkerManager.java:151) 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:883) at org.eclipse.ui.internal.Workbench.run(Workbench.java:866) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:733) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:16)
|
resolved fixed
|
91890f2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T15:34:47Z | 2002-05-08T09:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
case IJavaElement.IMPORT_CONTAINER:
return JavaPluginImages.DESC_OBJS_IMPCONT;
case IJavaElement.TYPE: {
IType type= (IType) element;
if (useLightIcons(renderFlags)) {
if (type.isClass())
return JavaPluginImages.DESC_OBJS_CLASSALT;
else
return JavaPluginImages.DESC_OBJS_INTERFACEALT;
}
int flags= type.getFlags();
boolean hasVisibility= Flags.isPublic(flags) || Flags.isPrivate(flags) || Flags.isProtected(flags);
if (type.isClass())
return hasVisibility ? JavaPluginImages.DESC_OBJS_CLASS : JavaPluginImages.DESC_OBJS_PCLASS;
return hasVisibility ? JavaPluginImages.DESC_OBJS_INTERFACE : JavaPluginImages.DESC_OBJS_PINTERFACE;
}
case IJavaElement.PACKAGE_FRAGMENT_ROOT: {
IPackageFragmentRoot root= (IPackageFragmentRoot) element;
if (root.isArchive()) {
IPath attach= root.getSourceAttachmentPath();
if (root.isExternal()) {
if (attach == null) {
return JavaPluginImages.DESC_OBJS_EXTJAR;
} else {
return JavaPluginImages.DESC_OBJS_EXTJAR_WSRC;
|
15,503 |
Bug 15503 JavaModelException in log
|
everytime you move a cu this is dumped in .log this JavaElementImageProvider guy should call exists() before he asks for flags !STACK Java Model Exception: Java Model Status [Test.java does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:478) at org.eclipse.jdt.internal.core.Openable.getUnderlyingResource (Openable.java:237) at org.eclipse.jdt.internal.core.CompilationUnit.getCorrespondingResource (CompilationUnit.java:395) at org.eclipse.jdt.internal.core.Openable.openWhenClosed (Openable.java:380) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:505) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:288) at org.eclipse.jdt.internal.core.Member.getFlags(Member.java:140) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getBaseImageDes criptor(JavaElementImageProvider.java:183) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getJavaImageDes criptor(JavaElementImageProvider.java:117) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getImageLabel (JavaElementImageProvider.java:89) at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getImage (JavaUILabelProvider.java:104) at org.eclipse.jface.viewers.DecoratingLabelProvider.getImage (DecoratingLabelProvider.java:67) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.updateItem (ResourceToItemMapper.java:65) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.resourceChanged (ResourceToItemMapper.java:54) at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderCha nged(ProblemTreeViewer.java:103) at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged (ContentViewer.java:70) at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged (ProblemsLabelDecorator.java:270) at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0 (ProblemsLabelDecorator.java:265) at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged (ProblemsLabelDecorator.java:245) at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run (ProblemMarkerManager.java:151) 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:883) at org.eclipse.ui.internal.Workbench.run(Workbench.java:866) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:733) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:16)
|
resolved fixed
|
91890f2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T15:34:47Z | 2002-05-08T09:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
}
} else {
if (attach == null) {
return JavaPluginImages.DESC_OBJS_JAR;
} else {
return JavaPluginImages.DESC_OBJS_JAR_WSRC;
}
}
} else {
return JavaPluginImages.DESC_OBJS_PACKFRAG_ROOT;
}
}
case IJavaElement.PACKAGE_FRAGMENT:
IPackageFragment fragment= (IPackageFragment)element;
try {
if (!fragment.hasChildren() && (fragment.getNonJavaResources().length >0))
return DESC_OBJ_FOLDER;
} catch(JavaModelException e) {
return DESC_OBJ_FOLDER;
}
return JavaPluginImages.DESC_OBJS_PACKAGE;
case IJavaElement.COMPILATION_UNIT:
return JavaPluginImages.DESC_OBJS_CUNIT;
case IJavaElement.CLASS_FILE:
/* this is too expensive for large packages
try {
|
15,503 |
Bug 15503 JavaModelException in log
|
everytime you move a cu this is dumped in .log this JavaElementImageProvider guy should call exists() before he asks for flags !STACK Java Model Exception: Java Model Status [Test.java does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:478) at org.eclipse.jdt.internal.core.Openable.getUnderlyingResource (Openable.java:237) at org.eclipse.jdt.internal.core.CompilationUnit.getCorrespondingResource (CompilationUnit.java:395) at org.eclipse.jdt.internal.core.Openable.openWhenClosed (Openable.java:380) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:505) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:288) at org.eclipse.jdt.internal.core.Member.getFlags(Member.java:140) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getBaseImageDes criptor(JavaElementImageProvider.java:183) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getJavaImageDes criptor(JavaElementImageProvider.java:117) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getImageLabel (JavaElementImageProvider.java:89) at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getImage (JavaUILabelProvider.java:104) at org.eclipse.jface.viewers.DecoratingLabelProvider.getImage (DecoratingLabelProvider.java:67) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.updateItem (ResourceToItemMapper.java:65) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.resourceChanged (ResourceToItemMapper.java:54) at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderCha nged(ProblemTreeViewer.java:103) at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged (ContentViewer.java:70) at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged (ProblemsLabelDecorator.java:270) at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0 (ProblemsLabelDecorator.java:265) at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged (ProblemsLabelDecorator.java:245) at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run (ProblemMarkerManager.java:151) 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:883) at org.eclipse.ui.internal.Workbench.run(Workbench.java:866) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:733) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:16)
|
resolved fixed
|
91890f2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T15:34:47Z | 2002-05-08T09:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
IClassFile cfile= (IClassFile)element;
if (cfile.isClass())
return JavaPluginImages.IMG_OBJS_CFILECLASS;
return JavaPluginImages.IMG_OBJS_CFILEINT;
} catch(JavaModelException e) {
// fall through;
}*/
return JavaPluginImages.DESC_OBJS_CFILE;
case IJavaElement.JAVA_PROJECT:
IJavaProject jp= (IJavaProject)element;
if (jp.getProject().isOpen()) {
IProject project= jp.getProject();
IWorkbenchAdapter adapter= (IWorkbenchAdapter)project.getAdapter(IWorkbenchAdapter.class);
if (adapter != null) {
ImageDescriptor result= adapter.getImageDescriptor(project);
if (result != null)
return result;
}
return DESC_OBJ_PROJECT;
}
return DESC_OBJ_PROJECT_CLOSED;
case IJavaElement.JAVA_MODEL:
return JavaPluginImages.DESC_OBJS_JAVA_MODEL;
}
Assert.isTrue(false, JavaUIMessages.getString("JavaImageLabelprovider.assert.wrongImage"));
return null;
|
15,503 |
Bug 15503 JavaModelException in log
|
everytime you move a cu this is dumped in .log this JavaElementImageProvider guy should call exists() before he asks for flags !STACK Java Model Exception: Java Model Status [Test.java does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:478) at org.eclipse.jdt.internal.core.Openable.getUnderlyingResource (Openable.java:237) at org.eclipse.jdt.internal.core.CompilationUnit.getCorrespondingResource (CompilationUnit.java:395) at org.eclipse.jdt.internal.core.Openable.openWhenClosed (Openable.java:380) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:505) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:288) at org.eclipse.jdt.internal.core.Member.getFlags(Member.java:140) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getBaseImageDes criptor(JavaElementImageProvider.java:183) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getJavaImageDes criptor(JavaElementImageProvider.java:117) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getImageLabel (JavaElementImageProvider.java:89) at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getImage (JavaUILabelProvider.java:104) at org.eclipse.jface.viewers.DecoratingLabelProvider.getImage (DecoratingLabelProvider.java:67) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.updateItem (ResourceToItemMapper.java:65) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.resourceChanged (ResourceToItemMapper.java:54) at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderCha nged(ProblemTreeViewer.java:103) at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged (ContentViewer.java:70) at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged (ProblemsLabelDecorator.java:270) at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0 (ProblemsLabelDecorator.java:265) at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged (ProblemsLabelDecorator.java:245) at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run (ProblemMarkerManager.java:151) 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:883) at org.eclipse.ui.internal.Workbench.run(Workbench.java:866) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:733) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:16)
|
resolved fixed
|
91890f2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T15:34:47Z | 2002-05-08T09:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
} catch (CoreException e) {
JavaPlugin.log(e);
return JavaPluginImages.DESC_OBJS_GHOST;
}
}
private int computeJavaAdornmentFlags(IJavaElement element, int renderFlags) {
int flags= 0;
if (showOverlayIcons(renderFlags) && element instanceof IMember) {
try {
IMember member= (IMember) element;
int modifiers= member.getFlags();
if (Flags.isAbstract(modifiers) && confirmAbstract(member))
flags |= JavaElementImageDescriptor.ABSTRACT;
if (Flags.isFinal(modifiers) || isInterfaceField(member))
flags |= JavaElementImageDescriptor.FINAL;
if (Flags.isSynchronized(modifiers) && confirmSynchronized(member))
flags |= JavaElementImageDescriptor.SYNCHRONIZED;
if (Flags.isStatic(modifiers) || isInterfaceField(member))
flags |= JavaElementImageDescriptor.STATIC;
if (member.getElementType() == IJavaElement.TYPE) {
if (JavaModelUtil.hasMainMethod((IType) member)) {
flags |= JavaElementImageDescriptor.RUNNABLE;
}
}
} catch (JavaModelException e) {
|
15,503 |
Bug 15503 JavaModelException in log
|
everytime you move a cu this is dumped in .log this JavaElementImageProvider guy should call exists() before he asks for flags !STACK Java Model Exception: Java Model Status [Test.java does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:478) at org.eclipse.jdt.internal.core.Openable.getUnderlyingResource (Openable.java:237) at org.eclipse.jdt.internal.core.CompilationUnit.getCorrespondingResource (CompilationUnit.java:395) at org.eclipse.jdt.internal.core.Openable.openWhenClosed (Openable.java:380) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:505) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:288) at org.eclipse.jdt.internal.core.Member.getFlags(Member.java:140) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getBaseImageDes criptor(JavaElementImageProvider.java:183) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getJavaImageDes criptor(JavaElementImageProvider.java:117) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getImageLabel (JavaElementImageProvider.java:89) at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getImage (JavaUILabelProvider.java:104) at org.eclipse.jface.viewers.DecoratingLabelProvider.getImage (DecoratingLabelProvider.java:67) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.updateItem (ResourceToItemMapper.java:65) at org.eclipse.jdt.internal.ui.viewsupport.ResourceToItemMapper.resourceChanged (ResourceToItemMapper.java:54) at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.handleLabelProviderCha nged(ProblemTreeViewer.java:103) at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged (ContentViewer.java:70) at org.eclipse.jdt.ui.ProblemsLabelDecorator.fireProblemsChanged (ProblemsLabelDecorator.java:270) at org.eclipse.jdt.ui.ProblemsLabelDecorator.access$0 (ProblemsLabelDecorator.java:265) at org.eclipse.jdt.ui.ProblemsLabelDecorator$1.problemsChanged (ProblemsLabelDecorator.java:245) at org.eclipse.jdt.internal.ui.viewsupport.ProblemMarkerManager$1.run (ProblemMarkerManager.java:151) 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:883) at org.eclipse.ui.internal.Workbench.run(Workbench.java:866) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:733) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:16)
|
resolved fixed
|
91890f2
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T15:34:47Z | 2002-05-08T09:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementImageProvider.java
|
}
}
return flags;
}
private boolean confirmAbstract(IMember element) throws JavaModelException {
if (element.getElementType() == IJavaElement.TYPE) {
return ((IType) element).isClass();
}
return element.getDeclaringType().isClass();
}
private boolean isInterfaceField(IMember element) throws JavaModelException {
if (element.getElementType() == IJavaElement.FIELD) {
return element.getDeclaringType().isInterface();
}
return false;
}
private boolean confirmSynchronized(IJavaElement member) {
return member.getElementType() != IJavaElement.TYPE;
}
public void dispose() {
}
}
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/JavaCorrectionProcessor.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.text.Collator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/JavaCorrectionProcessor.java
|
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
import org.eclipse.jface.text.source.Annotation;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.compiler.IProblem;
import org.eclipse.jdt.ui.IWorkingCopyManager;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.javaeditor.IProblemAnnotation;
import org.eclipse.jdt.internal.ui.javaeditor.ProblemAnnotationIterator;
public class JavaCorrectionProcessor implements IContentAssistProcessor {
public static boolean hasCorrections(int problemId) {
switch (problemId) {
case IProblem.UnterminatedString:
case IProblem.UnterminatedComment:
case IProblem.UndefinedMethod:
case IProblem.ParameterMismatch:
case IProblem.MethodButWithConstructorName:
case IProblem.UndefinedField:
case IProblem.UndefinedName:
case IProblem.PublicClassMustMatchFileName:
case IProblem.PackageIsNotExpectedPackage:
case IProblem.UndefinedType:
case IProblem.FieldTypeNotFound:
case IProblem.ArgumentTypeNotFound:
case IProblem.ReturnTypeNotFound:
case IProblem.SuperclassNotFound:
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/JavaCorrectionProcessor.java
|
case IProblem.ExceptionTypeNotFound:
case IProblem.InterfaceNotFound:
case IProblem.TypeMismatch:
case IProblem.UnhandledException:
case IProblem.LocalVariableIsNeverUsed:
case IProblem.VoidMethodReturnsValue:
case IProblem.MissingReturnType:
case IProblem.NonExternalizedStringLiteral:
return true;
default:
return false;
}
}
private static class CorrectionsComparator implements Comparator {
private static Collator fgCollator= Collator.getInstance();
public int compare(Object o1, Object o2) {
ChangeCorrectionProposal e1= (ChangeCorrectionProposal) o1;
ChangeCorrectionProposal e2= (ChangeCorrectionProposal) o2;
int del= e2.getRelevance() - e1.getRelevance();
if (del != 0) {
return del;
}
return fgCollator.compare(e1.getDisplayString(), e2.getDisplayString());
}
}
private IEditorPart fEditor;
/**
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/JavaCorrectionProcessor.java
|
* Constructor for JavaCorrectionProcessor.
*/
public JavaCorrectionProcessor(IEditorPart editor) {
fEditor= editor;
}
/*
* @see IContentAssistProcessor#computeCompletionProposals(ITextViewer, int)
*/
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();
ICompilationUnit cu= manager.getWorkingCopy(fEditor.getEditorInput());
IDocumentProvider provider= JavaPlugin.getDefault().getCompilationUnitDocumentProvider();
IAnnotationModel model= provider.getAnnotationModel(fEditor.getEditorInput());
ArrayList proposals= new ArrayList();
HashSet idsProcessed= new HashSet();
if (model != null) {
for (Iterator iter= new ProblemAnnotationIterator(model); iter.hasNext();) {
IProblemAnnotation annot= (IProblemAnnotation) iter.next();
Position pos= model.getPosition((Annotation) annot);
if (pos != null) {
int start= pos.getOffset();
if (documentOffset >= start && documentOffset <= (start + pos.getLength())) {
Integer probId= new Integer(annot.getId());
if (!idsProcessed.contains(probId)) {
ProblemPosition pp = new ProblemPosition(pos, annot, cu);
idsProcessed.add(probId);
collectCorrections(pp, proposals);
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/JavaCorrectionProcessor.java
|
}
}
}
}
}
if (proposals.isEmpty()) {
proposals.add(new NoCorrectionProposal(null));
}
ICompletionProposal[] res= (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
Arrays.sort(res, new CorrectionsComparator());
return res;
}
private void collectCorrections(ProblemPosition problemPos, ArrayList proposals) {
try {
int id= problemPos.getId();
switch (id) {
case IProblem.UnterminatedString:
String quoteLabel= CorrectionMessages.getString("JavaCorrectionProcessor.addquote.description");
int pos= InsertCorrectionProposal.moveBack(problemPos.getOffset() + problemPos.getLength(), problemPos.getOffset(), "\n\r", problemPos.getCompilationUnit());
proposals.add(new InsertCorrectionProposal(quoteLabel, problemPos.getCompilationUnit(), pos, "\"", 0));
break;
case IProblem.UnterminatedComment:
String commentLabel= CorrectionMessages.getString("JavaCorrectionProcessor.addcomment.description");
proposals.add(new InsertCorrectionProposal(commentLabel, problemPos.getCompilationUnit(), problemPos.getOffset() + problemPos.getLength(), "*/", 0));
break;
case IProblem.UndefinedMethod:
UnresolvedElementsSubProcessor.getMethodProposals(problemPos, false, proposals);
break;
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/JavaCorrectionProcessor.java
|
case IProblem.ParameterMismatch:
UnresolvedElementsSubProcessor.getMethodProposals(problemPos, true, proposals);
break;
case IProblem.MethodButWithConstructorName:
LocalCorrectionsSubProcessor.addMethodWithConstrNameProposals(problemPos, proposals);
break;
case IProblem.UndefinedField:
case IProblem.UndefinedName:
UnresolvedElementsSubProcessor.getVariableProposals(problemPos, proposals);
break;
case IProblem.PublicClassMustMatchFileName:
ReorgCorrectionsSubProcessor.getWrongTypeNameProposals(problemPos, proposals);
break;
case IProblem.PackageIsNotExpectedPackage:
ReorgCorrectionsSubProcessor.getWrongPackageDeclNameProposals(problemPos, proposals);
break;
case IProblem.UndefinedType:
case IProblem.FieldTypeNotFound:
case IProblem.ArgumentTypeNotFound:
UnresolvedElementsSubProcessor.getTypeProposals(problemPos, SimilarElementsRequestor.ALL_TYPES, proposals);
break;
case IProblem.ReturnTypeNotFound:
UnresolvedElementsSubProcessor.getTypeProposals(problemPos, SimilarElementsRequestor.ALL_TYPES | SimilarElementsRequestor.VOIDTYPE, proposals);
break;
case IProblem.SuperclassNotFound:
case IProblem.ExceptionTypeNotFound:
UnresolvedElementsSubProcessor.getTypeProposals(problemPos, SimilarElementsRequestor.CLASSES, proposals);
break;
case IProblem.InterfaceNotFound:
UnresolvedElementsSubProcessor.getTypeProposals(problemPos, SimilarElementsRequestor.INTERFACES, proposals);
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/JavaCorrectionProcessor.java
|
break;
case IProblem.TypeMismatch:
LocalCorrectionsSubProcessor.addCastProposals(problemPos, proposals);
break;
case IProblem.UnhandledException:
LocalCorrectionsSubProcessor.addUncaughtExceptionProposals(problemPos, proposals);
break;
case IProblem.LocalVariableIsNeverUsed:
LocalCorrectionsSubProcessor.addUnusedVariableProposals(problemPos, proposals);
break;
case IProblem.VoidMethodReturnsValue:
LocalCorrectionsSubProcessor.addVoidMethodReturnsProposals(problemPos, proposals);
break;
case IProblem.MissingReturnType:
LocalCorrectionsSubProcessor.addMissingReturnTypeProposals(problemPos, proposals);
break;
case IProblem.NonExternalizedStringLiteral:
LocalCorrectionsSubProcessor.addNLSProposals(problemPos, proposals);
break;
default:
}
} catch (CoreException e) {
JavaPlugin.log(e);
}
}
/*
* @see IContentAssistProcessor#computeContextInformation(ITextViewer, int)
*/
public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/JavaCorrectionProcessor.java
|
return null;
}
/*
* @see IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
*/
public char[] getCompletionProposalAutoActivationCharacters() {
return null;
}
/*
* @see IContentAssistProcessor#getContextInformationAutoActivationCharacters()
*/
public char[] getContextInformationAutoActivationCharacters() {
return null;
}
/*
* @see IContentAssistProcessor#getContextInformationValidator()
*/
public IContextInformationValidator getContextInformationValidator() {
return null;
}
/*
* @see IContentAssistProcessor#getErrorMessage()
*/
public String getErrorMessage() {
return null;
}
}
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
|
package org.eclipse.jdt.internal.ui.text.correction;
import java.util.ArrayList;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jdt.core.IBuffer;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.core.dom.Assignment;
import org.eclipse.jdt.core.dom.BodyDeclaration;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.Expression;
import org.eclipse.jdt.core.dom.ITypeBinding;
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
|
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.ReturnStatement;
import org.eclipse.jdt.core.dom.SimpleName;
import org.eclipse.jdt.core.dom.Statement;
import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
import org.eclipse.jdt.internal.corext.codemanipulation.ImportEdit;
import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
import org.eclipse.jdt.internal.corext.dom.GenericVisitor;
import org.eclipse.jdt.internal.corext.refactoring.changes.CompilationUnitChange;
import org.eclipse.jdt.internal.corext.refactoring.nls.NLSRefactoring;
import org.eclipse.jdt.internal.corext.refactoring.surround.SurroundWithTryCatchRefactoring;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
import org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter;
import org.eclipse.jdt.internal.ui.refactoring.nls.ExternalizeWizard;
/**
*/
public class LocalCorrectionsSubProcessor {
public static void addCastProposals(ProblemPosition problemPos, ArrayList proposals) throws CoreException {
String[] args= problemPos.getArguments();
if (args.length == 2) {
ICompilationUnit cu= problemPos.getCompilationUnit();
String castDestType= args[1];
CompilationUnit astRoot= AST.parseCompilationUnit(cu, false);
ASTNode selectedNode= ASTResolving.findSelectedNode(astRoot, problemPos.getOffset(), problemPos.getLength());
int pos= problemPos.getOffset();
if (selectedNode != null) {
int parentNodeType= selectedNode.getParent().getNodeType();
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
|
if (parentNodeType == ASTNode.ASSIGNMENT) {
Assignment assign= (Assignment) selectedNode.getParent();
if (selectedNode.equals(assign.getLeftHandSide())) {
pos= assign.getRightHandSide().getStartPosition();
}
} else if (parentNodeType == ASTNode.VARIABLE_DECLARATION_FRAGMENT) {
VariableDeclarationFragment frag= (VariableDeclarationFragment) selectedNode.getParent();
if (selectedNode.equals(frag.getName())) {
pos= frag.getInitializer().getStartPosition();
}
}
}
String cast= '(' + Signature.getSimpleName(castDestType) + ')';
String formatted= StubUtility.codeFormat(cast + 'x', 0, "");
if (formatted.charAt(formatted.length() - 1) == 'x') {
cast= formatted.substring(0, formatted.length() - 1);
}
String label= CorrectionMessages.getFormattedString("LocalCorrectionsSubProcessor.addcast.description", args[1]);
InsertCorrectionProposal proposal= new InsertCorrectionProposal(label, cu, pos, cast, 1);
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
ImportEdit edit= new ImportEdit(problemPos.getCompilationUnit(), settings);
edit.addImport(castDestType);
proposal.getCompilationUnitChange().addTextEdit("import", edit);
proposals.add(proposal);
}
}
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
|
public static void addUncaughtExceptionProposals(ProblemPosition problemPos, ArrayList proposals) throws CoreException {
ICompilationUnit cu= problemPos.getCompilationUnit();
CompilationUnit astRoot= AST.parseCompilationUnit(cu, true);
ASTNode selectedNode= ASTResolving.findSelectedNode(astRoot, problemPos.getOffset(), problemPos.getLength());
if (selectedNode == null) {
return;
}
while (selectedNode != null && !(selectedNode instanceof Statement)) {
selectedNode= selectedNode.getParent();
}
if (selectedNode != null) {
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
SurroundWithTryCatchRefactoring refactoring= new SurroundWithTryCatchRefactoring(cu, selectedNode.getStartPosition(), selectedNode.getLength(), settings, null);
refactoring.setSaveChanges(false);
if (refactoring.checkActivationBasics(astRoot, null).isOK()) {
String label= CorrectionMessages.getString("LocalCorrectionsSubProcessor.surroundwith.description");
CUCorrectionProposal proposal= new CUCorrectionProposal(label, (CompilationUnitChange) refactoring.createChange(null), 0);
proposals.add(proposal);
}
}
BodyDeclaration decl= ASTResolving.findParentBodyDeclaration(selectedNode);
if (decl instanceof MethodDeclaration) {
String uncaughtName= problemPos.getArguments()[0];
MethodDeclaration methodDecl= (MethodDeclaration) decl;
SimpleName name= methodDecl.getName();
int pos= name.getStartPosition() + name.getLength();
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
|
StringBuffer insertString= new StringBuffer();
if (methodDecl.thrownExceptions().isEmpty()) {
insertString.append(" throws ");
} else {
insertString.append(", ");
}
insertString.append(Signature.getSimpleName(uncaughtName));
String label= CorrectionMessages.getString("LocalCorrectionsSubProcessor.addthrows.description");
InsertCorrectionProposal proposal= new InsertCorrectionProposal(label, cu, pos, insertString.toString(), 0);
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
ImportEdit edit= new ImportEdit(cu, settings);
edit.addImport(uncaughtName);
proposal.getCompilationUnitChange().addTextEdit("import", edit);
proposals.add(proposal);
}
}
public static void addMethodWithConstrNameProposals(ProblemPosition problemPos, ArrayList proposals) throws CoreException {
ICompilationUnit cu= problemPos.getCompilationUnit();
CompilationUnit astRoot= AST.parseCompilationUnit(cu, false);
ASTNode selectedNode= ASTResolving.findSelectedNode(astRoot, problemPos.getOffset(), problemPos.getLength());
if (selectedNode instanceof SimpleName && selectedNode.getParent() instanceof MethodDeclaration) {
MethodDeclaration declaration= (MethodDeclaration) selectedNode.getParent();
int start= declaration.getReturnType().getStartPosition();
int end= declaration.getName().getStartPosition();
String label= CorrectionMessages.getString("LocalCorrectionsSubProcessor.constrnamemethod.description");
ReplaceCorrectionProposal proposal= new ReplaceCorrectionProposal(label, cu, start, end - start, "", 0);
proposals.add(proposal);
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
|
}
}
public static void addUnusedVariableProposals(ProblemPosition problemPos, ArrayList proposals) throws CoreException {
ICompilationUnit cu= problemPos.getCompilationUnit();
CompilationUnit astRoot= AST.parseCompilationUnit(cu, false);
ASTNode selectedNode= ASTResolving.findSelectedNode(astRoot, problemPos.getOffset(), problemPos.getLength());
if (selectedNode instanceof SimpleName) {
selectedNode= selectedNode.getParent();
}
if (selectedNode instanceof VariableDeclarationFragment) {
ASTNode parent= selectedNode.getParent();
int start= parent.getStartPosition();
int end= start + parent.getLength();
IBuffer buf= cu.getBuffer();
while (end < buf.getLength() && Character.isWhitespace(buf.getChar(end))) {
end++;
}
String label= CorrectionMessages.getString("LocalCorrectionsSubProcessor.removelocalvar.description");
ReplaceCorrectionProposal proposal= new ReplaceCorrectionProposal(label, cu, start, end - start, "", 0);
proposals.add(proposal);
}
}
public static void addVoidMethodReturnsProposals(ProblemPosition problemPos, ArrayList proposals) throws CoreException {
ICompilationUnit cu= problemPos.getCompilationUnit();
CompilationUnit astRoot= AST.parseCompilationUnit(cu, true);
ASTNode selectedNode= ASTResolving.findSelectedNode(astRoot, problemPos.getOffset(), problemPos.getLength());
if (selectedNode != null) {
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
|
if (selectedNode.getParent() instanceof ReturnStatement) {
ReturnStatement returnStatement= (ReturnStatement) selectedNode.getParent();
Expression expr= returnStatement.getExpression();
if (expr != null) {
ITypeBinding binding= expr.resolveTypeBinding();
if (binding != null) {
if ("null".equals(binding.getName())) {
binding= selectedNode.getAST().resolveWellKnownType("java.lang.Object");
}
BodyDeclaration decl= ASTResolving.findParentBodyDeclaration(returnStatement);
if (decl instanceof MethodDeclaration) {
ASTNode returnType= ((MethodDeclaration) decl).getReturnType();
String label= CorrectionMessages.getString("LocalCorrectionsSubProcessor.voidmethodreturns.description") + binding.getName();
ReplaceCorrectionProposal proposal= new ReplaceCorrectionProposal(label, cu, returnType.getStartPosition(), returnType.getLength(), binding.getName(), 0);
proposals.add(proposal);
}
}
}
}
}
}
public static void addMissingReturnTypeProposals(ProblemPosition problemPos, ArrayList proposals) throws CoreException {
ICompilationUnit cu= problemPos.getCompilationUnit();
CompilationUnit astRoot= AST.parseCompilationUnit(cu, true);
ASTNode selectedNode= ASTResolving.findSelectedNode(astRoot, problemPos.getOffset(), problemPos.getLength());
if (selectedNode != null) {
BodyDeclaration decl= ASTResolving.findParentBodyDeclaration(selectedNode);
if (decl instanceof MethodDeclaration) {
final ITypeBinding[] res= new ITypeBinding[1];
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
|
res[0]= null;
decl.accept(new GenericVisitor() {
public boolean visit(ReturnStatement node) {
if (res[0] == null) {
Expression expr= node.getExpression();
if (expr != null) {
ITypeBinding binding= expr.resolveTypeBinding();
if (binding != null) {
res[0]= binding;
} else {
res[0]= node.getAST().resolveWellKnownType("java.lang.Object");
}
} else {
res[0]= node.getAST().resolveWellKnownType("void");
}
}
return false;
}
});
ITypeBinding type= res[0];
if (type == null) {
type= decl.getAST().resolveWellKnownType("void");
}
String str= type.getName() + " ";
int pos= ((MethodDeclaration) decl).getName().getStartPosition();
String label= CorrectionMessages.getFormattedString("LocalCorrectionsSubProcessor.missingreturntype.description", type.getName());
InsertCorrectionProposal proposal= new InsertCorrectionProposal(label, cu, pos, str, 1);
|
15,407 |
Bug 15407 quick fix: removes too many temps (multi declaration case)
|
20020502+ package p; class Test{ int i(){ int i= 0, jjj= 1; return i; } } jjj is not used to qf offers to remove it. i say 'fine' but it leaves me in a state with compiler errors: class Test{ int i(){ return i; } }
|
resolved fixed
|
7a71f43
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:17:07Z | 2002-05-07T14:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
|
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
ImportEdit edit= new ImportEdit(problemPos.getCompilationUnit(), settings);
edit.addImport(type.getName());
proposal.getCompilationUnitChange().addTextEdit("import", edit);
proposals.add(proposal);
}
}
}
public static void addNLSProposals(ProblemPosition problemPos, ArrayList proposals) throws CoreException {
final ICompilationUnit cu= problemPos.getCompilationUnit();
String name= CorrectionMessages.getString("LocalCorrectionsSubProcessor.externalizestrings.description");
ChangeCorrectionProposal proposal= new ChangeCorrectionProposal(name, null, 0) {
public void apply(IDocument document) {
try {
NLSRefactoring refactoring= new NLSRefactoring(cu);
ExternalizeWizard wizard= new ExternalizeWizard(refactoring);
String dialogTitle= CorrectionMessages.getString("LocalCorrectionsSubProcessor.externalizestrings.dialog.title");
new RefactoringStarter().activate(refactoring, wizard, dialogTitle, true);
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
}
};
proposals.add(proposal);
}
}
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.preferences;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Hashtable;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.help.WorkbenchHelp;
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.JavaPluginImages;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
import org.eclipse.jdt.internal.ui.util.TabFolderLayout;
/*
* The page for setting the compiler options.
*/
public class CompilerPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
private static final String PREF_LOCAL_VARIABLE_ATTR= JavaCore.COMPILER_LOCAL_VARIABLE_ATTR;
private static final String PREF_LINE_NUMBER_ATTR= JavaCore.COMPILER_LINE_NUMBER_ATTR;
private static final String PREF_SOURCE_FILE_ATTR= JavaCore.COMPILER_SOURCE_FILE_ATTR;
private static final String PREF_CODEGEN_UNUSED_LOCAL= JavaCore.COMPILER_CODEGEN_UNUSED_LOCAL;
private static final String PREF_CODEGEN_TARGET_PLATFORM= JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM;
private static final String PREF_PB_UNREACHABLE_CODE= JavaCore.COMPILER_PB_UNREACHABLE_CODE;
private static final String PREF_PB_INVALID_IMPORT= JavaCore.COMPILER_PB_INVALID_IMPORT;
private static final String PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD= JavaCore.COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD;
private static final String PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME= JavaCore.COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME;
private static final String PREF_PB_DEPRECATION= JavaCore.COMPILER_PB_DEPRECATION;
private static final String PREF_PB_HIDDEN_CATCH_BLOCK= JavaCore.COMPILER_PB_HIDDEN_CATCH_BLOCK;
private static final String PREF_PB_UNUSED_LOCAL= JavaCore.COMPILER_PB_UNUSED_LOCAL;
private static final String PREF_PB_UNUSED_PARAMETER= JavaCore.COMPILER_PB_UNUSED_PARAMETER;
private static final String PREF_PB_SYNTHETIC_ACCESS_EMULATION= JavaCore.COMPILER_PB_SYNTHETIC_ACCESS_EMULATION;
private static final String PREF_PB_NON_EXTERNALIZED_STRINGS= JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL;
private static final String PREF_PB_ASSERT_AS_IDENTIFIER= JavaCore.COMPILER_PB_ASSERT_IDENTIFIER;
private static final String PREF_SOURCE_COMPATIBILITY= JavaCore.COMPILER_SOURCE;
private static final String PREF_COMPLIANCE= JavaCore.COMPILER_COMPLIANCE;
private static final String INTR_DEFAULT_COMPLIANCE= "internal.default.compliance";
private static final String GENERATE= JavaCore.GENERATE;
private static final String DO_NOT_GENERATE= JavaCore.DO_NOT_GENERATE;
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
private static final String PRESERVE= JavaCore.PRESERVE;
private static final String OPTIMIZE_OUT= JavaCore.OPTIMIZE_OUT;
private static final String VERSION_1_1= JavaCore.VERSION_1_1;
private static final String VERSION_1_2= JavaCore.VERSION_1_2;
private static final String VERSION_1_3= JavaCore.VERSION_1_3;
private static final String VERSION_1_4= JavaCore.VERSION_1_4;
private static final String ERROR= JavaCore.ERROR;
private static final String WARNING= JavaCore.WARNING;
private static final String IGNORE= JavaCore.IGNORE;
private static final String DEFAULT= "default";
private static final String USER= "user";
private static String[] getAllKeys() {
return new String[] {
PREF_LOCAL_VARIABLE_ATTR, PREF_LINE_NUMBER_ATTR, PREF_SOURCE_FILE_ATTR, PREF_CODEGEN_UNUSED_LOCAL,
PREF_CODEGEN_TARGET_PLATFORM, PREF_PB_UNREACHABLE_CODE, PREF_PB_INVALID_IMPORT, PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD,
PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME, PREF_PB_DEPRECATION, PREF_PB_HIDDEN_CATCH_BLOCK, PREF_PB_UNUSED_LOCAL,
PREF_PB_UNUSED_PARAMETER, PREF_PB_SYNTHETIC_ACCESS_EMULATION, PREF_PB_NON_EXTERNALIZED_STRINGS,
PREF_PB_ASSERT_AS_IDENTIFIER, PREF_SOURCE_COMPATIBILITY, PREF_COMPLIANCE
};
}
/**
* Initializes the current options (read from preference store)
*/
public static void initDefaults(IPreferenceStore store) {
}
private static class ControlData {
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
private String fKey;
private String[] fValues;
public ControlData(String key, String[] values) {
fKey= key;
fValues= values;
}
public String getKey() {
return fKey;
}
public String getValue(boolean selection) {
int index= selection ? 0 : 1;
return fValues[index];
}
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
public String getValue(int index) {
return fValues[index];
}
public int getSelection(String value) {
for (int i= 0; i < fValues.length; i++) {
if (value.equals(fValues[i])) {
return i;
}
}
throw new IllegalArgumentException();
}
}
private Hashtable fWorkingValues;
private ArrayList fCheckBoxes;
private ArrayList fComboBoxes;
private SelectionListener fSelectionListener;
private ArrayList fComplianceControls;
public CompilerPreferencePage() {
setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore());
setDescription(JavaUIMessages.getString("CompilerPreferencePage.description"));
fWorkingValues= JavaCore.getOptions();
fWorkingValues.put(INTR_DEFAULT_COMPLIANCE, getCurrentCompliance());
fCheckBoxes= new ArrayList();
fComboBoxes= new ArrayList();
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
fComplianceControls= new ArrayList();
fSelectionListener= new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {}
public void widgetSelected(SelectionEvent e) {
controlChanged(e.widget);
}
};
}
/**
* @see IWorkbenchPreferencePage#init()
*/
public void init(IWorkbench workbench) {
}
/**
* @see PreferencePage#createControl(Composite)
*/
public void createControl(Composite parent) {
super.createControl(parent);
WorkbenchHelp.setHelp(getControl(), IJavaHelpContextIds.COMPILER_PREFERENCE_PAGE);
}
/**
* @see PreferencePage#createContents(Composite)
*/
protected Control createContents(Composite parent) {
TabFolder folder= new TabFolder(parent, SWT.NONE);
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
folder.setLayout(new TabFolderLayout());
folder.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite warningsComposite= createWarningsTabContent(folder);
Composite codeGenComposite= createCodeGenTabContent(folder);
Composite complianceComposite= createComplianceTabContent(folder);
TabItem item= new TabItem(folder, SWT.NONE);
item.setText(JavaUIMessages.getString("CompilerPreferencePage.warnings.tabtitle"));
item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_REFACTORING_WARNING));
item.setControl(warningsComposite);
item= new TabItem(folder, SWT.NONE);
item.setText(JavaUIMessages.getString("CompilerPreferencePage.generation.tabtitle"));
item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_CFILE));
item.setControl(codeGenComposite);
item= new TabItem(folder, SWT.NONE);
item.setText(JavaUIMessages.getString("CompilerPreferencePage.compliance.tabtitle"));
item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_LIBRARY));
item.setControl(complianceComposite);
validateSettings(null, null);
return folder;
}
private Composite createWarningsTabContent(Composite folder) {
String[] errorWarningIgnore= new String[] { ERROR, WARNING, IGNORE };
String[] errorWarningIgnoreLabels= new String[] {
JavaUIMessages.getString("CompilerPreferencePage.error"),
JavaUIMessages.getString("CompilerPreferencePage.warning"),
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
JavaUIMessages.getString("CompilerPreferencePage.ignore")
};
GridLayout layout= new GridLayout();
layout.numColumns= 2;
Composite warningsComposite= new Composite(folder, SWT.NULL);
warningsComposite.setLayout(layout);
Label description= new Label(warningsComposite, SWT.WRAP);
description.setText(JavaUIMessages.getString("CompilerPreferencePage.warnings.description"));
GridData gd= new GridData();
gd.horizontalSpan= 2;
gd.widthHint= convertWidthInCharsToPixels(60);
description.setLayoutData(gd);
String label= JavaUIMessages.getString("CompilerPreferencePage.pb_unreachable_code.label");
addComboBox(warningsComposite, label, PREF_PB_UNREACHABLE_CODE, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_invalid_import.label");
addComboBox(warningsComposite, label, PREF_PB_INVALID_IMPORT, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_overriding_pkg_dflt.label");
addComboBox(warningsComposite, label, PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_method_naming.label");
addComboBox(warningsComposite, label, PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_deprecation.label");
addComboBox(warningsComposite, label, PREF_PB_DEPRECATION, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_hidden_catchblock.label");
addComboBox(warningsComposite, label, PREF_PB_HIDDEN_CATCH_BLOCK, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_unused_local.label");
addComboBox(warningsComposite, label, PREF_PB_UNUSED_LOCAL, errorWarningIgnore, errorWarningIgnoreLabels, 0);
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
label= JavaUIMessages.getString("CompilerPreferencePage.pb_unused_parameter.label");
addComboBox(warningsComposite, label, PREF_PB_UNUSED_PARAMETER, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_synth_access_emul.label");
addComboBox(warningsComposite, label, PREF_PB_SYNTHETIC_ACCESS_EMULATION, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_non_externalized_strings.label");
addComboBox(warningsComposite, label, PREF_PB_NON_EXTERNALIZED_STRINGS, errorWarningIgnore, errorWarningIgnoreLabels, 0);
return warningsComposite;
}
private Composite createCodeGenTabContent(Composite folder) {
String[] generateValues= new String[] { GENERATE, DO_NOT_GENERATE };
GridLayout layout= new GridLayout();
layout.numColumns= 2;
Composite codeGenComposite= new Composite(folder, SWT.NULL);
codeGenComposite.setLayout(layout);
String label= JavaUIMessages.getString("CompilerPreferencePage.variable_attr.label");
addCheckBox(codeGenComposite, label, PREF_LOCAL_VARIABLE_ATTR, generateValues, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.line_number_attr.label");
addCheckBox(codeGenComposite, label, PREF_LINE_NUMBER_ATTR, generateValues, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.source_file_attr.label");
addCheckBox(codeGenComposite, label, PREF_SOURCE_FILE_ATTR, generateValues, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.codegen_unused_local.label");
addCheckBox(codeGenComposite, label, PREF_CODEGEN_UNUSED_LOCAL, new String[] { PRESERVE, OPTIMIZE_OUT }, 0);
return codeGenComposite;
}
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
private Composite createComplianceTabContent(Composite folder) {
GridLayout layout= new GridLayout();
layout.numColumns= 2;
Composite complianceComposite= new Composite(folder, SWT.NULL);
complianceComposite.setLayout(layout);
String[] values34= new String[] { VERSION_1_3, VERSION_1_4 };
String[] values34Labels= new String[] {
JavaUIMessages.getString("CompilerPreferencePage.version13"),
JavaUIMessages.getString("CompilerPreferencePage.version14")
};
String label= JavaUIMessages.getString("CompilerPreferencePage.compiler_compliance.label");
addComboBox(complianceComposite, label, PREF_COMPLIANCE, values34, values34Labels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.default_settings.label");
addCheckBox(complianceComposite, label, INTR_DEFAULT_COMPLIANCE, new String[] { DEFAULT, USER }, 0);
int indent= convertWidthInCharsToPixels(2);
Control[] otherChildren= complianceComposite.getChildren();
String[] values14= new String[] { VERSION_1_1, VERSION_1_2, VERSION_1_3, VERSION_1_4 };
String[] values14Labels= new String[] {
JavaUIMessages.getString("CompilerPreferencePage.version11"),
JavaUIMessages.getString("CompilerPreferencePage.version12"),
JavaUIMessages.getString("CompilerPreferencePage.version13"),
JavaUIMessages.getString("CompilerPreferencePage.version14")
};
label= JavaUIMessages.getString("CompilerPreferencePage.codegen_targetplatform.label");
addComboBox(complianceComposite, label, PREF_CODEGEN_TARGET_PLATFORM, values14, values14Labels, indent);
label= JavaUIMessages.getString("CompilerPreferencePage.source_compatibility.label");
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
addComboBox(complianceComposite, label, PREF_SOURCE_COMPATIBILITY, values34, values34Labels, indent);
String[] errorWarningIgnore= new String[] { ERROR, WARNING, IGNORE };
String[] errorWarningIgnoreLabels= new String[] {
JavaUIMessages.getString("CompilerPreferencePage.error"),
JavaUIMessages.getString("CompilerPreferencePage.warning"),
JavaUIMessages.getString("CompilerPreferencePage.ignore")
};
label= JavaUIMessages.getString("CompilerPreferencePage.pb_assert_as_identifier.label");
addComboBox(complianceComposite, label, PREF_PB_ASSERT_AS_IDENTIFIER, errorWarningIgnore, errorWarningIgnoreLabels, indent);
Control[] allChildren= complianceComposite.getChildren();
fComplianceControls.addAll(Arrays.asList(allChildren));
fComplianceControls.removeAll(Arrays.asList(otherChildren));
return complianceComposite;
}
private void addCheckBox(Composite parent, String label, String key, String[] values, int indent) {
ControlData data= new ControlData(key, values);
GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan= 2;
gd.horizontalIndent= indent;
Button checkBox= new Button(parent, SWT.CHECK);
checkBox.setText(label);
checkBox.setData(data);
checkBox.setLayoutData(gd);
checkBox.addSelectionListener(fSelectionListener);
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
String currValue= (String)fWorkingValues.get(key);
checkBox.setSelection(data.getSelection(currValue) == 0);
fCheckBoxes.add(checkBox);
}
private void addComboBox(Composite parent, String label, String key, String[] values, String[] valueLabels, int indent) {
ControlData data= new ControlData(key, values);
GridData gd= new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalIndent= indent;
Label labelControl= new Label(parent, SWT.NONE);
labelControl.setText(label);
labelControl.setLayoutData(gd);
Combo comboBox= new Combo(parent, SWT.READ_ONLY);
comboBox.setItems(valueLabels);
comboBox.setData(data);
comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
comboBox.addSelectionListener(fSelectionListener);
String currValue= (String)fWorkingValues.get(key);
comboBox.select(data.getSelection(currValue));
fComboBoxes.add(comboBox);
}
private void controlChanged(Widget widget) {
ControlData data= (ControlData) widget.getData();
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
String newValue= null;
if (widget instanceof Button) {
newValue= data.getValue(((Button)widget).getSelection());
} else if (widget instanceof Combo) {
newValue= data.getValue(((Combo)widget).getSelectionIndex());
} else {
return;
}
fWorkingValues.put(data.getKey(), newValue);
validateSettings(data.getKey(), newValue);
}
private boolean checkValue(String key, String value) {
return value.equals(fWorkingValues.get(key));
}
/* (non-javadoc)
* Update fields and validate.
* @param changedKey Key that changed, or null, if all changed.
*/
private void validateSettings(String changedKey, String newValue) {
if (changedKey != null) {
if (INTR_DEFAULT_COMPLIANCE.equals(changedKey)) {
updateComplianceEnableState();
if (DEFAULT.equals(newValue)) {
updateComplianceDefaultSettings();
}
} else if (PREF_COMPLIANCE.equals(changedKey)) {
if (checkValue(INTR_DEFAULT_COMPLIANCE, DEFAULT)) {
updateComplianceDefaultSettings();
}
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
} else if (!PREF_SOURCE_COMPATIBILITY.equals(changedKey) &&
!PREF_CODEGEN_TARGET_PLATFORM.equals(changedKey) &&
!PREF_PB_ASSERT_AS_IDENTIFIER.equals(changedKey)) {
return;
}
} else {
updateComplianceEnableState();
}
updateStatus(getValidation());
}
private IStatus getValidation() {
StatusInfo status= new StatusInfo();
if (checkValue(PREF_COMPLIANCE, VERSION_1_3)) {
if (checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_4)) {
status.setError(JavaUIMessages.getString("CompilerPreferencePage.cpl13src14.error"));
return status;
} else if (checkValue(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_4)) {
status.setError(JavaUIMessages.getString("CompilerPreferencePage.cpl13trg14.error"));
return status;
}
}
if (checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_4)) {
if (!checkValue(PREF_PB_ASSERT_AS_IDENTIFIER, ERROR)) {
status.setError(JavaUIMessages.getString("CompilerPreferencePage.src14asrterr.error"));
return status;
}
}
if (checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_4)) {
if (!checkValue(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_4)) {
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
status.setError(JavaUIMessages.getString("CompilerPreferencePage.src14tgt14.error"));
return status;
}
}
return status;
}
/*
* Update the compliance controls' enable state
*/
private void updateComplianceEnableState() {
boolean enabled= checkValue(INTR_DEFAULT_COMPLIANCE, USER);
for (int i= fComplianceControls.size() - 1; i >= 0; i--) {
Control curr= (Control) fComplianceControls.get(i);
curr.setEnabled(enabled);
}
}
/*
* Set the default compliance values derived from the chosen level
*/
private void updateComplianceDefaultSettings() {
Object complianceLevel= fWorkingValues.get(PREF_COMPLIANCE);
if (VERSION_1_3.equals(complianceLevel)) {
fWorkingValues.put(PREF_PB_ASSERT_AS_IDENTIFIER, IGNORE);
fWorkingValues.put(PREF_SOURCE_COMPATIBILITY, VERSION_1_3);
fWorkingValues.put(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_1);
} else if (VERSION_1_4.equals(complianceLevel)) {
fWorkingValues.put(PREF_PB_ASSERT_AS_IDENTIFIER, ERROR);
fWorkingValues.put(PREF_SOURCE_COMPATIBILITY, VERSION_1_4);
fWorkingValues.put(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_4);
}
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
updateControls();
}
/*
* Evaluate if the current compliance setting correspond to a default setting
*/
private String getCurrentCompliance() {
Object complianceLevel= fWorkingValues.get(PREF_COMPLIANCE);
if ((VERSION_1_3.equals(complianceLevel)
&& checkValue(PREF_PB_ASSERT_AS_IDENTIFIER, IGNORE)
&& checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_3)
&& checkValue(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_1))
|| (VERSION_1_4.equals(complianceLevel)
&& checkValue(PREF_PB_ASSERT_AS_IDENTIFIER, ERROR)
&& checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_4)
&& checkValue(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_4))) {
return DEFAULT;
}
return USER;
}
/*
* @see IPreferencePage#performOk()
*/
public boolean performOk() {
String[] allKeys= getAllKeys();
Hashtable actualOptions= JavaCore.getOptions();
boolean hasChanges= false;
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
for (int i= 0; i < allKeys.length; i++) {
String key= allKeys[i];
String val= (String) fWorkingValues.get(key);
String oldVal= (String) actualOptions.get(key);
hasChanges= hasChanges | !val.equals(oldVal);
actualOptions.put(key, val);
}
if (hasChanges) {
String title= JavaUIMessages.getString("CompilerPreferencePage.needsbuild.title");
String message= JavaUIMessages.getString("CompilerPreferencePage.needsbuild.message");
MessageDialog dialog= new MessageDialog(getShell(), title, null, message, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 2);
int res= dialog.open();
if (res != 0 && res != 1) {
return false;
}
JavaCore.setOptions(actualOptions);
if (res == 0) {
doFullBuild();
}
}
return super.performOk();
}
public static boolean openQuestion(Shell parent, String title, String message) {
MessageDialog dialog= new MessageDialog(parent, title, null, message, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 2);
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
return dialog.open() == 0;
}
private void doFullBuild() {
ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell());
try {
dialog.run(true, true, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
JavaPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
} catch (CoreException e) {
throw new InvocationTargetException(e);
}
}
});
} catch (InterruptedException e) {
} catch (InvocationTargetException e) {
String title= JavaUIMessages.getString("CompilerPreferencePage.builderror.title");
String message= JavaUIMessages.getString("CompilerPreferencePage.builderror.message");
ExceptionHandler.handle(e, getShell(), title, message);
}
}
/*
* @see PreferencePage#performDefaults()
*/
protected void performDefaults() {
fWorkingValues= JavaCore.getDefaultOptions();
fWorkingValues.put(INTR_DEFAULT_COMPLIANCE, getCurrentCompliance());
|
13,661 |
Bug 13661 Labels and widgets too far apart in preference pages
|
Build: 20020411 Steps: 1. Click on Window->Preferences 2. Open Java->Editor or Java->Compiler The widgets used to select options (Combo boxes or color selection boxes) are right-aligned, and the labels are left aligned, leaving a large space between. This problem is magnified if the user opens a page that is wider than the default width, "stretching" the preference page dialog box. It takes more than a glance for the user to realize which labels line up with which widgets. See the Ant->Console page for an example of a better layout. In Ant->Console, the widgets are aligned, but appear closer to their labels.
|
resolved fixed
|
07f36eb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-08T16:31:10Z | 2002-04-12T16:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
updateControls();
validateSettings(null, null);
super.performDefaults();
}
private void updateControls() {
for (int i= fCheckBoxes.size() - 1; i >= 0; i--) {
Button curr= (Button) fCheckBoxes.get(i);
ControlData data= (ControlData) curr.getData();
String currValue= (String) fWorkingValues.get(data.getKey());
curr.setSelection(data.getSelection(currValue) == 0);
}
for (int i= fComboBoxes.size() - 1; i >= 0; i--) {
Combo curr= (Combo) fComboBoxes.get(i);
ControlData data= (ControlData) curr.getData();
String currValue= (String) fWorkingValues.get(data.getKey());
curr.select(data.getSelection(currValue));
}
}
private void updateStatus(IStatus status) {
setValid(!status.matches(IStatus.ERROR));
StatusUtil.applyToStatusLine(this, status);
}
}
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.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.ui.actions;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaElement;
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
|
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.corext.codemanipulation.AddGetterSetterOperation;
import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
import org.eclipse.jdt.internal.corext.codemanipulation.IRequestQuery;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.ActionMessages;
import org.eclipse.jdt.internal.ui.actions.SelectionConverter;
import org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter;
import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.preferences.CodeGenerationPreferencePage;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabels;
/**
* Create Getter and Setter for selected fields.
* Will open the parent compilation unit in the editor.
* The result is unsaved, so the user can decide if the
* changes are acceptable.
*
* <p>
* This class may be instantiated; it is not intended to be subclassed.
* </p>
*
* @since 2.0
*/
public class AddGetterSetterAction extends SelectionDispatchAction {
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
|
private CompilationUnitEditor fEditor;
/**
* Creates a new <code>AddGetterSetterAction</code>.
*
* @param site the site providing context information for this action
*/
public AddGetterSetterAction(IWorkbenchSite site) {
super(site);
setText(ActionMessages.getString("AddGetterSetterAction.label"));
setDescription(ActionMessages.getString("AddGetterSetterAction.description"));
setToolTipText(ActionMessages.getString("AddGetterSetterAction.tooltip"));
WorkbenchHelp.setHelp(this, IJavaHelpContextIds.GETTERSETTER_ACTION);
}
/**
* Creates a new <code>AddGetterSetterAction</code>.
* <p>
* Note: This constructor is for internal use only. Clients should not call this constructor.
* </p>
*/
public AddGetterSetterAction(CompilationUnitEditor editor) {
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
|
this(editor.getEditorSite());
fEditor= editor;
}
/* (non-Javadoc)
* Method declared on SelectionDispatchAction
*/
protected void selectionChanged(IStructuredSelection selection) {
try {
IMember[] members= getSelectedFields(selection);
setEnabled(members != null && members.length > 0 && JavaModelUtil.isEditable(members[0].getCompilationUnit()));
} catch (JavaModelException e) {
JavaPlugin.log(e);
setEnabled(false);
}
}
/* (non-Javadoc)
* Method declared on SelectionDispatchAction
*/
protected void run(IStructuredSelection selection) {
IField[] fields= getSelectedFields(selection);
if (fields == null) {
return;
}
try {
ICompilationUnit cu= fields[0].getCompilationUnit();
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
|
IEditorPart editor= EditorUtility.openInEditor(cu);
ICompilationUnit workingCopyCU;
IField[] workingCopyFields;
if (cu.isWorkingCopy()) {
workingCopyCU= cu;
workingCopyFields= fields;
} else {
workingCopyCU= EditorUtility.getWorkingCopy(cu);
if (workingCopyCU == null) {
showError(ActionMessages.getString("AddGetterSetterAction.error.actionfailed"));
return;
}
workingCopyFields= new IField[fields.length];
for (int i= 0; i < fields.length; i++) {
IField field= fields[i];
IField workingCopyField= (IField) JavaModelUtil.findMemberInCompilationUnit(workingCopyCU, field);
if (workingCopyField == null) {
showError(ActionMessages.getFormattedString("AddGetterSetterAction.error.fieldNotExisting", field.getElementName()));
return;
}
workingCopyFields[i]= workingCopyField;
}
}
run(workingCopyFields, editor);
} catch (CoreException e) {
JavaPlugin.log(e.getStatus());
showError(ActionMessages.getString("AddGetterSetterAction.error.actionfailed"));
}
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
|
}
/* (non-Javadoc)
* Method declared on SelectionDispatchAction
*/
protected void selectionChanged(ITextSelection selection) {
setEnabled(fEditor != null && !fEditor.isEditorInputReadOnly());
}
/* (non-Javadoc)
* Method declared on SelectionDispatchAction
*/
protected void run(ITextSelection selection) {
try {
IJavaElement[] elements= SelectionConverter.codeResolve(fEditor);
if (elements.length == 0 || elements.length > 1 || !(elements[0] instanceof IField)) {
MessageDialog.openInformation(getShell(), getDialogTitle(),
ActionMessages.getString("AddGetterSetterAction.not_applicable"));
}
} catch (CoreException e) {
JavaPlugin.log(e.getStatus());
showError(ActionMessages.getString("AddGetterSetterAction.error.actionfailed"));
}
}
private void run(IField[] fields, IEditorPart editor) {
try{
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
|
IRequestQuery skipSetterForFinalQuery= skipSetterForFinalQuery();
IRequestQuery skipReplaceQuery= skipReplaceQuery();
String[] prefixes= CodeGenerationPreferencePage.getGetterStetterPrefixes();
String[] suffixes= CodeGenerationPreferencePage.getGetterStetterSuffixes();
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
AddGetterSetterOperation op= new AddGetterSetterOperation(fields, prefixes, suffixes, settings, skipSetterForFinalQuery, skipReplaceQuery);
ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell());
dialog.run(false, true, new WorkbenchRunnableAdapter(op));
IMethod[] createdMethods= op.getCreatedAccessors();
if (createdMethods.length > 0) {
EditorUtility.revealInEditor(editor, createdMethods[0]);
}
} catch (InvocationTargetException e) {
JavaPlugin.log(e);
showError(ActionMessages.getString("AddGetterSetterAction.error.actionfailed"));
} catch (InterruptedException e) {
}
}
private IRequestQuery skipSetterForFinalQuery() {
return new IRequestQuery() {
public int doQuery(IMember field) {
int[] returnCodes= {IRequestQuery.YES, IRequestQuery.NO, IRequestQuery.YES_ALL, IRequestQuery.CANCEL};
String[] options= {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.CANCEL_LABEL};
String fieldName= JavaElementLabels.getElementLabel(field, 0);
String formattedMessage= ActionMessages.getFormattedString("AddGetterSetterAction.SkipSetterForFinalDialog.message", fieldName);
return showQueryDialog(formattedMessage, options, returnCodes);
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
|
}
};
}
private IRequestQuery skipReplaceQuery() {
return new IRequestQuery() {
public int doQuery(IMember method) {
int[] returnCodes= {IRequestQuery.YES, IRequestQuery.NO, IRequestQuery.YES_ALL, IRequestQuery.CANCEL};
String skipLabel= ActionMessages.getString("AddGetterSetterAction.SkipExistingDialog.skip.label");
String replaceLabel= ActionMessages.getString("AddGetterSetterAction.SkipExistingDialog.replace.label");
String skipAllLabel= ActionMessages.getString("AddGetterSetterAction.SkipExistingDialog.skipAll.label");
String[] options= { skipLabel, replaceLabel, skipAllLabel, IDialogConstants.CANCEL_LABEL};
String methodName= JavaElementLabels.getElementLabel(method, JavaElementLabels.M_PARAMETER_TYPES);
String formattedMessage= ActionMessages.getFormattedString("AddGetterSetterAction.SkipExistingDialog.message", methodName);
return showQueryDialog(formattedMessage, options, returnCodes);
}
};
}
private int showQueryDialog(final String message, final String[] buttonLabels, int[] returnCodes) {
final Shell shell= getShell();
if (shell == null) {
JavaPlugin.logErrorMessage("AddGetterSetterAction.showQueryDialog: No active shell found");
return IRequestQuery.CANCEL;
}
final int[] result= { MessageDialog.CANCEL };
shell.getDisplay().syncExec(new Runnable() {
public void run() {
String title= ActionMessages.getString("AddGetterSetterAction.QueryDialog.title");
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
|
MessageDialog dialog= new MessageDialog(shell, title, null, message, MessageDialog.QUESTION, buttonLabels, 0);
result[0]= dialog.open();
}
});
int returnVal= result[0];
return returnVal < 0 ? IRequestQuery.CANCEL : returnCodes[returnVal];
}
private void showError(String message) {
MessageDialog.openError(getShell(), getDialogTitle(), message);
}
/*
* Returns fields in the selection or <code>null</code> if the selection is
* empty or not valid.
*/
private IField[] getSelectedFields(IStructuredSelection selection) {
List elements= selection.toList();
int nElements= elements.size();
if (nElements > 0) {
IField[] res= new IField[nElements];
ICompilationUnit cu= null;
for (int i= 0; i < nElements; i++) {
Object curr= elements.get(i);
if (curr instanceof IField) {
IField fld= (IField)curr;
if (i == 0) {
cu= fld.getCompilationUnit();
if (cu == null) {
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
|
return null;
}
} else if (!cu.equals(fld.getCompilationUnit())) {
return null;
}
try {
if (fld.getDeclaringType().isInterface()) {
return null;
}
} catch (JavaModelException e) {
JavaPlugin.log(e);
return null;
}
res[i]= fld;
} else {
return null;
}
}
return res;
}
return null;
}
private String getDialogTitle() {
return ActionMessages.getString("AddGetterSetterAction.error.title");
}
}
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateActionGroup.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.jface.action.GroupMarker;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateActionGroup.java
|
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IActionBars;
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.AddBookmarkAction;
import org.eclipse.ui.part.Page;
import org.eclipse.ui.texteditor.ConvertLineDelimitersAction;
import org.eclipse.jdt.ui.IContextMenuConstants;
import org.eclipse.jdt.internal.ui.actions.ActionMessages;
import org.eclipse.jdt.internal.ui.javaeditor.AddImportOnSelectionAction;
import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
/**
* Action group that adds the source and generate actions to a context menu and
* action bar.
*
* <p>
* This class may be instantiated; it is not intended to be subclassed.
* </p>
*
* @since 2.0
*/
public class GenerateActionGroup extends ActionGroup {
private boolean fEditorIsOwner;
private IWorkbenchSite fSite;
private String fGroupName= IContextMenuConstants.GROUP_SOURCE;
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateActionGroup.java
|
private AddImportOnSelectionAction fAddImport;
private OverrideMethodsAction fOverrideMethods;
private AddGetterSetterAction fAddGetterSetter;
private AddUnimplementedConstructorsAction fAddUnimplementedConstructors;
private AddJavaDocStubAction fAddJavaDocStub;
private AddBookmarkAction fAddBookmark;
private ExternalizeStringsAction fExternalizeStrings;
private FindStringsToExternalizeAction fFindStringsToExternalize;
private SurroundWithTryCatchAction fSurroundWithTryCatch;
private OrganizeImportsAction fOrganizeImports;
private ConvertLineDelimitersAction fConvertToWindows;
private ConvertLineDelimitersAction fConvertToUNIX;
private ConvertLineDelimitersAction fConvertToMac;
/**
* Creates a new <code>GenerateActionGroup</code>.
* <p>
* Note: This constructor is for internal use only. Clients should not call this constructor.
* </p>
*/
public GenerateActionGroup(CompilationUnitEditor editor, String groupName) {
fSite= editor.getSite();
fEditorIsOwner= true;
fGroupName= groupName;
ISelectionProvider provider= fSite.getSelectionProvider();
ISelection selection= provider.getSelection();
fAddImport= new AddImportOnSelectionAction(editor);
fAddImport.update();
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateActionGroup.java
|
fOrganizeImports= new OrganizeImportsAction(editor);
fOrganizeImports.editorStateChanged();
fOverrideMethods= new OverrideMethodsAction(editor);
fOverrideMethods.editorStateChanged();
fAddUnimplementedConstructors= new AddUnimplementedConstructorsAction(editor);
fAddUnimplementedConstructors.editorStateChanged();
fAddJavaDocStub= new AddJavaDocStubAction(editor);
fAddJavaDocStub.editorStateChanged();
fSurroundWithTryCatch= new SurroundWithTryCatchAction(editor);
fSurroundWithTryCatch.update(selection);
provider.addSelectionChangedListener(fSurroundWithTryCatch);
fExternalizeStrings= new ExternalizeStringsAction(editor);
fExternalizeStrings.editorStateChanged();
fConvertToWindows= new ConvertLineDelimitersAction(editor, "\r\n");
fConvertToUNIX= new ConvertLineDelimitersAction(editor, "\n");
fConvertToMac= new ConvertLineDelimitersAction(editor, "\r");
}
/**
* Creates a new <code>GenerateActionGroup</code>.
*
* @param page the page that owns this action group
*/
public GenerateActionGroup(Page page) {
this(page.getSite());
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateActionGroup.java
|
}
/**
* Creates a new <code>GenerateActionGroup</code>.
*
* @param part the view part that owns this action group
*/
public GenerateActionGroup(IViewPart part) {
this(part.getSite());
}
private GenerateActionGroup(IWorkbenchSite site) {
fSite= site;
ISelectionProvider provider= fSite.getSelectionProvider();
ISelection selection= provider.getSelection();
fOverrideMethods= new OverrideMethodsAction(site);
fAddGetterSetter= new AddGetterSetterAction(site);
fAddUnimplementedConstructors= new AddUnimplementedConstructorsAction(site);
fAddJavaDocStub= new AddJavaDocStubAction(site);
fAddBookmark= new AddBookmarkAction(site.getShell());
fExternalizeStrings= new ExternalizeStringsAction(site);
fFindStringsToExternalize= new FindStringsToExternalizeAction(site);
fOrganizeImports= new OrganizeImportsAction(site);
fOverrideMethods.update(selection);
fAddGetterSetter.update(selection);
fAddUnimplementedConstructors.update(selection);
fAddJavaDocStub.update(selection);
fExternalizeStrings.update(selection);
fFindStringsToExternalize.update(selection);
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateActionGroup.java
|
if (selection instanceof IStructuredSelection) {
IStructuredSelection ss= (IStructuredSelection)selection;
fAddBookmark.selectionChanged(ss);
} else {
fAddBookmark.setEnabled(false);
}
fOrganizeImports.update(selection);
provider.addSelectionChangedListener(fOverrideMethods);
provider.addSelectionChangedListener(fAddGetterSetter);
provider.addSelectionChangedListener(fAddUnimplementedConstructors);
provider.addSelectionChangedListener(fAddJavaDocStub);
provider.addSelectionChangedListener(fAddBookmark);
provider.addSelectionChangedListener(fExternalizeStrings);
provider.addSelectionChangedListener(fFindStringsToExternalize);
provider.addSelectionChangedListener(fOrganizeImports);
}
/**
* The state of the editor owning this action group has changed.
* This method does nothing if the group's owner isn't an
* editor.
* <p>
* Note: This method is for internal use only. Clients should not call this method.
* </p>
*/
public void editorStateChanged() {
Assert.isTrue(fEditorIsOwner);
fAddImport.update();
fExternalizeStrings.editorStateChanged();
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateActionGroup.java
|
fOrganizeImports.editorStateChanged();
fOverrideMethods.editorStateChanged();
fAddUnimplementedConstructors.editorStateChanged();
fAddJavaDocStub.editorStateChanged();
fSurroundWithTryCatch.editorStateChanged();
}
/* (non-Javadoc)
* Method declared in ActionGroup
*/
public void fillActionBars(IActionBars actionBar) {
super.fillActionBars(actionBar);
setGlobalActionHandlers(actionBar);
}
/* (non-Javadoc)
* Method declared in ActionGroup
*/
public void fillContextMenu(IMenuManager menu) {
super.fillContextMenu(menu);
IMenuManager target= menu;
IMenuManager generateMenu= null;
if (fEditorIsOwner) {
generateMenu= new MenuManager(ActionMessages.getString("SourceMenu.label"));
generateMenu.add(new GroupMarker(fGroupName));
target= generateMenu;
}
int added= 0;
added+= appendToGroup(target, fAddImport);
added+= appendToGroup(target, fOrganizeImports);
added+= appendToGroup(target, fSurroundWithTryCatch);
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateActionGroup.java
|
added+= appendToGroup(target, fOverrideMethods);
added+= appendToGroup(target, fAddGetterSetter);
added+= appendToGroup(target, fAddUnimplementedConstructors);
added+= appendToGroup(target, fAddJavaDocStub);
added+= appendToGroup(target, fAddBookmark);
added+= appendToGroup(target, fExternalizeStrings);
if (generateMenu != null && added > 0)
menu.appendToGroup(fGroupName, generateMenu);
}
/* (non-Javadoc)
* Method declared in ActionGroup
*/
public void dispose() {
ISelectionProvider provider= fSite.getSelectionProvider();
disposeAction(fOverrideMethods, provider);
disposeAction(fAddGetterSetter, provider);
disposeAction(fAddUnimplementedConstructors, provider);
disposeAction(fAddJavaDocStub, provider);
disposeAction(fAddBookmark, provider);
disposeAction(fExternalizeStrings, provider);
disposeAction(fFindStringsToExternalize, provider);
disposeAction(fOrganizeImports, provider);
disposeAction(fSurroundWithTryCatch, provider);
super.dispose();
}
private void setGlobalActionHandlers(IActionBars actionBar) {
actionBar.setGlobalActionHandler(JdtActionConstants.ADD_IMPORT, fAddImport);
actionBar.setGlobalActionHandler(JdtActionConstants.SURROUND_WITH_TRY_CATCH, fSurroundWithTryCatch);
actionBar.setGlobalActionHandler(JdtActionConstants.OVERRIDE_METHODS, fOverrideMethods);
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateActionGroup.java
|
actionBar.setGlobalActionHandler(JdtActionConstants.GENERATE_GETTER_SETTER, fAddGetterSetter);
actionBar.setGlobalActionHandler(JdtActionConstants.ADD_CONSTRUCTOR_FROM_SUPERCLASS, fAddUnimplementedConstructors);
actionBar.setGlobalActionHandler(JdtActionConstants.ADD_JAVA_DOC_COMMENT, fAddJavaDocStub);
actionBar.setGlobalActionHandler(IWorkbenchActionConstants.BOOKMARK, fAddBookmark);
actionBar.setGlobalActionHandler(JdtActionConstants.EXTERNALIZE_STRINGS, fExternalizeStrings);
actionBar.setGlobalActionHandler(JdtActionConstants.FIND_STRINGS_TO_EXTERNALIZE, fFindStringsToExternalize);
actionBar.setGlobalActionHandler(JdtActionConstants.ORGANIZE_IMPORTS, fOrganizeImports);
actionBar.setGlobalActionHandler(JdtActionConstants.CONVERT_LINE_DELIMITERS_TO_WINDOWS, fConvertToWindows);
actionBar.setGlobalActionHandler(JdtActionConstants.CONVERT_LINE_DELIMITERS_TO_UNIX, fConvertToUNIX);
actionBar.setGlobalActionHandler(JdtActionConstants.CONVERT_LINE_DELIMITERS_TO_MAC, fConvertToMac);
}
private int appendToGroup(IMenuManager menu, IAction action) {
if (action != null && action.isEnabled()) {
menu.appendToGroup(fGroupName, action);
return 1;
}
return 0;
}
private void addAction(IMenuManager menu, IAction action) {
if (action != null && action.isEnabled())
menu.add(action);
}
private void disposeAction(ISelectionChangedListener action, ISelectionProvider provider) {
if (action != null)
provider.removeSelectionChangedListener(action);
}
}
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08: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
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ImportActionGroup.java
|
* context menu.
*
* @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));
menu.appendToGroup(GROUP_IMPORT, fImportAction);
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08: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;
}
}
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenSuperImplementationAction.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.ui.actions;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
|
7,330 |
Bug 7330 Make more actions available on text selection
|
I could not find the action "Add Javadoc Comment" until I switched to the Outline view. I expected the action to be 1. in the context menu and if not 2. in the Edit (or some other global) menu I think currently we distribute the actions on a personal taste basis. This should be changed. It is not clear to users why some actions are in the context menu and some are not (OK - not all need to be in the context menu but all must be reachable from the editor e.g. via Edit menu). It is not acceptable to force users to switch the view.
|
resolved fixed
|
08af42f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-10T09:32:54Z | 2002-01-08T08:53:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenSuperImplementationAction.java
|
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.ITypeHierarchy;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.ActionMessages;
import org.eclipse.jdt.internal.ui.actions.OpenActionUtil;
import org.eclipse.jdt.internal.ui.actions.SelectionConverter;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
/**
* This action opens a java editor on the super implementation of a element represented by either
* <ul>
* <li>a text selection inside a Java editor, or </li>
* <li>a structured selection of a view part showing Java elements</li>
* </ul>
*
* <p>
* This class may be instantiated; it is not intended to be subclassed.
* </p>
*
* @since 2.0
*/
public class OpenSuperImplementationAction extends SelectionDispatchAction {
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.