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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13,269 |
Bug 13269 Incorrect operation order in jarpackager
| null |
resolved fixed
|
7a8abf9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T10:26:34Z | 2002-04-10T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingDescription"), ex);
} catch (IOException ex) {
addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingDescription"), ex);
}
}
}
protected void saveDescription() throws CoreException, IOException {
if (fJarPackage.isManifestReused())
fJarPackage.setGenerateManifest(false);
ByteArrayOutputStream objectStreamOutput= new ByteArrayOutputStream();
IJarDescriptionWriter writer= fJarPackage.createJarDescriptionWriter(objectStreamOutput);
ByteArrayInputStream fileInput= null;
try {
writer.write(fJarPackage);
fileInput= new ByteArrayInputStream(objectStreamOutput.toByteArray());
IFile descriptionFile= fJarPackage.getDescriptionFile();
if (descriptionFile.isAccessible() && (fJarPackage.allowOverwrite() || JarPackagerUtil.askForOverwritePermission(fParentShell, descriptionFile.getFullPath().toString())))
descriptionFile.setContents(fileInput, true, true, null);
else {
descriptionFile.create(fileInput, true, null);
}
} finally {
if (fileInput != null)
fileInput.close();
if (writer != null)
writer.close();
}
}
protected void saveManifest() throws CoreException, IOException {
|
13,269 |
Bug 13269 Incorrect operation order in jarpackager
| null |
resolved fixed
|
7a8abf9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T10:26:34Z | 2002-04-10T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
ByteArrayOutputStream manifestOutput= new ByteArrayOutputStream();
ByteArrayInputStream fileInput= null;
try {
Manifest manifest= fJarPackage.getManifestProvider().create(fJarPackage);
manifest.write(manifestOutput);
fileInput= new ByteArrayInputStream(manifestOutput.toByteArray());
IFile manifestFile= fJarPackage.getManifestFile();
if (manifestFile.isAccessible() && (fJarPackage.allowOverwrite() || JarPackagerUtil.askForOverwritePermission(fParentShell, manifestFile.getFullPath().toString())))
manifestFile.setContents(fileInput, true, true, null);
else {
manifestFile.create(fileInput, true, null);
}
} finally {
if (manifestOutput != null)
manifestOutput.close();
if (fileInput != null)
fileInput.close();
}
}
private boolean isAutoBuilding() {
return ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding();
}
private boolean isCompilerGeneratingSourceFileAttribute() {
Object value= JavaCore.getOptions().get(COMPILER_SOURCE_FILE_ATTR);
if (value instanceof String)
return "generate".equalsIgnoreCase((String)value);
else
return true;
}
|
13,269 |
Bug 13269 Incorrect operation order in jarpackager
| null |
resolved fixed
|
7a8abf9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T10:26:34Z | 2002-04-10T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
private void buildProjects(IProgressMonitor progressMonitor) {
Set builtProjects= new HashSet(10);
Object[] elements= fJarPackage.getElements();
for (int i= 0; i < elements.length; i++) {
IProject project= null;
Object element= elements[i];
if (element instanceof IResource)
project= ((IResource)element).getProject();
else if (element instanceof IJavaElement)
project= ((IJavaElement)element).getJavaProject().getProject();
if (project != null && !builtProjects.contains(project)) {
try {
project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, progressMonitor);
} catch (CoreException ex) {
String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.errorDuringProjectBuild", project.getFullPath());
addError(message, ex);
} finally {
builtProjects.add(project);
}
}
}
}
/**
* Tells whether the given resource (or its children) have compile errors.
* The method acts on the current build state and does not recompile.
*
* @param resource the resource to check for errors
* @return <code>true</code> if the resource (and its children) are error free
* @throws import org.eclipse.core.runtime.CoreException if there's a marker problem
|
13,269 |
Bug 13269 Incorrect operation order in jarpackager
| null |
resolved fixed
|
7a8abf9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T10:26:34Z | 2002-04-10T14:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|
*/
private boolean hasCompileErrors(IResource resource) throws CoreException {
IMarker[] problemMarkers= resource.findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
for (int i= 0; i < problemMarkers.length; i++) {
if (problemMarkers[i].getAttribute(IMarker.SEVERITY, -1) == IMarker.SEVERITY_ERROR)
return true;
}
return false;
}
/**
* Tells whether the given resource (or its children) have compile errors.
* The method acts on the current build state and does not recompile.
*
* @param resource the resource to check for errors
* @return <code>true</code> if the resource (and its children) are error free
* @throws import org.eclipse.core.runtime.CoreException if there's a marker problem
*/
private boolean hasCompileWarnings(IResource resource) throws CoreException {
IMarker[] problemMarkers= resource.findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
for (int i= 0; i < problemMarkers.length; i++) {
if (problemMarkers[i].getAttribute(IMarker.SEVERITY, -1) == IMarker.SEVERITY_WARNING)
return true;
}
return false;
}
private boolean mustUseSourceFolderHierarchy() {
return fJarPackage.useSourceFolderHierarchy() && fJarPackage.areJavaFilesExported() && !fJarPackage.areClassFilesExported();
}
}
|
12,676 |
Bug 12676 Code assist for type in javadoc does not show type itself
|
1. Open CU for X 2. add Javadoc for class X 3. enter @see 4. enter SPACE 5. open code assist ==> X not in list though X#... is allowed
|
resolved fixed
|
fafeb67
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T13:45:07Z | 2002-04-03T13:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionEvaluator.java
|
package org.eclipse.jdt.internal.ui.text.javadoc;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import java.util.ArrayList;
import java.util.List;
import org.eclipse.swt.graphics.Image;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jdt.core.CompletionRequestorAdapter;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.ISourceReference;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal;
import org.eclipse.jdt.internal.ui.text.java.ProposalInfo;
public class JavaDocCompletionEvaluator {
|
12,676 |
Bug 12676 Code assist for type in javadoc does not show type itself
|
1. Open CU for X 2. add Javadoc for class X 3. enter @see 4. enter SPACE 5. open code assist ==> X not in list though X#... is allowed
|
resolved fixed
|
fafeb67
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T13:45:07Z | 2002-04-03T13:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionEvaluator.java
|
protected final static String[] fgTagProposals= {
"@author",
"@deprecated",
"@exception",
"@link",
"@param",
"@return",
"@see", "@serial", "@serialData", "@serialField", "@since",
"@throws",
"@version"
};
protected final static String[] fgHTMLProposals= {
"<code>", "</code>",
"<br>",
"<b>", "</b>",
"<i>", "</i>",
"<pre>", "</pre>"
};
private ICompilationUnit fCompilationUnit;
private IDocument fDocument;
private int fCurrentPos;
private int fCurrentLength;
|
12,676 |
Bug 12676 Code assist for type in javadoc does not show type itself
|
1. Open CU for X 2. add Javadoc for class X 3. enter @see 4. enter SPACE 5. open code assist ==> X not in list though X#... is allowed
|
resolved fixed
|
fafeb67
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T13:45:07Z | 2002-04-03T13:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionEvaluator.java
|
private JavaElementLabelProvider fLabelProvider;
private List fResult;
private boolean fRestrictToMatchingCase;
public JavaDocCompletionEvaluator(ICompilationUnit cu, IDocument doc, int pos, int length) {
fCompilationUnit= cu;
fDocument= doc;
fCurrentPos= pos;
fCurrentLength= length;
fResult= new ArrayList();
fRestrictToMatchingCase= false;
}
/**
* Tells this evaluator to restrict is proposals to those
* starting with matching cases.
*
* @param restrict <code>true</code> if proposals should be restricted
*/
public void restrictProposalsToMatchingCases(boolean restrict) {
fRestrictToMatchingCase= restrict;
}
private static boolean isWordPart(char ch) {
return Character.isJavaIdentifierPart(ch) || (ch == '#') || (ch == '.') || (ch == '/');
}
private static int findCharBeforeWord(IDocument doc, int lineBeginPos, int pos) {
int currPos= pos - 1;
|
12,676 |
Bug 12676 Code assist for type in javadoc does not show type itself
|
1. Open CU for X 2. add Javadoc for class X 3. enter @see 4. enter SPACE 5. open code assist ==> X not in list though X#... is allowed
|
resolved fixed
|
fafeb67
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T13:45:07Z | 2002-04-03T13:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionEvaluator.java
|
if (currPos > lineBeginPos) {
try {
while (currPos > lineBeginPos && isWordPart(doc.getChar(currPos))) {
currPos--;
}
return currPos;
} catch (BadLocationException e) {
}
}
return pos;
}
private static int findLastWhitespace(IDocument doc, int lineBeginPos, int pos) {
try {
int currPos= pos - 1;
while (currPos >= lineBeginPos && Character.isWhitespace(doc.getChar(currPos))) {
currPos--;
}
return currPos + 1;
} catch (BadLocationException e) {
}
return pos;
}
private static int findClosingCharacter(IDocument doc, int pos, int end, char endChar) throws BadLocationException {
int curr= pos;
while (curr < end && (doc.getChar(curr) != endChar)) {
curr++;
}
if (curr < end) {
|
12,676 |
Bug 12676 Code assist for type in javadoc does not show type itself
|
1. Open CU for X 2. add Javadoc for class X 3. enter @see 4. enter SPACE 5. open code assist ==> X not in list though X#... is allowed
|
resolved fixed
|
fafeb67
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T13:45:07Z | 2002-04-03T13:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionEvaluator.java
|
return curr + 1;
}
return pos;
}
private static int findReplaceEndPos(IDocument doc, String newText, String oldText, int pos) {
if (oldText.length() == 0 || oldText.equals(newText)) {
return pos;
}
try {
IRegion lineInfo= doc.getLineInformationOfOffset(pos);
int end= lineInfo.getOffset() + lineInfo.getLength();
if (newText.endsWith(">")) {
return findClosingCharacter(doc, pos, end, '>');
} else {
char ch= 0;
int pos1= pos;
while (pos1 < end && Character.isJavaIdentifierPart(ch= doc.getChar(pos1))) {
pos1++;
}
if (pos1 < end) {
if ((ch == '(') && newText.endsWith(")")) {
return findClosingCharacter(doc, pos1, end, ')');
}
}
|
12,676 |
Bug 12676 Code assist for type in javadoc does not show type itself
|
1. Open CU for X 2. add Javadoc for class X 3. enter @see 4. enter SPACE 5. open code assist ==> X not in list though X#... is allowed
|
resolved fixed
|
fafeb67
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T13:45:07Z | 2002-04-03T13:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionEvaluator.java
|
return pos1;
}
} catch (BadLocationException e) {
e.printStackTrace();
}
return pos;
}
public JavaCompletionProposal[] computeProposals() throws JavaModelException {
fLabelProvider= new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_POST_QUALIFIED | JavaElementLabelProvider.SHOW_PARAMETERS);
try {
evalProposals();
return (JavaCompletionProposal[]) fResult.toArray(new JavaCompletionProposal[fResult.size()]);
} finally {
fLabelProvider.dispose();
fResult.clear();
}
}
private void evalProposals() throws JavaModelException {
try {
IRegion info= fDocument.getLineInformationOfOffset(fCurrentPos);
int lineBeginPos= info.getOffset();
int word1Begin= findCharBeforeWord(fDocument, lineBeginPos, fCurrentPos);
if (word1Begin == fCurrentPos) {
return;
}
char firstChar= fDocument.getChar(word1Begin);
|
12,676 |
Bug 12676 Code assist for type in javadoc does not show type itself
|
1. Open CU for X 2. add Javadoc for class X 3. enter @see 4. enter SPACE 5. open code assist ==> X not in list though X#... is allowed
|
resolved fixed
|
fafeb67
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T13:45:07Z | 2002-04-03T13:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionEvaluator.java
|
if (firstChar == '@') {
String prefix= fDocument.get(word1Begin, fCurrentPos - word1Begin);
addProposals(prefix, fgTagProposals, JavaPluginImages.IMG_OBJS_JAVADOCTAG);
return;
} else if (firstChar == '<') {
String prefix= fDocument.get(word1Begin, fCurrentPos - word1Begin);
addProposals(prefix, fgHTMLProposals, JavaPluginImages.IMG_OBJS_HTMLTAG);
return;
} else if (!Character.isWhitespace(firstChar)) {
return;
}
String prefix= fDocument.get(word1Begin + 1, fCurrentPos - word1Begin - 1);
int word2End= findLastWhitespace(fDocument, lineBeginPos, word1Begin);
if (word2End != lineBeginPos) {
int word2Begin= findCharBeforeWord(fDocument, lineBeginPos, word2End);
if (fDocument.getChar(word2Begin) == '@') {
String tag= fDocument.get(word2Begin, word2End - word2Begin);
if (addArgumentProposals(tag, prefix)) {
return;
}
}
}
addAllTags(prefix);
} catch (BadLocationException e) {
}
}
|
12,676 |
Bug 12676 Code assist for type in javadoc does not show type itself
|
1. Open CU for X 2. add Javadoc for class X 3. enter @see 4. enter SPACE 5. open code assist ==> X not in list though X#... is allowed
|
resolved fixed
|
fafeb67
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T13:45:07Z | 2002-04-03T13:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionEvaluator.java
|
private boolean prefixMatches(String prefix, String proposal) {
if (fRestrictToMatchingCase) {
return proposal.startsWith(prefix);
} else if (proposal.length() >= prefix.length()) {
return prefix.equalsIgnoreCase(proposal.substring(0, prefix.length()));
}
return false;
}
private void addAllTags(String prefix) {
String jdocPrefix= "@" + prefix;
for (int i= 0; i < fgTagProposals.length; i++) {
String curr= fgTagProposals[i];
if (prefixMatches(jdocPrefix, curr)) {
fResult.add(createCompletion(curr, prefix, curr, JavaPluginImages.get(JavaPluginImages.IMG_OBJS_JAVADOCTAG), null));
}
}
String htmlPrefix= "<" + prefix;
for (int i= 0; i < fgHTMLProposals.length; i++) {
String curr= fgHTMLProposals[i];
if (prefixMatches(htmlPrefix, curr)) {
fResult.add(createCompletion(curr, prefix, curr, JavaPluginImages.get(JavaPluginImages.IMG_OBJS_HTMLTAG), null));
}
}
}
private void addProposals(String prefix, String[] choices, String imageName) {
|
12,676 |
Bug 12676 Code assist for type in javadoc does not show type itself
|
1. Open CU for X 2. add Javadoc for class X 3. enter @see 4. enter SPACE 5. open code assist ==> X not in list though X#... is allowed
|
resolved fixed
|
fafeb67
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T13:45:07Z | 2002-04-03T13:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionEvaluator.java
|
for (int i= 0; i < choices.length; i++) {
String curr= choices[i];
if (prefixMatches(prefix, curr)) {
fResult.add(createCompletion(curr, prefix, curr, JavaPluginImages.get(imageName), null));
}
}
}
private void addProposals(String prefix, IJavaElement[] choices) {
for (int i= 0; i < choices.length; i++) {
IJavaElement elem= choices[i];
String curr= getReplaceString(elem);
if (prefixMatches(prefix, curr)) {
ProposalInfo info= (elem instanceof IMember) ? new ProposalInfo((IMember) elem) : null;
fResult.add(createCompletion(curr, prefix, fLabelProvider.getText(elem), fLabelProvider.getImage(elem), info));
}
}
}
private String getReplaceString(IJavaElement elem) {
if (elem instanceof IMethod) {
IMethod meth= (IMethod)elem;
StringBuffer buf= new StringBuffer();
buf.append(meth.getElementName());
buf.append('(');
String[] types= meth.getParameterTypes();
int last= types.length - 1;
for (int i= 0; i <= last; i++) {
buf.append(Signature.toString(types[i]));
if (i != last) {
|
12,676 |
Bug 12676 Code assist for type in javadoc does not show type itself
|
1. Open CU for X 2. add Javadoc for class X 3. enter @see 4. enter SPACE 5. open code assist ==> X not in list though X#... is allowed
|
resolved fixed
|
fafeb67
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T13:45:07Z | 2002-04-03T13:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionEvaluator.java
|
buf.append(", ");
}
}
buf.append(')');
return buf.toString();
} else {
return elem.getElementName();
}
}
/**
* Returns true if case is handeled
*/
private boolean addArgumentProposals(String tag, String argument) throws JavaModelException {
if ("@see".equals(tag) || "@link".equals(tag)) {
evalSeeTag(argument);
return true;
} else if ("@param".equals(tag)) {
IJavaElement elem= fCompilationUnit.getElementAt(fCurrentPos);
if (elem instanceof IMethod) {
String[] names= ((IMethod)elem).getParameterNames();
addProposals(argument, names, JavaPluginImages.IMG_MISC_DEFAULT);
}
return true;
} else if ("@throws".equals(tag) || "@exception".equals(tag)) {
IJavaElement elem= fCompilationUnit.getElementAt(fCurrentPos);
if (elem instanceof IMethod) {
String[] exceptions= ((IMethod)elem).getExceptionTypes();
for (int i= 0; i < exceptions.length; i++) {
String curr= Signature.toString(exceptions[i]);
|
12,676 |
Bug 12676 Code assist for type in javadoc does not show type itself
|
1. Open CU for X 2. add Javadoc for class X 3. enter @see 4. enter SPACE 5. open code assist ==> X not in list though X#... is allowed
|
resolved fixed
|
fafeb67
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T13:45:07Z | 2002-04-03T13:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionEvaluator.java
|
if (prefixMatches(argument, curr)) {
fResult.add(createCompletion(curr, argument, curr, JavaPluginImages.get(JavaPluginImages.IMG_OBJS_CLASS), null));
}
}
}
return true;
} else if ("@serialData".equals(tag)) {
IJavaElement elem= fCompilationUnit.getElementAt(fCurrentPos);
if (elem instanceof IField) {
String name= ((IField)elem).getElementName();
fResult.add(createCompletion(name, argument, name, fLabelProvider.getImage(elem), null));
}
return true;
}
return false;
}
private void evalSeeTag(String arg) throws JavaModelException {
int wordStart= fCurrentPos - arg.length();
int pidx= arg.indexOf('#');
if (pidx == -1) {
evalTypeNameCompletions(wordStart);
} else {
IType parent= null;
if (pidx > 0) {
parent= getTypeNameResolve(wordStart, wordStart + pidx);
} else {
IJavaElement elem= fCompilationUnit.getElementAt(wordStart);
|
12,676 |
Bug 12676 Code assist for type in javadoc does not show type itself
|
1. Open CU for X 2. add Javadoc for class X 3. enter @see 4. enter SPACE 5. open code assist ==> X not in list though X#... is allowed
|
resolved fixed
|
fafeb67
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T13:45:07Z | 2002-04-03T13:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionEvaluator.java
|
if (elem != null) {
parent= (IType) elem.getAncestor(IJavaElement.TYPE);
}
}
if (parent != null) {
int nidx= arg.indexOf('(', pidx);
if (nidx == -1) {
nidx= arg.length();
}
String prefix= arg.substring(pidx + 1, nidx);
addProposals(prefix, parent.getMethods());
addProposals(prefix, parent.getFields());
}
}
}
private void evalTypeNameCompletions(int wordStart) throws JavaModelException {
ICompilationUnit preparedCU= createPreparedCU(wordStart, fCurrentPos);
if (preparedCU != null) {
CompletionRequestorAdapter requestor= new CompletionRequestorAdapter() {
public void acceptClass(char[] packageName, char[] className, char[] completionName, int modifiers, int start, int end, int severity) {
fResult.add(createSeeTypeCompletion(true, start, end, completionName, className, packageName));
}
public void acceptInterface(char[] packageName, char[] interfaceName, char[] completionName, int modifiers, int start, int end, int severity) {
fResult.add(createSeeTypeCompletion(false, start, end, completionName, interfaceName, packageName));
}
public void acceptType(char[] packageName, char[] typeName, char[] completionName, int start, int end, int severity) {
fResult.add(createSeeTypeCompletion(true, start, end, completionName, typeName, packageName));
|
12,676 |
Bug 12676 Code assist for type in javadoc does not show type itself
|
1. Open CU for X 2. add Javadoc for class X 3. enter @see 4. enter SPACE 5. open code assist ==> X not in list though X#... is allowed
|
resolved fixed
|
fafeb67
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T13:45:07Z | 2002-04-03T13:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionEvaluator.java
|
}
};
try {
preparedCU.codeComplete(fCurrentPos, requestor);
} finally {
preparedCU.destroy();
}
}
}
private IType getTypeNameResolve(int wordStart, int wordEnd) throws JavaModelException {
ICompilationUnit preparedCU= createPreparedCU(wordStart, wordEnd);
if (preparedCU != null) {
try {
IJavaElement[] elements= preparedCU.codeSelect(wordStart, wordEnd - wordStart);
if (elements != null && elements.length == 1 && elements[0] instanceof IType) {
return (IType) elements[0];
}
} finally {
preparedCU.getBuffer().setContents(fCompilationUnit.getBuffer().getCharacters());
preparedCU.destroy();
}
}
return null;
}
private ICompilationUnit createPreparedCU(int wordStart, int wordEnd) throws JavaModelException {
IJavaElement elem= fCompilationUnit.getElementAt(fCurrentPos);
if (!(elem instanceof ISourceReference)) {
return null;
|
12,676 |
Bug 12676 Code assist for type in javadoc does not show type itself
|
1. Open CU for X 2. add Javadoc for class X 3. enter @see 4. enter SPACE 5. open code assist ==> X not in list though X#... is allowed
|
resolved fixed
|
fafeb67
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T13:45:07Z | 2002-04-03T13:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionEvaluator.java
|
}
int startpos= ((ISourceReference)elem).getSourceRange().getOffset();
char[] content= (char[]) fCompilationUnit.getBuffer().getCharacters().clone();
if (elem instanceof IType && (((IType)elem).getDeclaringType() == null) && (wordStart + 6 < content.length)) {
content[startpos++]= 'i'; content[startpos++]= 'm'; content[startpos++]= 'p';
content[startpos++]= 'o'; content[startpos++]= 'r'; content[startpos++]= 't';
}
if (wordStart < content.length) {
for (int i= startpos; i < wordStart; i++) {
content[i]= ' ';
}
}
ICompilationUnit cu= fCompilationUnit;
if (cu.isWorkingCopy()) {
cu= (ICompilationUnit) cu.getOriginalElement();
}
/*
* Explicitly create a new working copy.
*/
ICompilationUnit newCU= (ICompilationUnit) cu.getWorkingCopy();
newCU.getBuffer().setContents(content);
return newCU;
}
private JavaCompletionProposal createCompletion(String newText, String oldText, String labelText, Image image, ProposalInfo proposalInfo) {
int offset= fCurrentPos - oldText.length();
int length= fCurrentLength + oldText.length();
if (fCurrentLength == 0)
length= findReplaceEndPos(fDocument, newText, oldText, fCurrentPos) - offset;
|
12,676 |
Bug 12676 Code assist for type in javadoc does not show type itself
|
1. Open CU for X 2. add Javadoc for class X 3. enter @see 4. enter SPACE 5. open code assist ==> X not in list though X#... is allowed
|
resolved fixed
|
fafeb67
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T13:45:07Z | 2002-04-03T13:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionEvaluator.java
|
JavaCompletionProposal proposal= new JavaCompletionProposal(newText, offset, length, image, labelText, 0);
proposal.setProposalInfo(proposalInfo);
proposal.setTriggerCharacters( new char[] { '#' });
return proposal;
}
private JavaCompletionProposal createSeeTypeCompletion(boolean isClass, int start, int end, char[] completion, char[] typeName, char[] containerName) {
ProposalInfo proposalInfo= new ProposalInfo(fCompilationUnit.getJavaProject(), containerName, typeName);
StringBuffer nameBuffer= new StringBuffer();
nameBuffer.append(typeName);
if (containerName != null) {
nameBuffer.append(" - ");
if (containerName.length > 0) {
nameBuffer.append(containerName);
} else {
nameBuffer.append(JavaDocMessages.getString("CompletionEvaluator.default_package"));
}
}
String imageKey= isClass ? JavaPluginImages.IMG_OBJS_CLASS : JavaPluginImages.IMG_OBJS_INTERFACE;
int compLen= completion.length;
if (compLen > 0 && completion[compLen - 1] == ';') {
compLen--;
}
JavaCompletionProposal proposal= new JavaCompletionProposal(new String(completion, 0, compLen), start, end - start, JavaPluginImages.get(imageKey), nameBuffer.toString(), 0);
proposal.setProposalInfo(proposalInfo);
proposal.setTriggerCharacters( new char[] { '#' });
return proposal;
}
}
|
13,196 |
Bug 13196 [Browsing] Consequences of changes
|
From the user's perspective, there is an unexpected behavioral difference when manipulation source in the type hierarchy and in the method list of the browser perspective. 1) open Java Browsing Perspective 2) select a type 3) select a method in the method list view 4) delete the method (context menu of the method list view) -> editor becomes dirty (ok) 5) select another type 6) open type hierarchy on this type, dock the hierachy view 7) select a method in the method list view 8) select the same method in the hierarchy view 9) delete the method (context menu of the hierarchy view) -> method is deleted on file system, type list view, method list view, editor are all cleared Note: This is not the case when the editor is dirty. Then both manipulations behave the same. Expected behavior: If there is an open editor, all manipulations should just work on the working copy shown in the editor.
|
resolved fixed
|
2f621a6
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T14:14:38Z | 2002-04-10T12:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.typehierarchy;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.ScrollBar;
import org.eclipse.swt.widgets.Table;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.viewers.DecoratingLabelProvider;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
|
13,196 |
Bug 13196 [Browsing] Consequences of changes
|
From the user's perspective, there is an unexpected behavioral difference when manipulation source in the type hierarchy and in the method list of the browser perspective. 1) open Java Browsing Perspective 2) select a type 3) select a method in the method list view 4) delete the method (context menu of the method list view) -> editor becomes dirty (ok) 5) select another type 6) open type hierarchy on this type, dock the hierachy view 7) select a method in the method list view 8) select the same method in the hierarchy view 9) delete the method (context menu of the hierarchy view) -> method is deleted on file system, type list view, method list view, editor are all cleared Note: This is not the case when the editor is dirty. Then both manipulations behave the same. Expected behavior: If there is an open editor, all manipulations should just work on the working copy shown in the editor.
|
resolved fixed
|
2f621a6
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T14:14:38Z | 2002-04-10T12:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
|
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.PlatformUI;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.IContextMenuConstants;
import org.eclipse.jdt.ui.JavaElementSorter;
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.ContextMenuGroup;
import org.eclipse.jdt.internal.ui.actions.GenerateGroup;
import org.eclipse.jdt.internal.ui.actions.OpenJavaElementAction;
import org.eclipse.jdt.internal.ui.search.JavaSearchGroup;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
import org.eclipse.jdt.internal.ui.util.JavaUIHelp;
import org.eclipse.jdt.internal.ui.util.SelectionUtil;
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabels;
import org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider;
import org.eclipse.jdt.internal.ui.viewsupport.MemberFilterActionGroup;
import org.eclipse.jdt.internal.ui.viewsupport.ProblemTableViewer;
import org.eclipse.jdt.internal.ui.viewsupport.StandardJavaUILabelProvider;
/**
* Method viewer shows a list of methods of a input type.
* Offers filter actions.
* No dependency to the type hierarchy view
*/
public class MethodsViewer extends ProblemTableViewer {
|
13,196 |
Bug 13196 [Browsing] Consequences of changes
|
From the user's perspective, there is an unexpected behavioral difference when manipulation source in the type hierarchy and in the method list of the browser perspective. 1) open Java Browsing Perspective 2) select a type 3) select a method in the method list view 4) delete the method (context menu of the method list view) -> editor becomes dirty (ok) 5) select another type 6) open type hierarchy on this type, dock the hierachy view 7) select a method in the method list view 8) select the same method in the hierarchy view 9) delete the method (context menu of the hierarchy view) -> method is deleted on file system, type list view, method list view, editor are all cleared Note: This is not the case when the editor is dirty. Then both manipulations behave the same. Expected behavior: If there is an open editor, all manipulations should just work on the working copy shown in the editor.
|
resolved fixed
|
2f621a6
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T14:14:38Z | 2002-04-10T12:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
|
private static final String TAG_SHOWINHERITED= "showinherited";
private static final String TAG_VERTICAL_SCROLL= "mv_vertical_scroll";
private static final int LABEL_BASEFLAGS= StandardJavaUILabelProvider.DEFAULT_TEXTFLAGS;
private MemberFilterActionGroup fMemberFilterActionGroup;
private JavaUILabelProvider fLabelProvider;
private OpenJavaElementAction fOpen;
private ShowInheritedMembersAction fShowInheritedMembersAction;
private ContextMenuGroup[] fStandardGroups;
|
13,196 |
Bug 13196 [Browsing] Consequences of changes
|
From the user's perspective, there is an unexpected behavioral difference when manipulation source in the type hierarchy and in the method list of the browser perspective. 1) open Java Browsing Perspective 2) select a type 3) select a method in the method list view 4) delete the method (context menu of the method list view) -> editor becomes dirty (ok) 5) select another type 6) open type hierarchy on this type, dock the hierachy view 7) select a method in the method list view 8) select the same method in the hierarchy view 9) delete the method (context menu of the hierarchy view) -> method is deleted on file system, type list view, method list view, editor are all cleared Note: This is not the case when the editor is dirty. Then both manipulations behave the same. Expected behavior: If there is an open editor, all manipulations should just work on the working copy shown in the editor.
|
resolved fixed
|
2f621a6
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T14:14:38Z | 2002-04-10T12:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
|
public MethodsViewer(Composite parent, TypeHierarchyLifeCycle lifeCycle, IWorkbenchPart part) {
super(new Table(parent, SWT.MULTI));
fLabelProvider= new StandardJavaUILabelProvider(
StandardJavaUILabelProvider.DEFAULT_TEXTFLAGS,
StandardJavaUILabelProvider.DEFAULT_IMAGEFLAGS,
StandardJavaUILabelProvider.getAdornmentProviders(true, new HierarchyAdornmentProvider(lifeCycle))
);
setLabelProvider(new DecoratingLabelProvider(fLabelProvider, PlatformUI.getWorkbench().getDecoratorManager()));
setContentProvider(new MethodsContentProvider(lifeCycle));
fOpen= new OpenJavaElementAction(this);
addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
fOpen.run();
}
});
fMemberFilterActionGroup= new MemberFilterActionGroup(this, "HierarchyMethodView");
fShowInheritedMembersAction= new ShowInheritedMembersAction(this, false);
showInheritedMethods(false);
fStandardGroups= new ContextMenuGroup[] {
new JavaSearchGroup(), new GenerateGroup()
};
|
13,196 |
Bug 13196 [Browsing] Consequences of changes
|
From the user's perspective, there is an unexpected behavioral difference when manipulation source in the type hierarchy and in the method list of the browser perspective. 1) open Java Browsing Perspective 2) select a type 3) select a method in the method list view 4) delete the method (context menu of the method list view) -> editor becomes dirty (ok) 5) select another type 6) open type hierarchy on this type, dock the hierachy view 7) select a method in the method list view 8) select the same method in the hierarchy view 9) delete the method (context menu of the hierarchy view) -> method is deleted on file system, type list view, method list view, editor are all cleared Note: This is not the case when the editor is dirty. Then both manipulations behave the same. Expected behavior: If there is an open editor, all manipulations should just work on the working copy shown in the editor.
|
resolved fixed
|
2f621a6
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T14:14:38Z | 2002-04-10T12:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
|
setSorter(new JavaElementSorter());
JavaUIHelp.setHelp(this, IJavaHelpContextIds.TYPE_HIERARCHY_VIEW);
}
/**
* Show inherited methods
*/
public void showInheritedMethods(boolean on) {
MethodsContentProvider cprovider= (MethodsContentProvider) getContentProvider();
try {
getTable().setRedraw(false);
cprovider.showInheritedMethods(on);
fShowInheritedMembersAction.setChecked(on);
if (fLabelProvider != null) {
if (on) {
fLabelProvider.setTextFlags(fLabelProvider.getTextFlags() | JavaElementLabels.ALL_POST_QUALIFIED);
} else {
fLabelProvider.setTextFlags(fLabelProvider.getTextFlags() & (-1 ^ JavaElementLabels.ALL_POST_QUALIFIED));
}
refresh();
}
} catch (JavaModelException e) {
ExceptionHandler.handle(e, getControl().getShell(), TypeHierarchyMessages.getString("MethodsViewer.toggle.error.title"), TypeHierarchyMessages.getString("MethodsViewer.toggle.error.message"));
} finally {
getTable().setRedraw(true);
}
}
/*
|
13,196 |
Bug 13196 [Browsing] Consequences of changes
|
From the user's perspective, there is an unexpected behavioral difference when manipulation source in the type hierarchy and in the method list of the browser perspective. 1) open Java Browsing Perspective 2) select a type 3) select a method in the method list view 4) delete the method (context menu of the method list view) -> editor becomes dirty (ok) 5) select another type 6) open type hierarchy on this type, dock the hierachy view 7) select a method in the method list view 8) select the same method in the hierarchy view 9) delete the method (context menu of the hierarchy view) -> method is deleted on file system, type list view, method list view, editor are all cleared Note: This is not the case when the editor is dirty. Then both manipulations behave the same. Expected behavior: If there is an open editor, all manipulations should just work on the working copy shown in the editor.
|
resolved fixed
|
2f621a6
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T14:14:38Z | 2002-04-10T12:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
|
* @see Viewer#inputChanged(Object, Object)
*/
protected void inputChanged(Object input, Object oldInput) {
super.inputChanged(input, oldInput);
}
/**
* Returns <code>true</code> if inherited methods are shown.
*/
public boolean isShowInheritedMethods() {
return ((MethodsContentProvider) getContentProvider()).isShowInheritedMethods();
}
/**
* Saves the state of the filter actions
*/
public void saveState(IMemento memento) {
fMemberFilterActionGroup.saveState(memento);
memento.putString(TAG_SHOWINHERITED, String.valueOf(isShowInheritedMethods()));
ScrollBar bar= getTable().getVerticalBar();
int position= bar != null ? bar.getSelection() : 0;
memento.putString(TAG_VERTICAL_SCROLL, String.valueOf(position));
}
/**
* Restores the state of the filter actions
*/
public void restoreState(IMemento memento) {
fMemberFilterActionGroup.restoreState(memento);
boolean set= Boolean.valueOf(memento.getString(TAG_SHOWINHERITED)).booleanValue();
|
13,196 |
Bug 13196 [Browsing] Consequences of changes
|
From the user's perspective, there is an unexpected behavioral difference when manipulation source in the type hierarchy and in the method list of the browser perspective. 1) open Java Browsing Perspective 2) select a type 3) select a method in the method list view 4) delete the method (context menu of the method list view) -> editor becomes dirty (ok) 5) select another type 6) open type hierarchy on this type, dock the hierachy view 7) select a method in the method list view 8) select the same method in the hierarchy view 9) delete the method (context menu of the hierarchy view) -> method is deleted on file system, type list view, method list view, editor are all cleared Note: This is not the case when the editor is dirty. Then both manipulations behave the same. Expected behavior: If there is an open editor, all manipulations should just work on the working copy shown in the editor.
|
resolved fixed
|
2f621a6
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T14:14:38Z | 2002-04-10T12:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
|
showInheritedMethods(set);
ScrollBar bar= getTable().getVerticalBar();
if (bar != null) {
Integer vScroll= memento.getInteger(TAG_VERTICAL_SCROLL);
if (vScroll != null) {
bar.setSelection(vScroll.intValue());
}
}
}
/**
* Attaches a contextmenu listener to the table
*/
public void initContextMenu(IMenuListener menuListener, String popupId, IWorkbenchPartSite viewSite) {
MenuManager menuMgr= new MenuManager();
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(menuListener);
Menu menu= menuMgr.createContextMenu(getTable());
getTable().setMenu(menu);
viewSite.registerContextMenu(popupId, menuMgr, this);
}
/**
* Fills up the context menu with items for the method viewer
* Should be called by the creator of the context menu
*/
public void contributeToContextMenu(IMenuManager menu) {
if (fOpen.canActionBeAdded()) {
|
13,196 |
Bug 13196 [Browsing] Consequences of changes
|
From the user's perspective, there is an unexpected behavioral difference when manipulation source in the type hierarchy and in the method list of the browser perspective. 1) open Java Browsing Perspective 2) select a type 3) select a method in the method list view 4) delete the method (context menu of the method list view) -> editor becomes dirty (ok) 5) select another type 6) open type hierarchy on this type, dock the hierachy view 7) select a method in the method list view 8) select the same method in the hierarchy view 9) delete the method (context menu of the hierarchy view) -> method is deleted on file system, type list view, method list view, editor are all cleared Note: This is not the case when the editor is dirty. Then both manipulations behave the same. Expected behavior: If there is an open editor, all manipulations should just work on the working copy shown in the editor.
|
resolved fixed
|
2f621a6
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T14:14:38Z | 2002-04-10T12:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
|
menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, fOpen);
}
ContextMenuGroup.add(menu, fStandardGroups, this);
}
/**
* Fills up the tool bar with items for the method viewer
* Should be called by the creator of the tool bar
*/
public void contributeToToolBar(ToolBarManager tbm) {
tbm.add(fShowInheritedMembersAction);
tbm.add(new Separator());
fMemberFilterActionGroup.contributeToToolBar(tbm);
}
/*
* @see StructuredViewer#handleInvalidSelection(ISelection, ISelection)
*/
protected void handleInvalidSelection(ISelection invalidSelection, ISelection newSelection) {
List oldSelections= SelectionUtil.toList(invalidSelection);
List newSelections= SelectionUtil.toList(newSelection);
if (!oldSelections.isEmpty()) {
ArrayList newSelectionElements= new ArrayList(newSelections);
try {
Object[] currElements= getFilteredChildren(getInput());
for (int i= 0; i < oldSelections.size(); i++) {
Object curr= oldSelections.get(i);
if (curr instanceof IMethod && !newSelections.contains(curr)) {
IMethod method= (IMethod) curr;
if (method.exists()) {
|
13,196 |
Bug 13196 [Browsing] Consequences of changes
|
From the user's perspective, there is an unexpected behavioral difference when manipulation source in the type hierarchy and in the method list of the browser perspective. 1) open Java Browsing Perspective 2) select a type 3) select a method in the method list view 4) delete the method (context menu of the method list view) -> editor becomes dirty (ok) 5) select another type 6) open type hierarchy on this type, dock the hierachy view 7) select a method in the method list view 8) select the same method in the hierarchy view 9) delete the method (context menu of the hierarchy view) -> method is deleted on file system, type list view, method list view, editor are all cleared Note: This is not the case when the editor is dirty. Then both manipulations behave the same. Expected behavior: If there is an open editor, all manipulations should just work on the working copy shown in the editor.
|
resolved fixed
|
2f621a6
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T14:14:38Z | 2002-04-10T12:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java
|
IMethod similar= findSimilarMethod(method, currElements);
if (similar != null) {
newSelectionElements.add(similar);
}
}
}
}
newSelection= new StructuredSelection(newSelectionElements);
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
}
setSelection(newSelection);
updateSelection(newSelection);
}
private IMethod findSimilarMethod(IMethod meth, Object[] elements) throws JavaModelException {
String name= meth.getElementName();
String[] paramTypes= meth.getParameterTypes();
boolean isConstructor= meth.isConstructor();
for (int i= 0; i < elements.length; i++) {
Object curr= elements[i];
if (curr instanceof IMethod && JavaModelUtil.isSameMethodSignature(name, paramTypes, isConstructor, (IMethod) curr)) {
return (IMethod) curr;
}
}
return null;
}
}
|
9,891 |
Bug 9891 'show in packages view' - surprising behavior
|
in the editor, when there's no selection or the selection cannot be resolved - 'show in packages view' finds the cu in the packages view. when the selection resolves to sth - it shows the cu that declares the thing the selection resolves to. this is highly surprising - i do not pay any attention to the current selection when using this useful action. these 2 things are really 2 different action - that's how i see it.
|
resolved fixed
|
971fa6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T16:09:38Z | 2002-02-15T10:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ShowInPackageViewAction.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
******************************************************************************/
|
9,891 |
Bug 9891 'show in packages view' - surprising behavior
|
in the editor, when there's no selection or the selection cannot be resolved - 'show in packages view' finds the cu in the packages view. when the selection resolves to sth - it shows the cu that declares the thing the selection resolves to. this is highly surprising - i do not pay any attention to the current selection when using this useful action. these 2 things are really 2 different action - that's how i see it.
|
resolved fixed
|
971fa6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T16:09:38Z | 2002-02-15T10:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ShowInPackageViewAction.java
|
package org.eclipse.jdt.ui.actions;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.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;
import org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart;
/**
* This action reveals the currently selected Java element in the packages
* view. The Java element can be represeented 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 ShowInPackageViewAction extends SelectionDispatchAction {
|
9,891 |
Bug 9891 'show in packages view' - surprising behavior
|
in the editor, when there's no selection or the selection cannot be resolved - 'show in packages view' finds the cu in the packages view. when the selection resolves to sth - it shows the cu that declares the thing the selection resolves to. this is highly surprising - i do not pay any attention to the current selection when using this useful action. these 2 things are really 2 different action - that's how i see it.
|
resolved fixed
|
971fa6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T16:09:38Z | 2002-02-15T10:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ShowInPackageViewAction.java
|
private JavaEditor fEditor;
/**
* Creates a new <code>ShowInPackageViewAction</code>.
*
* @param site the site providing context information for this action
*/
public ShowInPackageViewAction(UnifiedSite site) {
super(site);
setText(ActionMessages.getString("ShowInPackageViewAction.label"));
setDescription(ActionMessages.getString("ShowInPackageViewAction.description"));
setToolTipText(ActionMessages.getString("ShowInPackageViewAction.tooltip"));
WorkbenchHelp.setHelp(this, IJavaHelpContextIds.SHOW_IN_PACKAGEVIEW_ACTION);
}
/**
* Creates a new <code>ShowInPackageViewAction</code>.
* <p>
* Note: This constructor is for internal use only. Clients should not call this constructor.
* </p>
*/
public ShowInPackageViewAction(JavaEditor editor) {
this(UnifiedSite.create(editor.getEditorSite()));
fEditor= editor;
}
|
9,891 |
Bug 9891 'show in packages view' - surprising behavior
|
in the editor, when there's no selection or the selection cannot be resolved - 'show in packages view' finds the cu in the packages view. when the selection resolves to sth - it shows the cu that declares the thing the selection resolves to. this is highly surprising - i do not pay any attention to the current selection when using this useful action. these 2 things are really 2 different action - that's how i see it.
|
resolved fixed
|
971fa6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T16:09:38Z | 2002-02-15T10:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ShowInPackageViewAction.java
|
/* (non-Javadoc)
* Method declared on SelectionDispatchAction.
*/
protected void selectionChanged(ITextSelection selection) {
setEnabled(fEditor != null);
}
/* (non-Javadoc)
* Method declared on SelectionDispatchAction.
*/
protected void selectionChanged(IStructuredSelection selection) {
setEnabled(checkEnabled(selection));
}
private boolean checkEnabled(IStructuredSelection selection) {
if (selection.size() != 1)
return false;
return selection.getFirstElement() instanceof IJavaElement;
}
/* (non-Javadoc)
* Method declared on SelectionDispatchAction.
*/
protected void run(ITextSelection selection) {
IJavaElement element= SelectionConverter.codeResolveOrInputHandled(fEditor, getShell(), getDialogTitle(), ActionMessages.getString("ShowInPackageViewAction.select_name"));
if (element != null)
run(element);
}
/* (non-Javadoc)
* Method declared on SelectionDispatchAction.
|
9,891 |
Bug 9891 'show in packages view' - surprising behavior
|
in the editor, when there's no selection or the selection cannot be resolved - 'show in packages view' finds the cu in the packages view. when the selection resolves to sth - it shows the cu that declares the thing the selection resolves to. this is highly surprising - i do not pay any attention to the current selection when using this useful action. these 2 things are really 2 different action - that's how i see it.
|
resolved fixed
|
971fa6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-22T16:09:38Z | 2002-02-15T10:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ShowInPackageViewAction.java
|
*/
protected void run(IStructuredSelection selection) {
if (!checkEnabled(selection))
return;
run((IJavaElement)selection.getFirstElement());
}
private void run(IJavaElement element) {
if (element == null)
return;
try {
element= OpenActionUtil.getElementToOpen(element);
if (element == null)
return;
PackageExplorerPart view= PackageExplorerPart.openInActivePerspective();
if (view != null) {
view.selectReveal(new StructuredSelection(element));
return;
}
} catch (JavaModelException e) {
JavaPlugin.log(e);
String message= ActionMessages.getString("ShowInPackageViewAction.error.message");
ErrorDialog.openError(getShell(), getDialogTitle(), message, e.getStatus());
}
}
private static String getDialogTitle() {
return ActionMessages.getString("ShowInPackageViewAction.dialog.title");
}
}
|
14,228 |
Bug 14228 Too easy to create duplicate methods
|
Build 20020418 - I was browsing some source (not even actively editing). - Suddenly I noticed there was a squiggle on one of the constructors. - Hover told me that there were two methods (sp) with the same name. - Scrolled down to see that, in fact, I did have another copy of the constructor. Strange. How did this ever compile? - It turns out I must have inadvertently dragged the constructor a little bit in the Outline. - With the new DnD support in the Outline, it is far too easy to create duplicates.
|
resolved fixed
|
7db8bed
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T13:43:23Z | 2002-04-19T15:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/SelectionTransferDropAdapter.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.packageview;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DropTargetEvent;
|
14,228 |
Bug 14228 Too easy to create duplicate methods
|
Build 20020418 - I was browsing some source (not even actively editing). - Suddenly I noticed there was a squiggle on one of the constructors. - Hover told me that there were two methods (sp) with the same name. - Scrolled down to see that, in fact, I did have another copy of the constructor. Strange. How did this ever compile? - It turns out I must have inadvertently dragged the constructor a little bit in the Outline. - With the new DnD support in the Outline, it is far too easy to create duplicates.
|
resolved fixed
|
7db8bed
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T13:43:23Z | 2002-04-19T15:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/SelectionTransferDropAdapter.java
|
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.ISourceReference;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.actions.SelectionDispatchAction;
import org.eclipse.jdt.internal.corext.refactoring.Assert;
import org.eclipse.jdt.internal.corext.refactoring.reorg.CopyRefactoring;
import org.eclipse.jdt.internal.corext.refactoring.reorg.MoveRefactoring;
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgRefactoring;
import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.dnd.JdtViewerDropAdapter;
import org.eclipse.jdt.internal.ui.dnd.LocalSelectionTransfer;
import org.eclipse.jdt.internal.ui.dnd.TransferDropTargetListener;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
import org.eclipse.jdt.internal.ui.reorg.DeleteSourceReferencesAction;
import org.eclipse.jdt.internal.ui.reorg.MockUnifiedSite;
import org.eclipse.jdt.internal.ui.reorg.JdtMoveAction;
import org.eclipse.jdt.internal.ui.reorg.ReorgActionFactory;
import org.eclipse.jdt.internal.ui.reorg.SimpleSelectionProvider;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
public class SelectionTransferDropAdapter extends JdtViewerDropAdapter implements TransferDropTargetListener {
|
14,228 |
Bug 14228 Too easy to create duplicate methods
|
Build 20020418 - I was browsing some source (not even actively editing). - Suddenly I noticed there was a squiggle on one of the constructors. - Hover told me that there were two methods (sp) with the same name. - Scrolled down to see that, in fact, I did have another copy of the constructor. Strange. How did this ever compile? - It turns out I must have inadvertently dragged the constructor a little bit in the Outline. - With the new DnD support in the Outline, it is far too easy to create duplicates.
|
resolved fixed
|
7db8bed
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T13:43:23Z | 2002-04-19T15:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/SelectionTransferDropAdapter.java
|
private List fElements;
private MoveRefactoring fMoveRefactoring;
private int fCanMoveElements;
private CopyRefactoring fCopyRefactoring;
private int fCanCopyElements;
public SelectionTransferDropAdapter(StructuredViewer viewer) {
super(viewer, DND.FEEDBACK_SCROLL | DND.FEEDBACK_EXPAND);
}
public Transfer getTransfer() {
return LocalSelectionTransfer.getInstance();
}
public void dragEnter(DropTargetEvent event) {
clear();
super.dragEnter(event);
}
public void dragLeave(DropTargetEvent event) {
clear();
|
14,228 |
Bug 14228 Too easy to create duplicate methods
|
Build 20020418 - I was browsing some source (not even actively editing). - Suddenly I noticed there was a squiggle on one of the constructors. - Hover told me that there were two methods (sp) with the same name. - Scrolled down to see that, in fact, I did have another copy of the constructor. Strange. How did this ever compile? - It turns out I must have inadvertently dragged the constructor a little bit in the Outline. - With the new DnD support in the Outline, it is far too easy to create duplicates.
|
resolved fixed
|
7db8bed
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T13:43:23Z | 2002-04-19T15:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/SelectionTransferDropAdapter.java
|
super.dragLeave(event);
}
private void clear() {
fElements= null;
fMoveRefactoring= null;
fCanMoveElements= 0;
fCopyRefactoring= null;
fCanCopyElements= 0;
}
public void validateDrop(Object target, DropTargetEvent event, int operation) {
event.detail= DND.DROP_NONE;
if (fElements == null) {
ISelection s= LocalSelectionTransfer.getInstance().getSelection();
if (!(s instanceof IStructuredSelection))
return;
fElements= ((IStructuredSelection)s).toList();
}
try {
if (operation == DND.DROP_COPY) {
event.detail= handleValidateCopy(target, event);
} else if (operation == DND.DROP_MOVE) {
event.detail= handleValidateMove(target, event);
}
} catch (JavaModelException e){
ExceptionHandler.handle(e, PackagesMessages.getString("SelectionTransferDropAdapter.error.title"), PackagesMessages.getString("SelectionTransferDropAdapter.error.message"));
event.detail= DND.DROP_NONE;
}
}
|
14,228 |
Bug 14228 Too easy to create duplicate methods
|
Build 20020418 - I was browsing some source (not even actively editing). - Suddenly I noticed there was a squiggle on one of the constructors. - Hover told me that there were two methods (sp) with the same name. - Scrolled down to see that, in fact, I did have another copy of the constructor. Strange. How did this ever compile? - It turns out I must have inadvertently dragged the constructor a little bit in the Outline. - With the new DnD support in the Outline, it is far too easy to create duplicates.
|
resolved fixed
|
7db8bed
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T13:43:23Z | 2002-04-19T15:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/SelectionTransferDropAdapter.java
|
public void drop(Object target, DropTargetEvent event) {
try{
if (event.detail == DND.DROP_MOVE) {
handleDropMove(target, event);
if (! canPasteSourceReferences(target, event))
return;
DeleteSourceReferencesAction delete= ReorgActionFactory.createDeleteSourceReferencesAction(getDragableSourceReferences());
delete.setAskForDeleteConfirmation(false);
delete.setCanDeleteGetterSetter(false);
delete.update();
if (delete.isEnabled())
delete.run();
} else if (event.detail == DND.DROP_COPY) {
handleDropCopy(target, event);
}
} catch (JavaModelException e){
ExceptionHandler.handle(e, PackagesMessages.getString("SelectionTransferDropAdapter.error.title"), PackagesMessages.getString("SelectionTransferDropAdapter.error.message"));
} finally{
event.detail= DND.DROP_NONE;
}
}
private int handleValidateMove(Object target, DropTargetEvent event) throws JavaModelException{
if (target == null)
|
14,228 |
Bug 14228 Too easy to create duplicate methods
|
Build 20020418 - I was browsing some source (not even actively editing). - Suddenly I noticed there was a squiggle on one of the constructors. - Hover told me that there were two methods (sp) with the same name. - Scrolled down to see that, in fact, I did have another copy of the constructor. Strange. How did this ever compile? - It turns out I must have inadvertently dragged the constructor a little bit in the Outline. - With the new DnD support in the Outline, it is far too easy to create duplicates.
|
resolved fixed
|
7db8bed
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T13:43:23Z | 2002-04-19T15:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/SelectionTransferDropAdapter.java
|
return DND.DROP_NONE;
if (canPasteSourceReferences(target, event))
return DND.DROP_COPY;
if (fMoveRefactoring == null){
fMoveRefactoring= new MoveRefactoring(fElements, JavaPreferencesSettings.getCodeGenerationSettings());
}
if (!canMoveElements())
return DND.DROP_NONE;
if (fMoveRefactoring.isValidDestination(target))
return DND.DROP_MOVE;
else
return DND.DROP_NONE;
}
private boolean canMoveElements() {
if (fCanMoveElements == 0) {
fCanMoveElements= 2;
if (! canActivate(fMoveRefactoring))
fCanMoveElements= 1;
}
return fCanMoveElements == 2;
}
private boolean canActivate(ReorgRefactoring ref){
try{
return ref.checkActivation(new NullProgressMonitor()).isOK();
|
14,228 |
Bug 14228 Too easy to create duplicate methods
|
Build 20020418 - I was browsing some source (not even actively editing). - Suddenly I noticed there was a squiggle on one of the constructors. - Hover told me that there were two methods (sp) with the same name. - Scrolled down to see that, in fact, I did have another copy of the constructor. Strange. How did this ever compile? - It turns out I must have inadvertently dragged the constructor a little bit in the Outline. - With the new DnD support in the Outline, it is far too easy to create duplicates.
|
resolved fixed
|
7db8bed
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T13:43:23Z | 2002-04-19T15:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/SelectionTransferDropAdapter.java
|
} catch(JavaModelException e){
ExceptionHandler.handle(e, PackagesMessages.getString("SelectionTransferDropAdapter.error.title"), PackagesMessages.getString("SelectionTransferDropAdapter.error.message"));
return false;
}
}
private void handleDropMove(final Object target, DropTargetEvent event) throws JavaModelException{
if (canPasteSourceReferences(target, event)){
pasteSourceReferences(target, event);
return;
}
new DragNDropMoveAction(new SimpleSelectionProvider(fElements), target).run();
}
private void pasteSourceReferences(final Object target, DropTargetEvent event) {
SelectionDispatchAction pasteAction= ReorgActionFactory.createPasteAction(getDragableSourceReferences(), target);
pasteAction.update();
if (!pasteAction.isEnabled()){
event.detail= DND.DROP_NONE;
return;
}
pasteAction.run();
return;
}
private int handleValidateCopy(Object target, DropTargetEvent event) throws JavaModelException{
if (canPasteSourceReferences(target, event))
return DND.DROP_COPY;
if (fCopyRefactoring == null)
|
14,228 |
Bug 14228 Too easy to create duplicate methods
|
Build 20020418 - I was browsing some source (not even actively editing). - Suddenly I noticed there was a squiggle on one of the constructors. - Hover told me that there were two methods (sp) with the same name. - Scrolled down to see that, in fact, I did have another copy of the constructor. Strange. How did this ever compile? - It turns out I must have inadvertently dragged the constructor a little bit in the Outline. - With the new DnD support in the Outline, it is far too easy to create duplicates.
|
resolved fixed
|
7db8bed
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T13:43:23Z | 2002-04-19T15:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/SelectionTransferDropAdapter.java
|
fCopyRefactoring= new CopyRefactoring(fElements);
if (!canCopyElements())
return DND.DROP_NONE;
if (fCopyRefactoring.isValidDestination(target))
return DND.DROP_COPY;
else
return DND.DROP_NONE;
}
private boolean canPasteSourceReferences(Object target, DropTargetEvent event) throws JavaModelException{
ISourceReference[] elements= getDragableSourceReferences();
if (elements.length != fElements.size())
return false;
SelectionDispatchAction pasteAction= ReorgActionFactory.createPasteAction(elements, target);
pasteAction.update();
return pasteAction.isEnabled();
}
private ISourceReference[] getDragableSourceReferences(){
List result= new ArrayList(fElements.size());
for(Iterator iter= fElements.iterator(); iter.hasNext();){
Object each= iter.next();
if (isDragableSourceReferences(each))
result.add(each);
}
return (ISourceReference[])result.toArray(new ISourceReference[result.size()]);
}
private static boolean isDragableSourceReferences(Object element) {
if (!(element instanceof ISourceReference))
|
14,228 |
Bug 14228 Too easy to create duplicate methods
|
Build 20020418 - I was browsing some source (not even actively editing). - Suddenly I noticed there was a squiggle on one of the constructors. - Hover told me that there were two methods (sp) with the same name. - Scrolled down to see that, in fact, I did have another copy of the constructor. Strange. How did this ever compile? - It turns out I must have inadvertently dragged the constructor a little bit in the Outline. - With the new DnD support in the Outline, it is far too easy to create duplicates.
|
resolved fixed
|
7db8bed
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T13:43:23Z | 2002-04-19T15:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/SelectionTransferDropAdapter.java
|
return false;
if (!(element instanceof IJavaElement))
return false;
if (element instanceof ICompilationUnit)
return false;
return true;
}
private boolean canCopyElements() {
if (fCanCopyElements == 0) {
fCanCopyElements= 2;
if (!canActivate(fCopyRefactoring))
fCanCopyElements= 1;
}
return fCanCopyElements == 2;
}
private void handleDropCopy(final Object target, DropTargetEvent event) throws JavaModelException{
if (canPasteSourceReferences(target, event)){
pasteSourceReferences(target, event);
return;
}
SelectionDispatchAction action= ReorgActionFactory.createDnDCopyAction(fElements, ResourceUtil.getResource(target));
action.run();
}
private static class DragNDropMoveAction extends JdtMoveAction{
|
14,228 |
Bug 14228 Too easy to create duplicate methods
|
Build 20020418 - I was browsing some source (not even actively editing). - Suddenly I noticed there was a squiggle on one of the constructors. - Hover told me that there were two methods (sp) with the same name. - Scrolled down to see that, in fact, I did have another copy of the constructor. Strange. How did this ever compile? - It turns out I must have inadvertently dragged the constructor a little bit in the Outline. - With the new DnD support in the Outline, it is far too easy to create duplicates.
|
resolved fixed
|
7db8bed
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T13:43:23Z | 2002-04-19T15:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/SelectionTransferDropAdapter.java
|
private Object fTarget;
private static final int PREVIEW_ID= IDialogConstants.CLIENT_ID + 1;
public DragNDropMoveAction(ISelectionProvider provider, Object target){
super(new MockUnifiedSite(provider));
Assert.isNotNull(target);
fTarget= target;
}
protected Object selectDestination(ReorgRefactoring ref) {
return fTarget;
}
|
14,228 |
Bug 14228 Too easy to create duplicate methods
|
Build 20020418 - I was browsing some source (not even actively editing). - Suddenly I noticed there was a squiggle on one of the constructors. - Hover told me that there were two methods (sp) with the same name. - Scrolled down to see that, in fact, I did have another copy of the constructor. Strange. How did this ever compile? - It turns out I must have inadvertently dragged the constructor a little bit in the Outline. - With the new DnD support in the Outline, it is far too easy to create duplicates.
|
resolved fixed
|
7db8bed
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T13:43:23Z | 2002-04-19T15:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/SelectionTransferDropAdapter.java
|
protected boolean isOkToProceed(ReorgRefactoring refactoring) throws JavaModelException{
if (!super.isOkToProceed(refactoring))
return false;
return askIfUpdateReferences((MoveRefactoring)refactoring);
}
private boolean askIfUpdateReferences(MoveRefactoring ref) throws JavaModelException{
if (! ref.canUpdateReferences()){
setShowPreview(false);
return true;
}
switch (askIfUpdateReferences()){
case IDialogConstants.CANCEL_ID:
setShowPreview(false);
return false;
case IDialogConstants.NO_ID:
ref.setUpdateReferences(false);
setShowPreview(false);
return true;
case IDialogConstants.YES_ID:
ref.setUpdateReferences(true);
setShowPreview(false);
return true;
case PREVIEW_ID:
ref.setUpdateReferences(true);
setShowPreview(true);
return true;
default:
|
14,228 |
Bug 14228 Too easy to create duplicate methods
|
Build 20020418 - I was browsing some source (not even actively editing). - Suddenly I noticed there was a squiggle on one of the constructors. - Hover told me that there were two methods (sp) with the same name. - Scrolled down to see that, in fact, I did have another copy of the constructor. Strange. How did this ever compile? - It turns out I must have inadvertently dragged the constructor a little bit in the Outline. - With the new DnD support in the Outline, it is far too easy to create duplicates.
|
resolved fixed
|
7db8bed
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T13:43:23Z | 2002-04-19T15:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/SelectionTransferDropAdapter.java
|
Assert.isTrue(false);
return false;
}
}
private static int askIfUpdateReferences(){
Shell shell= JavaPlugin.getActiveWorkbenchShell().getShell();
String title= PackagesMessages.getString("SelectionTransferDropAdapter.dialog.title");
String preview= PackagesMessages.getString("SelectionTransferDropAdapter.dialog.preview.label");
String question= PackagesMessages.getString("SelectionTransferDropAdapter.dialog.question");
String[] labels= new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL,
preview, IDialogConstants.CANCEL_LABEL };
final MessageDialog dialog = new MessageDialog(shell, title, null, question, MessageDialog.QUESTION, labels, 2);
shell.getDisplay().syncExec(new Runnable() {
public void run() {
dialog.open();
}
});
int result = dialog.getReturnCode();
if (result == 0)
return IDialogConstants.YES_ID;
if (result == 1)
return IDialogConstants.NO_ID;
if (result == 2)
return PREVIEW_ID;
return IDialogConstants.CANCEL_ID;
}
}
}
|
14,390 |
Bug 14390 npe on sorting in outline
|
20020418+ (20020418.2) java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.initializeHighlightColor (LinkedPositionUI.java:109) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.propertyChange (LinkedPositionUI.java:100) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:247) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:188) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:563) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:457) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.valu eChanged(JavaOutlinePage.java:569) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.run (JavaOutlinePage.java:558) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) 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:195) at org.eclipse.core.launcher.Main.run(Main.java:541) at org.eclipse.core.launcher.Main.main(Main.java:396)
|
resolved fixed
|
6663ac0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T14:25:04Z | 2002-04-23T11:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.text.link;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.custom.VerifyKeyListener;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
|
14,390 |
Bug 14390 npe on sorting in outline
|
20020418+ (20020418.2) java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.initializeHighlightColor (LinkedPositionUI.java:109) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.propertyChange (LinkedPositionUI.java:100) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:247) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:188) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:563) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:457) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.valu eChanged(JavaOutlinePage.java:569) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.run (JavaOutlinePage.java:558) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) 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:195) at org.eclipse.core.launcher.Main.run(Main.java:541) at org.eclipse.core.launcher.Main.main(Main.java:396)
|
resolved fixed
|
6663ac0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T14:25:04Z | 2002-04-23T11:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.BadPositionCategoryException;
import org.eclipse.jface.text.DefaultPositionUpdater;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IPositionUpdater;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextInputListener;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.ITextViewerExtension;
import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
/**
* A user interface for <code>LinkedPositionManager</code>, using <code>ITextViewer</code>.
*/
public class LinkedPositionUI implements LinkedPositionListener,
ITextInputListener, ModifyListener, VerifyListener, VerifyKeyListener, PaintListener, IPropertyChangeListener {
/**
* A listener for notification when the user cancelled the edit operation.
*/
public interface ExitListener {
|
14,390 |
Bug 14390 npe on sorting in outline
|
20020418+ (20020418.2) java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.initializeHighlightColor (LinkedPositionUI.java:109) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.propertyChange (LinkedPositionUI.java:100) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:247) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:188) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:563) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:457) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.valu eChanged(JavaOutlinePage.java:569) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.run (JavaOutlinePage.java:558) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) 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:195) at org.eclipse.core.launcher.Main.run(Main.java:541) at org.eclipse.core.launcher.Main.main(Main.java:396)
|
resolved fixed
|
6663ac0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T14:25:04Z | 2002-04-23T11:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
void exit(boolean accept);
}
private static final int UNINSTALL= 1;
private static final int COMMIT= 2;
private static final int DOCUMENT_CHANGED= 4;
private static final int UPDATE_CARET= 8;
private static final String CARET_POSITION= "LinkedPositionUI.caret.position";
private static final IPositionUpdater fgUpdater= new DefaultPositionUpdater(CARET_POSITION);
private static final IPreferenceStore fgStore= JavaPlugin.getDefault().getPreferenceStore();
private final ITextViewer fViewer;
private final LinkedPositionManager fManager;
private Color fFrameColor;
private int fFinalCaretOffset= -1;
private Position fFramePosition;
private int fCaretOffset;
private ExitListener fExitListener;
/**
* Creates a user interface for <code>LinkedPositionManager</code>.
*
* @param viewer the text viewer.
* @param manager the <code>LinkedPositionManager</code> managing a <code>IDocument</code> of the <code>ITextViewer</code>.
*/
public LinkedPositionUI(ITextViewer viewer, LinkedPositionManager manager) {
|
14,390 |
Bug 14390 npe on sorting in outline
|
20020418+ (20020418.2) java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.initializeHighlightColor (LinkedPositionUI.java:109) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.propertyChange (LinkedPositionUI.java:100) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:247) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:188) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:563) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:457) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.valu eChanged(JavaOutlinePage.java:569) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.run (JavaOutlinePage.java:558) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) 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:195) at org.eclipse.core.launcher.Main.run(Main.java:541) at org.eclipse.core.launcher.Main.main(Main.java:396)
|
resolved fixed
|
6663ac0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T14:25:04Z | 2002-04-23T11:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
Assert.isNotNull(viewer);
Assert.isNotNull(manager);
fViewer= viewer;
fManager= manager;
fManager.setLinkedPositionListener(this);
initializeHighlightColor(viewer);
}
/**
* @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
initializeHighlightColor(fViewer);
redrawRegion();
}
private void initializeHighlightColor(ITextViewer viewer) {
if (fFrameColor != null)
fFrameColor.dispose();
Display display= viewer.getTextWidget().getDisplay();
fFrameColor= createColor(fgStore, CompilationUnitEditor.LINKED_POSITION_COLOR, display);
}
/**
* Creates a color from the information stored in the given preference store.
* Returns <code>null</code> if there is no such information available.
*/
private Color createColor(IPreferenceStore store, String key, Display display) {
RGB rgb= null;
|
14,390 |
Bug 14390 npe on sorting in outline
|
20020418+ (20020418.2) java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.initializeHighlightColor (LinkedPositionUI.java:109) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.propertyChange (LinkedPositionUI.java:100) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:247) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:188) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:563) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:457) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.valu eChanged(JavaOutlinePage.java:569) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.run (JavaOutlinePage.java:558) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) 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:195) at org.eclipse.core.launcher.Main.run(Main.java:541) at org.eclipse.core.launcher.Main.main(Main.java:396)
|
resolved fixed
|
6663ac0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T14:25:04Z | 2002-04-23T11:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
if (store.contains(key)) {
if (store.isDefault(key))
rgb= PreferenceConverter.getDefaultColor(store, key);
else
rgb= PreferenceConverter.getColor(store, key);
if (rgb != null)
return new Color(display, rgb);
}
return null;
}
/**
* Sets the final position of the caret when the linked mode is exited
* successfully by leaving the last linked position using TAB.
*/
public void setFinalCaretOffset(int offset) {
fFinalCaretOffset= offset;
}
/**
* Sets a <code>CancelListener</code> which is notified if the linked mode
* is exited unsuccessfully by hitting ESC.
*/
public void setCancelListener(ExitListener listener) {
fExitListener= listener;
}
/*
* @see LinkedPositionManager.LinkedPositionListener#setCurrentPositions(Position, int)
|
14,390 |
Bug 14390 npe on sorting in outline
|
20020418+ (20020418.2) java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.initializeHighlightColor (LinkedPositionUI.java:109) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.propertyChange (LinkedPositionUI.java:100) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:247) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:188) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:563) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:457) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.valu eChanged(JavaOutlinePage.java:569) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.run (JavaOutlinePage.java:558) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) 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:195) at org.eclipse.core.launcher.Main.run(Main.java:541) at org.eclipse.core.launcher.Main.main(Main.java:396)
|
resolved fixed
|
6663ac0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T14:25:04Z | 2002-04-23T11:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
*/
public void setCurrentPosition(Position position, int caretOffset) {
if (!fFramePosition.equals(position)) {
redrawRegion();
fFramePosition= position;
}
fCaretOffset= caretOffset;
}
/**
* Enters the linked mode. The linked mode can be left by calling
* <code>exit</code>.
*
* @see exit(boolean)
*/
public void enter() {
IDocument document= fViewer.getDocument();
document.addPositionCategory(CARET_POSITION);
document.addPositionUpdater(fgUpdater);
try {
if (fFinalCaretOffset != -1)
document.addPosition(CARET_POSITION, new Position(fFinalCaretOffset));
} catch (BadLocationException e) {
openErrorDialog(fViewer.getTextWidget().getShell(), e);
} catch (BadPositionCategoryException e) {
JavaPlugin.log(e);
Assert.isTrue(false);
}
fViewer.addTextInputListener(this);
|
14,390 |
Bug 14390 npe on sorting in outline
|
20020418+ (20020418.2) java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.initializeHighlightColor (LinkedPositionUI.java:109) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.propertyChange (LinkedPositionUI.java:100) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:247) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:188) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:563) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:457) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.valu eChanged(JavaOutlinePage.java:569) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.run (JavaOutlinePage.java:558) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) 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:195) at org.eclipse.core.launcher.Main.run(Main.java:541) at org.eclipse.core.launcher.Main.main(Main.java:396)
|
resolved fixed
|
6663ac0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T14:25:04Z | 2002-04-23T11:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
ITextViewerExtension extension= (ITextViewerExtension) fViewer;
extension.prependVerifyKeyListener(this);
StyledText text= fViewer.getTextWidget();
text.addVerifyListener(this);
text.addModifyListener(this);
text.addPaintListener(this);
text.showSelection();
fFramePosition= fManager.getFirstPosition();
if (fFramePosition == null)
leave(UNINSTALL | COMMIT | UPDATE_CARET);
fgStore.addPropertyChangeListener(this);
}
/**
* @see LinkedPositionManager.LinkedPositionListener#exit(boolean)
*/
public void exit(boolean success) {
leave((success ? COMMIT : 0) | UPDATE_CARET);
}
/**
* Returns the cursor selection, after having entered the linked mode.
* <code>enter()</code> must be called prior to a call to this method.
*/
public IRegion getSelectedRegion() {
if (fFramePosition == null)
return new Region(fFinalCaretOffset, 0);
else
return new Region(fFramePosition.getOffset(), fFramePosition.getLength());
}
|
14,390 |
Bug 14390 npe on sorting in outline
|
20020418+ (20020418.2) java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.initializeHighlightColor (LinkedPositionUI.java:109) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.propertyChange (LinkedPositionUI.java:100) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:247) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:188) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:563) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:457) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.valu eChanged(JavaOutlinePage.java:569) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.run (JavaOutlinePage.java:558) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) 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:195) at org.eclipse.core.launcher.Main.run(Main.java:541) at org.eclipse.core.launcher.Main.main(Main.java:396)
|
resolved fixed
|
6663ac0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T14:25:04Z | 2002-04-23T11:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
private void leave(int flags) {
if ((flags & UNINSTALL) != 0)
fManager.uninstall((flags & COMMIT) != 0);
fgStore.removePropertyChangeListener(this);
if (fFrameColor != null) {
fFrameColor.dispose();
fFrameColor= null;
}
StyledText text= fViewer.getTextWidget();
text.removePaintListener(this);
text.removeModifyListener(this);
text.removeVerifyListener(this);
ITextViewerExtension extension= (ITextViewerExtension) fViewer;
extension.removeVerifyKeyListener(this);
fViewer.removeTextInputListener(this);
try {
IRegion region= fViewer.getVisibleRegion();
IDocument document= fViewer.getDocument();
if (((flags & COMMIT) != 0) &&
((flags & DOCUMENT_CHANGED) == 0) &&
((flags & UPDATE_CARET) != 0))
{
Position[] positions= document.getPositions(CARET_POSITION);
if ((positions != null) && (positions.length != 0)) {
int offset= positions[0].getOffset() - region.getOffset();
if ((offset >= 0) && (offset <= region.getLength()))
text.setSelection(offset, offset);
|
14,390 |
Bug 14390 npe on sorting in outline
|
20020418+ (20020418.2) java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.initializeHighlightColor (LinkedPositionUI.java:109) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.propertyChange (LinkedPositionUI.java:100) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:247) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:188) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:563) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:457) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.valu eChanged(JavaOutlinePage.java:569) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.run (JavaOutlinePage.java:558) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) 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:195) at org.eclipse.core.launcher.Main.run(Main.java:541) at org.eclipse.core.launcher.Main.main(Main.java:396)
|
resolved fixed
|
6663ac0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T14:25:04Z | 2002-04-23T11:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
}
}
document.removePositionUpdater(fgUpdater);
document.removePositionCategory(CARET_POSITION);
if (fExitListener != null)
fExitListener.exit(
((flags & COMMIT) != 0) ||
((flags & DOCUMENT_CHANGED) != 0));
} catch (BadPositionCategoryException e) {
JavaPlugin.log(e);
Assert.isTrue(false);
}
if ((flags & DOCUMENT_CHANGED) == 0)
text.redraw();
}
private void next() {
redrawRegion();
fFramePosition= fManager.getNextPosition(fFramePosition.getOffset());
if (fFramePosition == null) {
leave(UNINSTALL | COMMIT | UPDATE_CARET);
} else {
selectRegion();
redrawRegion();
}
}
private void previous() {
redrawRegion();
|
14,390 |
Bug 14390 npe on sorting in outline
|
20020418+ (20020418.2) java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.initializeHighlightColor (LinkedPositionUI.java:109) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.propertyChange (LinkedPositionUI.java:100) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:247) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:188) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:563) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:457) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.valu eChanged(JavaOutlinePage.java:569) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.run (JavaOutlinePage.java:558) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) 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:195) at org.eclipse.core.launcher.Main.run(Main.java:541) at org.eclipse.core.launcher.Main.main(Main.java:396)
|
resolved fixed
|
6663ac0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T14:25:04Z | 2002-04-23T11:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
Position position= fManager.getPreviousPosition(fFramePosition.getOffset());
if (position == null) {
fViewer.getTextWidget().getDisplay().beep();
} else {
fFramePosition= position;
selectRegion();
redrawRegion();
}
}
/*
* @see VerifyKeyListener#verifyKey(VerifyEvent)
*/
public void verifyKey(VerifyEvent event) {
switch (event.character) {
case 0x09:
{
Point selection= fViewer.getTextWidget().getSelection();
IRegion region= fViewer.getVisibleRegion();
int offset= selection.x + region.getOffset();
int length= selection.y - selection.x;
if (!LinkedPositionManager.includes(fFramePosition, offset, length)) {
leave(UNINSTALL | COMMIT | UPDATE_CARET);
return;
}
}
|
14,390 |
Bug 14390 npe on sorting in outline
|
20020418+ (20020418.2) java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.initializeHighlightColor (LinkedPositionUI.java:109) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.propertyChange (LinkedPositionUI.java:100) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:247) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:188) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:563) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:457) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.valu eChanged(JavaOutlinePage.java:569) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.run (JavaOutlinePage.java:558) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) 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:195) at org.eclipse.core.launcher.Main.run(Main.java:541) at org.eclipse.core.launcher.Main.main(Main.java:396)
|
resolved fixed
|
6663ac0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T14:25:04Z | 2002-04-23T11:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
if (event.stateMask == SWT.SHIFT)
previous();
else
next();
event.doit= false;
break;
case 0x0D:
leave(UNINSTALL | COMMIT | UPDATE_CARET);
event.doit= false;
break;
case 0x1B:
leave(UNINSTALL | COMMIT);
event.doit= false;
break;
}
}
/*
* @see VerifyListener#verifyText(VerifyEvent)
*/
public void verifyText(VerifyEvent event) {
if (!event.doit)
return;
IRegion region= fViewer.getVisibleRegion();
int offset= event.start + region.getOffset();
int length= event.end - event.start;
if (!fManager.anyPositionIncludes(offset, length))
|
14,390 |
Bug 14390 npe on sorting in outline
|
20020418+ (20020418.2) java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.initializeHighlightColor (LinkedPositionUI.java:109) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.propertyChange (LinkedPositionUI.java:100) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:247) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:188) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:563) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:457) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.valu eChanged(JavaOutlinePage.java:569) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.run (JavaOutlinePage.java:558) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) 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:195) at org.eclipse.core.launcher.Main.run(Main.java:541) at org.eclipse.core.launcher.Main.main(Main.java:396)
|
resolved fixed
|
6663ac0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T14:25:04Z | 2002-04-23T11:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
leave(UNINSTALL | COMMIT);
}
/*
* @see PaintListener#paintControl(PaintEvent)
*/
public void paintControl(PaintEvent event) {
if (fFramePosition == null)
return;
IRegion region= fViewer.getVisibleRegion();
if (!includes(region, fFramePosition)) {
leave(UNINSTALL | COMMIT | DOCUMENT_CHANGED);
return;
}
int offset= fFramePosition.getOffset() - region.getOffset();
int length= fFramePosition.getLength();
StyledText text= fViewer.getTextWidget();
Point minLocation= getMinimumLocation(text, offset, length);
Point maxLocation= getMaximumLocation(text, offset, length);
int x1= minLocation.x;
int x2= minLocation.x + maxLocation.x - minLocation.x - 1;
int y= minLocation.y + text.getLineHeight() - 1;
GC gc= event.gc;
gc.setForeground(fFrameColor);
|
14,390 |
Bug 14390 npe on sorting in outline
|
20020418+ (20020418.2) java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.initializeHighlightColor (LinkedPositionUI.java:109) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.propertyChange (LinkedPositionUI.java:100) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:247) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:188) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:563) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:457) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.valu eChanged(JavaOutlinePage.java:569) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.run (JavaOutlinePage.java:558) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) 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:195) at org.eclipse.core.launcher.Main.run(Main.java:541) at org.eclipse.core.launcher.Main.main(Main.java:396)
|
resolved fixed
|
6663ac0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T14:25:04Z | 2002-04-23T11:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
gc.drawLine(x1, y, x2, y);
}
private static Point getMinimumLocation(StyledText text, int offset, int length) {
Point minLocation= new Point(Integer.MAX_VALUE, Integer.MAX_VALUE);
for (int i= 0; i <= length; i++) {
Point location= text.getLocationAtOffset(offset + i);
if (location.x < minLocation.x)
minLocation.x= location.x;
if (location.y < minLocation.y)
minLocation.y= location.y;
}
return minLocation;
}
private static Point getMaximumLocation(StyledText text, int offset, int length) {
Point maxLocation= new Point(Integer.MIN_VALUE, Integer.MIN_VALUE);
for (int i= 0; i <= length; i++) {
Point location= text.getLocationAtOffset(offset + i);
if (location.x > maxLocation.x)
maxLocation.x= location.x;
if (location.y > maxLocation.y)
maxLocation.y= location.y;
}
return maxLocation;
}
private void redrawRegion() {
IRegion region= fViewer.getVisibleRegion();
|
14,390 |
Bug 14390 npe on sorting in outline
|
20020418+ (20020418.2) java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.initializeHighlightColor (LinkedPositionUI.java:109) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.propertyChange (LinkedPositionUI.java:100) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:247) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:188) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:563) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:457) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.valu eChanged(JavaOutlinePage.java:569) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.run (JavaOutlinePage.java:558) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) 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:195) at org.eclipse.core.launcher.Main.run(Main.java:541) at org.eclipse.core.launcher.Main.main(Main.java:396)
|
resolved fixed
|
6663ac0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T14:25:04Z | 2002-04-23T11:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
if (!includes(region, fFramePosition)) {
leave(UNINSTALL | COMMIT | DOCUMENT_CHANGED);
return;
}
int offset= fFramePosition.getOffset() - region.getOffset();
int length= fFramePosition.getLength();
fViewer.getTextWidget().redrawRange(offset, length, true);
}
private void selectRegion() {
IRegion region= fViewer.getVisibleRegion();
if (!includes(region, fFramePosition)) {
leave(UNINSTALL | COMMIT | DOCUMENT_CHANGED);
return;
}
int start= fFramePosition.getOffset() - region.getOffset();
int end= fFramePosition.getLength() + start;
fViewer.getTextWidget().setSelection(start, end);
}
private void updateCaret() {
IRegion region= fViewer.getVisibleRegion();
if (!includes(region, fFramePosition)) {
leave(UNINSTALL | COMMIT | DOCUMENT_CHANGED);
return;
}
int offset= fFramePosition.getOffset() + fCaretOffset - region.getOffset();
if ((offset >= 0) && (offset <= region.getLength()))
fViewer.getTextWidget().setCaretOffset(offset);
}
|
14,390 |
Bug 14390 npe on sorting in outline
|
20020418+ (20020418.2) java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.initializeHighlightColor (LinkedPositionUI.java:109) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.propertyChange (LinkedPositionUI.java:100) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:247) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:188) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:563) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:457) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.valu eChanged(JavaOutlinePage.java:569) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$LexicalSortingAction.run (JavaOutlinePage.java:558) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) 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:195) at org.eclipse.core.launcher.Main.run(Main.java:541) at org.eclipse.core.launcher.Main.main(Main.java:396)
|
resolved fixed
|
6663ac0
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-23T14:25:04Z | 2002-04-23T11:06:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
/*
* @see ModifyListener#modifyText(ModifyEvent)
*/
public void modifyText(ModifyEvent e) {
redrawRegion();
updateCaret();
}
private static void openErrorDialog(Shell shell, Exception e) {
MessageDialog.openError(shell, LinkedPositionMessages.getString("LinkedPositionUI.error.title"), e.getMessage());
}
/*
* @see ITextInputListener#inputDocumentAboutToBeChanged(IDocument, IDocument)
*/
public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
int flags= UNINSTALL | COMMIT | (oldInput.equals(newInput) ? 0 : DOCUMENT_CHANGED);
leave(flags);
}
/*
* @see ITextInputListener#inputDocumentChanged(IDocument, IDocument)
*/
public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
}
private static boolean includes(IRegion region, Position position) {
return
position.getOffset() >= region.getOffset() &&
position.getOffset() + position.getLength() <= region.getOffset() + region.getLength();
}
}
|
18,483 |
Bug 18483 IE6 causes conflict with SWT.APPLICATION_MODAL on Windows 98
|
Build 20020531 When IE 6 is installed on Windows 98 it replaces the task bar with one of its own (according to Dave Thomson). When this occurs the focus behaviour of shells with modality set to SWT.APPLICATION_MODAL changes. STEPS 1) Start Windows 98 on a machine with IE 5 or earlier 2) Select a file 3) Hit delete - a prompter comes up 4) Select an non Eclipse window and drag it over the dialog 5) Select the Eclipse parent window in the tasks list - the dialog and window are given focus 6) Start Windows 98 on a machine with IE 62) Select a file 3) Hit delete - a prompter comes up 4) Select an non Eclipse window and drag it over the dialog 5) Select the Eclipse parent window in the tasks list - the dialog only is given focus and the window stays in the backgroud. I don't have a good pure SWT example of this yet as I am still trying to find the condition that makes this happen.
|
resolved fixed
|
208c64c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-24T16:05:56Z | 2002-05-31T18:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaTextTools.java
|
package org.eclipse.jdt.ui.text;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.IDocumentPartitioner;
import org.eclipse.jface.text.rules.DefaultPartitioner;
import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
import org.eclipse.jface.text.rules.RuleBasedScanner;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jdt.internal.ui.text.JavaColorManager;
import org.eclipse.jdt.internal.ui.text.JavaPartitionScanner;
import org.eclipse.jdt.internal.ui.text.SingleTokenJavaScanner;
import org.eclipse.jdt.internal.ui.text.java.JavaCodeScanner;
import org.eclipse.jdt.internal.ui.text.javadoc.JavaDocScanner;
/**
* Tools required to configure a Java text viewer.
* The color manager and all scanner exist only one time, i.e.
* the same instances are returned to all clients. Thus, clients
* share those tools.
* <p>
* This class may be instantiated; it is not intended to be subclassed.
* </p>
*/
public class JavaTextTools {
|
18,483 |
Bug 18483 IE6 causes conflict with SWT.APPLICATION_MODAL on Windows 98
|
Build 20020531 When IE 6 is installed on Windows 98 it replaces the task bar with one of its own (according to Dave Thomson). When this occurs the focus behaviour of shells with modality set to SWT.APPLICATION_MODAL changes. STEPS 1) Start Windows 98 on a machine with IE 5 or earlier 2) Select a file 3) Hit delete - a prompter comes up 4) Select an non Eclipse window and drag it over the dialog 5) Select the Eclipse parent window in the tasks list - the dialog and window are given focus 6) Start Windows 98 on a machine with IE 62) Select a file 3) Hit delete - a prompter comes up 4) Select an non Eclipse window and drag it over the dialog 5) Select the Eclipse parent window in the tasks list - the dialog only is given focus and the window stays in the backgroud. I don't have a good pure SWT example of this yet as I am still trying to find the condition that makes this happen.
|
resolved fixed
|
208c64c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-24T16:05:56Z | 2002-05-31T18:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaTextTools.java
|
private class PreferenceListener implements IPropertyChangeListener {
public void propertyChange(PropertyChangeEvent event) {
adaptToPreferenceChange(event);
}
};
private JavaColorManager fColorManager;
private JavaCodeScanner fCodeScanner;
private SingleTokenJavaScanner fMultilineCommentScanner;
private SingleTokenJavaScanner fSinglelineCommentScanner;
private SingleTokenJavaScanner fStringScanner;
private JavaDocScanner fJavaDocScanner;
|
18,483 |
Bug 18483 IE6 causes conflict with SWT.APPLICATION_MODAL on Windows 98
|
Build 20020531 When IE 6 is installed on Windows 98 it replaces the task bar with one of its own (according to Dave Thomson). When this occurs the focus behaviour of shells with modality set to SWT.APPLICATION_MODAL changes. STEPS 1) Start Windows 98 on a machine with IE 5 or earlier 2) Select a file 3) Hit delete - a prompter comes up 4) Select an non Eclipse window and drag it over the dialog 5) Select the Eclipse parent window in the tasks list - the dialog and window are given focus 6) Start Windows 98 on a machine with IE 62) Select a file 3) Hit delete - a prompter comes up 4) Select an non Eclipse window and drag it over the dialog 5) Select the Eclipse parent window in the tasks list - the dialog only is given focus and the window stays in the backgroud. I don't have a good pure SWT example of this yet as I am still trying to find the condition that makes this happen.
|
resolved fixed
|
208c64c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-24T16:05:56Z | 2002-05-31T18:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaTextTools.java
|
private JavaPartitionScanner fPartitionScanner;
private IPreferenceStore fPreferenceStore;
private PreferenceListener fPreferenceListener= new PreferenceListener();
/**
* Creates a new Java text tools collection.
*/
public JavaTextTools(IPreferenceStore store) {
fPreferenceStore= store;
fPreferenceStore.addPropertyChangeListener(fPreferenceListener);
fColorManager= new JavaColorManager();
fCodeScanner= new JavaCodeScanner(fColorManager, store);
fMultilineCommentScanner= new SingleTokenJavaScanner(fColorManager, store, IJavaColorConstants.JAVA_MULTI_LINE_COMMENT);
fSinglelineCommentScanner= new SingleTokenJavaScanner(fColorManager, store, IJavaColorConstants.JAVA_SINGLE_LINE_COMMENT);
fStringScanner= new SingleTokenJavaScanner(fColorManager, store, IJavaColorConstants.JAVA_STRING);
fJavaDocScanner= new JavaDocScanner(fColorManager, store);
fPartitionScanner= new JavaPartitionScanner();
}
/**
* Disposes all the individual tools of this tools collection.
*/
public void dispose() {
fCodeScanner= null;
fMultilineCommentScanner= null;
|
18,483 |
Bug 18483 IE6 causes conflict with SWT.APPLICATION_MODAL on Windows 98
|
Build 20020531 When IE 6 is installed on Windows 98 it replaces the task bar with one of its own (according to Dave Thomson). When this occurs the focus behaviour of shells with modality set to SWT.APPLICATION_MODAL changes. STEPS 1) Start Windows 98 on a machine with IE 5 or earlier 2) Select a file 3) Hit delete - a prompter comes up 4) Select an non Eclipse window and drag it over the dialog 5) Select the Eclipse parent window in the tasks list - the dialog and window are given focus 6) Start Windows 98 on a machine with IE 62) Select a file 3) Hit delete - a prompter comes up 4) Select an non Eclipse window and drag it over the dialog 5) Select the Eclipse parent window in the tasks list - the dialog only is given focus and the window stays in the backgroud. I don't have a good pure SWT example of this yet as I am still trying to find the condition that makes this happen.
|
resolved fixed
|
208c64c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-24T16:05:56Z | 2002-05-31T18:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaTextTools.java
|
fSinglelineCommentScanner= null;
fStringScanner= null;
fJavaDocScanner= null;
fPartitionScanner= null;
if (fColorManager != null) {
fColorManager.dispose();
fColorManager= null;
}
if (fPreferenceStore != null) {
fPreferenceStore.removePropertyChangeListener(fPreferenceListener);
fPreferenceStore= null;
fPreferenceListener= null;
}
}
/**
* Returns the color manager which is used to manage
* any Java-specific colors needed for such things like syntax highlighting.
*
* @return the color manager to be used for Java text viewers
*/
public IColorManager getColorManager() {
return fColorManager;
}
/**
* Returns a scanner which is configured to scan Java source code.
*
|
18,483 |
Bug 18483 IE6 causes conflict with SWT.APPLICATION_MODAL on Windows 98
|
Build 20020531 When IE 6 is installed on Windows 98 it replaces the task bar with one of its own (according to Dave Thomson). When this occurs the focus behaviour of shells with modality set to SWT.APPLICATION_MODAL changes. STEPS 1) Start Windows 98 on a machine with IE 5 or earlier 2) Select a file 3) Hit delete - a prompter comes up 4) Select an non Eclipse window and drag it over the dialog 5) Select the Eclipse parent window in the tasks list - the dialog and window are given focus 6) Start Windows 98 on a machine with IE 62) Select a file 3) Hit delete - a prompter comes up 4) Select an non Eclipse window and drag it over the dialog 5) Select the Eclipse parent window in the tasks list - the dialog only is given focus and the window stays in the backgroud. I don't have a good pure SWT example of this yet as I am still trying to find the condition that makes this happen.
|
resolved fixed
|
208c64c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-24T16:05:56Z | 2002-05-31T18:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaTextTools.java
|
* @return a Java source code scanner
*/
public RuleBasedScanner getCodeScanner() {
return fCodeScanner;
}
/**
* Returns a scanner which is configured to scan Java multiline comments.
*
* @return a Java multiline comment scanner
*/
public RuleBasedScanner getMultilineCommentScanner() {
return fMultilineCommentScanner;
}
/**
* Returns a scanner which is configured to scan Java singleline comments.
*
* @return a Java singleline comment scanner
*/
public RuleBasedScanner getSinglelineCommentScanner() {
return fSinglelineCommentScanner;
}
/**
* Returns a scanner which is configured to scan Java strings.
*
* @return a Java string scanner
*/
public RuleBasedScanner getStringScanner() {
return fStringScanner;
|
18,483 |
Bug 18483 IE6 causes conflict with SWT.APPLICATION_MODAL on Windows 98
|
Build 20020531 When IE 6 is installed on Windows 98 it replaces the task bar with one of its own (according to Dave Thomson). When this occurs the focus behaviour of shells with modality set to SWT.APPLICATION_MODAL changes. STEPS 1) Start Windows 98 on a machine with IE 5 or earlier 2) Select a file 3) Hit delete - a prompter comes up 4) Select an non Eclipse window and drag it over the dialog 5) Select the Eclipse parent window in the tasks list - the dialog and window are given focus 6) Start Windows 98 on a machine with IE 62) Select a file 3) Hit delete - a prompter comes up 4) Select an non Eclipse window and drag it over the dialog 5) Select the Eclipse parent window in the tasks list - the dialog only is given focus and the window stays in the backgroud. I don't have a good pure SWT example of this yet as I am still trying to find the condition that makes this happen.
|
resolved fixed
|
208c64c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-24T16:05:56Z | 2002-05-31T18:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaTextTools.java
|
}
/**
* Returns a scanner which is configured to scan JavaDoc compliant comments.
* Notes that the start sequence "/**" and the corresponding end sequence
* are part of the JavaDoc comment.
*
* @return a JavaDoc scanner
*/
public RuleBasedScanner getJavaDocScanner() {
return fJavaDocScanner;
}
/**
* Returns a scanner which is configured to scan
* Java-specific partitions, which are multi-line comments,
* JavaDoc comments, and regular Java source code.
*
* @return a Java partition scanner
*/
public RuleBasedPartitionScanner getPartitionScanner() {
return fPartitionScanner;
}
/**
* Factory method for creating a Java-specific document partitioner
* using this object's partitions scanner. This method is a
* convenience method.
*
* @return a newly created Java document partitioner
|
18,483 |
Bug 18483 IE6 causes conflict with SWT.APPLICATION_MODAL on Windows 98
|
Build 20020531 When IE 6 is installed on Windows 98 it replaces the task bar with one of its own (according to Dave Thomson). When this occurs the focus behaviour of shells with modality set to SWT.APPLICATION_MODAL changes. STEPS 1) Start Windows 98 on a machine with IE 5 or earlier 2) Select a file 3) Hit delete - a prompter comes up 4) Select an non Eclipse window and drag it over the dialog 5) Select the Eclipse parent window in the tasks list - the dialog and window are given focus 6) Start Windows 98 on a machine with IE 62) Select a file 3) Hit delete - a prompter comes up 4) Select an non Eclipse window and drag it over the dialog 5) Select the Eclipse parent window in the tasks list - the dialog only is given focus and the window stays in the backgroud. I don't have a good pure SWT example of this yet as I am still trying to find the condition that makes this happen.
|
resolved fixed
|
208c64c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-24T16:05:56Z | 2002-05-31T18:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaTextTools.java
|
*/
public IDocumentPartitioner createDocumentPartitioner() {
String[] types= new String[] {
JavaPartitionScanner.JAVA_DOC,
JavaPartitionScanner.JAVA_MULTI_LINE_COMMENT,
JavaPartitionScanner.JAVA_SINGLE_LINE_COMMENT,
JavaPartitionScanner.JAVA_STRING
};
return new DefaultPartitioner(getPartitionScanner(), types);
}
/**
* Returns the names of the document position categories used by the document
* partitioners created by this object to manage their partition information.
* If the partitioners don't use document position categories, the returned
* result is <code>null</code>.
*
* @return the partition managing position categories or <code>null</code>
* if there is none
*/
public String[] getPartitionManagingPositionCategories() {
return new String[] { DefaultPartitioner.CONTENT_TYPES_CATEGORY };
}
/**
* Determines whether the preference change encoded by the given event
* changes the behavior of one its contained components.
*
|
18,483 |
Bug 18483 IE6 causes conflict with SWT.APPLICATION_MODAL on Windows 98
|
Build 20020531 When IE 6 is installed on Windows 98 it replaces the task bar with one of its own (according to Dave Thomson). When this occurs the focus behaviour of shells with modality set to SWT.APPLICATION_MODAL changes. STEPS 1) Start Windows 98 on a machine with IE 5 or earlier 2) Select a file 3) Hit delete - a prompter comes up 4) Select an non Eclipse window and drag it over the dialog 5) Select the Eclipse parent window in the tasks list - the dialog and window are given focus 6) Start Windows 98 on a machine with IE 62) Select a file 3) Hit delete - a prompter comes up 4) Select an non Eclipse window and drag it over the dialog 5) Select the Eclipse parent window in the tasks list - the dialog only is given focus and the window stays in the backgroud. I don't have a good pure SWT example of this yet as I am still trying to find the condition that makes this happen.
|
resolved fixed
|
208c64c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-24T16:05:56Z | 2002-05-31T18:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaTextTools.java
|
* @param event the event to be investigated
* @return <code>true</code> if event causes a behavioral change
*/
public boolean affectsBehavior(PropertyChangeEvent event) {
return fCodeScanner.affectsBehavior(event) ||
fMultilineCommentScanner.affectsBehavior(event) ||
fSinglelineCommentScanner.affectsBehavior(event) ||
fStringScanner.affectsBehavior(event) ||
fJavaDocScanner.affectsBehavior(event);
}
/**
* Adapts the behavior of the contained components to the change
* encoded in the given event.
*
* @param event the event to whch to adapt
*/
protected void adaptToPreferenceChange(PropertyChangeEvent event) {
if (fCodeScanner.affectsBehavior(event))
fCodeScanner.adaptToPreferenceChange(event);
if (fMultilineCommentScanner.affectsBehavior(event))
fMultilineCommentScanner.adaptToPreferenceChange(event);
if (fSinglelineCommentScanner.affectsBehavior(event))
fSinglelineCommentScanner.adaptToPreferenceChange(event);
if (fStringScanner.affectsBehavior(event))
fStringScanner.adaptToPreferenceChange(event);
if (fJavaDocScanner.affectsBehavior(event))
fJavaDocScanner.adaptToPreferenceChange(event);
}
}
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddGetterSetterAction.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.actions;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddGetterSetterAction.java
|
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.corext.codemanipulation.AddGetterSetterOperation;
import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
import org.eclipse.jdt.internal.corext.codemanipulation.IRequestQuery;
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.corext.util.JavaModelUtil;
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.
*
* @deprecated Use action from package org.eclipse.jdt.ui.actions
*/
public class AddGetterSetterAction extends Action {
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddGetterSetterAction.java
|
private ISelectionProvider fSelectionProvider;
public AddGetterSetterAction(ISelectionProvider selProvider) {
super(JavaUIMessages.getString("AddGetterSetterAction.label"));
setDescription(JavaUIMessages.getString("AddGetterSetterAction.description"));
setToolTipText(JavaUIMessages.getString("AddGetterSetterAction.tooltip"));
fSelectionProvider= selProvider;
WorkbenchHelp.setHelp(this, IJavaHelpContextIds.GETTERSETTER_ACTION);
}
public void run() {
IField[] fields= getSelectedFields();
if (fields == null) {
return;
}
try {
ICompilationUnit cu= fields[0].getCompilationUnit();
IEditorPart editor= EditorUtility.openInEditor(cu);
ICompilationUnit workingCopyCU;
IField[] workingCopyFields;
if (cu.isWorkingCopy()) {
workingCopyCU= cu;
workingCopyFields= fields;
} else {
workingCopyCU= EditorUtility.getWorkingCopy(cu);
if (workingCopyCU == null) {
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddGetterSetterAction.java
|
showError(JavaUIMessages.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(JavaUIMessages.getFormattedString("AddGetterSetterAction.error.fieldNotExisting", field.getElementName()));
return;
}
workingCopyFields[i]= workingCopyField;
}
}
IRequestQuery skipSetterForFinalQuery= skipSetterForFinalQuery();
IRequestQuery skipReplaceQuery= skipReplaceQuery();
String[] prefixes= CodeGenerationPreferencePage.getGetterStetterPrefixes();
String[] suffixes= CodeGenerationPreferencePage.getGetterStetterSuffixes();
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
AddGetterSetterOperation op= new AddGetterSetterOperation(workingCopyFields, prefixes, suffixes, settings, skipSetterForFinalQuery, skipReplaceQuery);
ProgressMonitorDialog dialog= new ProgressMonitorDialog(JavaPlugin.getActiveWorkbenchShell());
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);
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddGetterSetterAction.java
|
showError(JavaUIMessages.getString("AddGetterSetterAction.error.actionfailed"));
} catch (CoreException e) {
JavaPlugin.log(e.getStatus());
showError(JavaUIMessages.getString("AddGetterSetterAction.error.actionfailed"));
return;
} 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= JavaUIMessages.getFormattedString("AddGetterSetterAction.SkipSetterForFinalDialog.message", fieldName);
return showQueryDialog(formattedMessage, options, returnCodes);
}
};
}
private IRequestQuery skipReplaceQuery() {
return new IRequestQuery() {
public int doQuery(IMember method) {
int[] returnCodes= {IRequestQuery.YES, IRequestQuery.NO, IRequestQuery.YES_ALL, IRequestQuery.CANCEL};
String skipLabel= JavaUIMessages.getString("AddGetterSetterAction.SkipExistingDialog.skip.label");
String replaceLabel= JavaUIMessages.getString("AddGetterSetterAction.SkipExistingDialog.replace.label");
String skipAllLabel= JavaUIMessages.getString("AddGetterSetterAction.SkipExistingDialog.skipAll.label");
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddGetterSetterAction.java
|
String[] options= { skipLabel, replaceLabel, skipAllLabel, IDialogConstants.CANCEL_LABEL};
String methodName= JavaElementLabels.getElementLabel(method, JavaElementLabels.M_PARAMETER_TYPES);
String formattedMessage= JavaUIMessages.getFormattedString("AddGetterSetterAction.SkipExistingDialog.message", methodName);
return showQueryDialog(formattedMessage, options, returnCodes);
}
};
}
private int showQueryDialog(final String message, final String[] buttonLabels, int[] returnCodes) {
final Shell shell= JavaPlugin.getActiveWorkbenchShell();
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= JavaUIMessages.getString("AddGetterSetterAction.QueryDialog.title");
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) {
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddGetterSetterAction.java
|
Shell shell= JavaPlugin.getActiveWorkbenchShell();
String title= JavaUIMessages.getString("AddGetterSetterAction.error.title");
MessageDialog.openError(shell, title, message);
}
/*
* Returns fields in the selection or <code>null</code> if the selection is
* empty or not valid.
*/
private IField[] getSelectedFields() {
ISelection sel= fSelectionProvider.getSelection();
if (sel instanceof IStructuredSelection) {
List elements= ((IStructuredSelection)sel).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) {
return null;
}
} else if (!cu.equals(fld.getCompilationUnit())) {
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddGetterSetterAction.java
|
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;
}
/**
* Tests if the acion can be run using the current selection.
*/
public boolean canActionBeAdded() {
return getSelectedFields() != null;
}
}
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddJavaDocStubAction.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.actions;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.jdt.core.ICompilationUnit;
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddJavaDocStubAction.java
|
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.internal.corext.codemanipulation.AddJavaDocStubOperation;
import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
/**
* Create Java Doc Stubs for selected members
* Always forces the he field to be in an open editor. The result is unsaved,
* so the user can decide if he wnats to accept the changes
*
* @deprecated Use action from package org.eclipse.jdt.ui.actions
*/
public class AddJavaDocStubAction extends Action {
private ISelectionProvider fSelectionProvider;
public AddJavaDocStubAction(ISelectionProvider selProvider) {
super(JavaUIMessages.getString("AddJavaDocStubAction.label"));
setDescription(JavaUIMessages.getString("AddJavaDocStubAction.description"));
setToolTipText(JavaUIMessages.getString("AddJavaDocStubAction.tooltip"));
fSelectionProvider= selProvider;
}
public void run() {
IMember[] members= getSelectedMembers();
if (members == null || members.length == 0) {
return;
}
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddJavaDocStubAction.java
|
try {
ICompilationUnit cu= members[0].getCompilationUnit();
IEditorPart editor= EditorUtility.openInEditor(cu);
ICompilationUnit workingCopyCU;
IMember[] workingCopyMembers;
if (cu.isWorkingCopy()) {
workingCopyCU= cu;
workingCopyMembers= members;
} else {
workingCopyCU= EditorUtility.getWorkingCopy(cu);
if (workingCopyCU == null) {
showError(JavaUIMessages.getString("AddJavaDocStubsAction.error.noWorkingCopy"));
return;
}
workingCopyMembers= new IMember[members.length];
for (int i= 0; i < members.length; i++) {
IMember member= members[i];
IMember workingCopyMember= (IMember) JavaModelUtil.findMemberInCompilationUnit(workingCopyCU, member);
if (workingCopyMember == null) {
showError(JavaUIMessages.getFormattedString("AddJavaDocStubsAction.error.memberNotExisting", member.getElementName()));
return;
}
workingCopyMembers[i]= workingCopyMember;
}
}
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddJavaDocStubAction.java
|
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
AddJavaDocStubOperation op= new AddJavaDocStubOperation(workingCopyMembers, settings);
ProgressMonitorDialog dialog= new ProgressMonitorDialog(JavaPlugin.getActiveWorkbenchShell());
dialog.run(false, true, new WorkbenchRunnableAdapter(op));
EditorUtility.revealInEditor(editor, members[0]);
} catch (InvocationTargetException e) {
JavaPlugin.log(e);
showError(JavaUIMessages.getString("AddJavaDocStubsAction.error.actionFailed"));
} catch (InterruptedException e) {
} catch (CoreException e) {
JavaPlugin.log(e.getStatus());
showError(JavaUIMessages.getString("AddJavaDocStubsAction.error.actionFailed"));
return;
}
}
private void showError(String message) {
Shell shell= JavaPlugin.getActiveWorkbenchShell();
String title= JavaUIMessages.getString("AddJavaDocStubsAction.error.dialogTitle");
MessageDialog.openError(shell, title, message);
}
private IMember[] getSelectedMembers() {
ISelection sel= fSelectionProvider.getSelection();
if (sel instanceof IStructuredSelection) {
List elements= ((IStructuredSelection)sel).toList();
int nElements= elements.size();
if (nElements > 0) {
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddJavaDocStubAction.java
|
IMember[] res= new IMember[nElements];
ICompilationUnit cu= null;
for (int i= 0; i < nElements; i++) {
Object curr= elements.get(i);
if (curr instanceof IMethod || curr instanceof IType) {
IMember member= (IMember)curr;
if (i == 0) {
cu= member.getCompilationUnit();
if (cu == null) {
return null;
}
} else if (!cu.equals(member.getCompilationUnit())) {
return null;
}
res[i]= member;
} else {
return null;
}
}
return res;
}
}
return null;
}
public boolean canActionBeAdded() {
return getSelectedMembers() != null;
}
}
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.actions;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.widgets.Shell;
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
|
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.corext.codemanipulation.AddMethodStubOperation;
import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
import org.eclipse.jdt.internal.corext.codemanipulation.IRequestQuery;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabels;
/**
* Creates method stubs in a type.
* The type has to be set before usage (init)
* Always forces the type to open in an editor. The result is unsaved,
* so the user can decide if the changes are acceptable.
*/
public class AddMethodStubAction extends Action {
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
|
private ISelection fSelection;
private IType fParentType;
public AddMethodStubAction() {
super(JavaUIMessages.getString("AddMethodStubAction.label"));
setDescription(JavaUIMessages.getString("AddMethodStubAction.description"));
setToolTipText(JavaUIMessages.getString("AddMethodStubAction.tooltip"));
WorkbenchHelp.setHelp(this, IJavaHelpContextIds.ADD_METHODSTUB_ACTION);
}
public boolean init(IType parentType, ISelection selection) {
if (canActionBeAdded(parentType, selection)) {
fParentType= parentType;
fSelection= selection;
if (parentType != null) {
try {
if (parentType.isInterface()) {
setText(JavaUIMessages.getFormattedString("AddMethodStubAction.detailed.implement", parentType.getElementName()));
} else {
setText(JavaUIMessages.getFormattedString("AddMethodStubAction.detailed.override", parentType.getElementName()));
}
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
} else {
setText(JavaUIMessages.getString("AddMethodStubAction.label"));
}
return true;
}
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
|
fParentType= null;
fSelection= null;
return false;
}
public void run() {
if (!canActionBeAdded(fParentType, fSelection)) {
return;
}
Shell shell= JavaPlugin.getActiveWorkbenchShell();
try {
IEditorPart editor= EditorUtility.openInEditor(fParentType);
IType usedType= (IType)EditorUtility.getWorkingCopy(fParentType);
if (usedType == null) {
MessageDialog.openError(shell, JavaUIMessages.getString("AddMethodStubAction.error.title"), JavaUIMessages.getString("AddMethodStubAction.error.type_removed_in_editor"));
return;
}
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
List list= ((IStructuredSelection)fSelection).toList();
IMethod[] methods= (IMethod[]) list.toArray(new IMethod[list.size()]);
AddMethodStubOperation op= new AddMethodStubOperation(usedType, methods, settings, createOverrideQuery(), createReplaceQuery(), false);
ProgressMonitorDialog dialog= new ProgressMonitorDialog(shell);
dialog.run(false, true, new WorkbenchRunnableAdapter(op));
IMethod[] res= op.getCreatedMethods();
if (res != null && res.length > 0 && editor != null) {
EditorUtility.revealInEditor(editor, res[0]);
}
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
|
} catch (InvocationTargetException e) {
MessageDialog.openError(shell, JavaUIMessages.getString("AddMethodStubAction.error.title"), e.getTargetException().getMessage());
JavaPlugin.log(e.getTargetException());
} catch (CoreException e) {
ErrorDialog.openError(shell, JavaUIMessages.getString("AddMethodStubAction.error.title"), null, e.getStatus());
JavaPlugin.log(e.getStatus());
} catch (InterruptedException e) {
}
}
private IRequestQuery createOverrideQuery() {
return new IRequestQuery() {
public int doQuery(IMember method) {
String methodName= JavaElementLabels.getElementLabel(method, JavaElementLabels.M_PARAMETER_TYPES);
String declTypeName= JavaElementLabels.getElementLabel(method.getDeclaringType(), 0);
String formattedMessage;
try {
if (Flags.isFinal(method.getFlags())) {
formattedMessage= JavaUIMessages.getFormattedString("AddMethodStubAction.OverridesFinalDialog.message", new String[] { methodName, declTypeName });
} else {
formattedMessage= JavaUIMessages.getFormattedString("AddMethodStubAction.OverridesPrivateDialog.message", new String[] { methodName, declTypeName });
}
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
return IRequestQuery.CANCEL;
}
return showQueryDialog(formattedMessage);
}
};
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
|
}
private IRequestQuery createReplaceQuery() {
return new IRequestQuery() {
public int doQuery(IMember method) {
String methodName= JavaElementLabels.getElementLabel(method, JavaElementLabels.M_PARAMETER_TYPES);
String formattedMessage= JavaUIMessages.getFormattedString("AddMethodStubAction.ReplaceExistingDialog.message", methodName);
return showQueryDialog(formattedMessage);
}
};
}
private int showQueryDialog(final String message) {
int[] returnCodes= {IRequestQuery.YES, IRequestQuery.NO, IRequestQuery.YES_ALL, IRequestQuery.CANCEL};
final Shell shell= JavaPlugin.getActiveWorkbenchShell();
if (shell == null) {
JavaPlugin.logErrorMessage("AddMethodStubAction.showQueryDialog: No active shell found");
return IRequestQuery.CANCEL;
}
final int[] result= { MessageDialog.CANCEL };
shell.getDisplay().syncExec(new Runnable() {
public void run() {
String title= JavaUIMessages.getString("AddMethodStubAction.QueryDialog.title");
String[] options= {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.CANCEL_LABEL};
MessageDialog dialog= new MessageDialog(shell, title, null, message, MessageDialog.QUESTION, options, 0);
result[0]= dialog.open();
}
});
int returnVal= result[0];
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
|
return returnVal < 0 ? IRequestQuery.CANCEL : returnCodes[returnVal];
}
/**
* Tests if the action can run with given arguments
*/
public static boolean canActionBeAdded(IType parentType, ISelection selection) {
if (parentType == null || parentType.getCompilationUnit() == null ||
!(selection instanceof IStructuredSelection) || selection.isEmpty()) {
return false;
}
Object[] elems= ((IStructuredSelection)selection).toArray();
int nSelected= elems.length;
if (nSelected > 0) {
for (int i= 0; i < nSelected; i++) {
Object elem= elems[i];
if (!(elem instanceof IMethod)) {
return false;
}
IMethod meth= (IMethod)elem;
if (meth.getDeclaringType().equals(parentType)) {
return false;
}
}
return true;
}
return false;
}
}
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddUnimplementedConstructorsAction.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.actions;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorPart;
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddUnimplementedConstructorsAction.java
|
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.corext.codemanipulation.AddUnimplementedConstructorsOperation;
import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
/**
* Evaluates constructors needed.
* Will open an editor for the type. Changes are unsaved.
*
* @deprecated Use action from package org.eclipse.jdt.ui.actions
*/
public class AddUnimplementedConstructorsAction extends Action {
private ISelectionProvider fSelectionProvider;
public AddUnimplementedConstructorsAction(ISelectionProvider selProvider) {
super(JavaUIMessages.getString("AddUnimplementedConstructorsAction.label"));
setDescription(JavaUIMessages.getString("AddUnimplementedConstructorsAction.description"));
setToolTipText(JavaUIMessages.getString("AddUnimplementedConstructorsAction.tooltip"));
fSelectionProvider= selProvider;
WorkbenchHelp.setHelp(this, IJavaHelpContextIds.ADD_UNIMPLEMENTED_CONSTRUCTORS_ACTION);
}
public void run() {
Shell shell= JavaPlugin.getActiveWorkbenchShell();
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddUnimplementedConstructorsAction.java
|
try {
IType type= getSelectedType();
if (type == null) {
return;
}
IEditorPart editor= EditorUtility.openInEditor(type);
type= (IType)EditorUtility.getWorkingCopy(type);
if (type == null) {
MessageDialog.openError(shell, JavaUIMessages.getString("AddUnimplementedConstructorsAction.error.title"), JavaUIMessages.getString("AddUnimplementedConstructorsAction.error.type_removed_in_editor"));
return;
}
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
AddUnimplementedConstructorsOperation op= new AddUnimplementedConstructorsOperation(type, settings, false);
try {
ProgressMonitorDialog dialog= new ProgressMonitorDialog(shell);
dialog.run(false, true, new WorkbenchRunnableAdapter(op));
IMethod[] res= op.getCreatedMethods();
if (res == null || res.length == 0) {
MessageDialog.openInformation(shell, JavaUIMessages.getString("AddUnimplementedConstructorsAction.error.title"), JavaUIMessages.getString("AddUnimplementedConstructorsAction.error.nothing_found"));
} else if (editor != null) {
EditorUtility.revealInEditor(editor, res[0]);
}
} catch (InvocationTargetException e) {
JavaPlugin.log(e);
MessageDialog.openError(shell, JavaUIMessages.getString("AddUnimplementedConstructorsAction.error.title"), e.getTargetException().getMessage());
} catch (InterruptedException e) {
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddUnimplementedConstructorsAction.java
|
}
} catch (CoreException e) {
JavaPlugin.log(e);
ErrorDialog.openError(shell, JavaUIMessages.getString("AddUnimplementedConstructorsAction.error.title"), null, e.getStatus());
}
}
private IType getSelectedType() throws JavaModelException {
ISelection sel= fSelectionProvider.getSelection();
if (sel instanceof IStructuredSelection) {
Object[] elements= ((IStructuredSelection)sel).toArray();
if (elements.length == 1 && (elements[0] instanceof IType)) {
IType type= (IType) elements[0];
if (type.getCompilationUnit() != null && type.isClass()) {
return type;
}
}
}
return null;
}
public boolean canActionBeAdded() {
try {
return getSelectedType() != null;
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
}
return false;
}
}
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddUnimplementedMethodsAction.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.actions;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.core.IMethod;
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddUnimplementedMethodsAction.java
|
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.corext.codemanipulation.AddUnimplementedMethodsOperation;
import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext;
/**
* Evaluates unimplemented methods of a type.
* Will open an editor for the type. Changes are unsaved.
*
* @deprecated Use action org.eclipse.jdt.ui.actions.OverrideMethodsAction
*/
public class AddUnimplementedMethodsAction extends Action {
private ISelectionProvider fSelectionProvider;
public AddUnimplementedMethodsAction(ISelectionProvider selProvider) {
super(JavaUIMessages.getString("AddUnimplementedMethodsAction.label"));
setDescription(JavaUIMessages.getString("AddUnimplementedMethodsAction.description"));
setToolTipText(JavaUIMessages.getString("AddUnimplementedMethodsAction.tooltip"));
fSelectionProvider= selProvider;
WorkbenchHelp.setHelp(this, IJavaHelpContextIds.ADD_UNIMPLEMENTED_METHODS_ACTION);
}
public void run() {
Shell shell= JavaPlugin.getActiveWorkbenchShell();
try {
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddUnimplementedMethodsAction.java
|
IType type= getSelectedType();
if (type == null) {
return;
}
IEditorPart editor= EditorUtility.openInEditor(type);
type= (IType)EditorUtility.getWorkingCopy(type);
if (type == null) {
MessageDialog.openError(shell, JavaUIMessages.getString("AddUnimplementedMethodsAction.error.title"), JavaUIMessages.getString("AddUnimplementedMethodsAction.error.type_removed_in_editor"));
return;
}
OverrideMethodQuery selectionQuery= new OverrideMethodQuery(shell, false);
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
AddUnimplementedMethodsOperation op= new AddUnimplementedMethodsOperation(type, settings, selectionQuery, false);
try {
BusyIndicatorRunnableContext context= new BusyIndicatorRunnableContext();
context.run(false, true, new WorkbenchRunnableAdapter(op));
IMethod[] res= op.getCreatedMethods();
if (res == null || res.length == 0) {
MessageDialog.openInformation(shell, JavaUIMessages.getString("AddUnimplementedMethodsAction.error.title"), JavaUIMessages.getString("AddUnimplementedMethodsAction.error.nothing_found"));
} else if (editor != null) {
EditorUtility.revealInEditor(editor, res[0]);
}
} catch (InvocationTargetException e) {
JavaPlugin.log(e);
MessageDialog.openError(shell, JavaUIMessages.getString("AddUnimplementedMethodsAction.error.title"), e.getTargetException().getMessage());
} catch (InterruptedException e) {
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddUnimplementedMethodsAction.java
|
}
} catch (CoreException e) {
JavaPlugin.log(e);
ErrorDialog.openError(shell, JavaUIMessages.getString("AddUnimplementedMethodsAction.error.title"), null, e.getStatus());
}
}
private IType getSelectedType() throws JavaModelException {
ISelection sel= fSelectionProvider.getSelection();
if (sel instanceof IStructuredSelection) {
Object[] elements= ((IStructuredSelection)sel).toArray();
if (elements.length == 1 && (elements[0] instanceof IType)) {
IType type= (IType) elements[0];
if (type.getCompilationUnit() != null && type.isClass()) {
return type;
}
}
}
return null;
}
public boolean canActionBeAdded() {
try {
return getSelectedType() != null;
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
}
return false;
}
}
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/AddImportOnSelectionAction.java
|
package org.eclipse.jdt.internal.ui.javaeditor;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/AddImportOnSelectionAction.java
|
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.IUpdate;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.core.search.ITypeNameRequestor;
import org.eclipse.jdt.core.search.SearchEngine;
import org.eclipse.jdt.ui.IWorkingCopyManager;
import org.eclipse.jdt.internal.corext.codemanipulation.AddImportsOperation;
import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
import org.eclipse.jdt.internal.corext.util.TypeInfo;
import org.eclipse.jdt.internal.corext.util.TypeInfoRequestor;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
import org.eclipse.jdt.internal.ui.util.TypeInfoLabelProvider;
public class AddImportOnSelectionAction extends Action implements IUpdate {
private ITextEditor fEditor;
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/AddImportOnSelectionAction.java
|
public AddImportOnSelectionAction(ITextEditor editor) {
super(JavaEditorMessages.getString("AddImportOnSelection.label"));
setToolTipText(JavaEditorMessages.getString("AddImportOnSelection.tooltip"));
setDescription(JavaEditorMessages.getString("AddImportOnSelection.description"));
fEditor= editor;
WorkbenchHelp.setHelp(this, IJavaHelpContextIds.ADD_IMPORT_ON_SELECTION_ACTION);
}
public AddImportOnSelectionAction() {
this(null);
}
public void setContentEditor(ITextEditor editor) {
fEditor= editor;
}
public void update() {
ISelection selection= fEditor.getSelectionProvider().getSelection();
setEnabled(selection instanceof ITextSelection);
}
private ICompilationUnit getCompilationUnit () {
IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();
return manager.getWorkingCopy(fEditor.getEditorInput());
}
/**
* @see IAction#actionPerformed
*/
|
14,368 |
Bug 14368 Create getter and setter insert code into read-only file
|
1. Create a class C as follow: package jp1; public class C { private int id; } 2. Close it and mark it as read only 3. Reopen it and you should not be able to modify anything 4. From the outline view, select "id - int" and right mouse click and select "Create getter and setter". 5. The class becomes package jp1; public class C { private int id; /** * Gets the id. * @return Returns a int */ public int getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(int id) { this.id = id; } } and the editor is dirty, but you cannot save it until clear the read-only flag.
|
resolved fixed
|
e6ed913
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-04-26T12:41:25Z | 2002-04-22T21:13:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/AddImportOnSelectionAction.java
|
public void run() {
ICompilationUnit cu= getCompilationUnit();
if (cu != null) {
ISelection s= fEditor.getSelectionProvider().getSelection();
IDocument doc= fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput());
ITextSelection selection= (ITextSelection) s;
if (doc != null) {
try {
int nameStart= getNameStart(doc, selection.getOffset());
int nameEnd= getNameEnd(doc, selection.getOffset() + selection.getLength());
int len= nameEnd - nameStart;
String name= doc.get(nameStart, len).trim();
String simpleName= Signature.getSimpleName(name);
String containerName= Signature.getQualifier(name);
IJavaSearchScope searchScope= SearchEngine.createJavaSearchScope(new IJavaElement[] { cu.getJavaProject() });
TypeInfo[] types= findAllTypes(simpleName, searchScope, null);
if (types.length== 0) {
getShell().getDisplay().beep();
return;
}
TypeInfo chosen= selectResult(types, containerName, getShell());
if (chosen == null) {
return;
}
IType type= chosen.resolveType(searchScope);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.