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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,156 |
Bug 7156 Search using previous search from Java Search page's list gives wrong results
|
1. Search via Java Search page (search dialog) 2. Search for something else 3. Select the first Search from the drop down 4. Search ==> searched for wrong java element
|
verified fixed
|
680070c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T12:08:25Z | 2001-12-21T10:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
|
GridLayout layout= new GridLayout();
layout.numColumns= 2;
result.setLayout(layout);
fLimitTo= new Button[fLimitToText.length];
for (int i= 0; i < fLimitToText.length; i++) {
Button button= new Button(result, SWT.RADIO);
button.setText(fLimitToText[i]);
fLimitTo[i]= button;
}
return result;
}
private void initSelections() {
ISelection selection= getSelection();
fInitialData= null;
fInitialData= tryTypedTextSelection(selection);
if (fInitialData == null)
fInitialData= trySelection(selection);
if (fInitialData == null)
fInitialData= trySimpleTextSelection(selection);
if (fInitialData == null)
fInitialData= getDefaultInitValues();
fJavaElement= fInitialData.javaElement;
fCaseSensitive.setSelection(fInitialData.isCaseSensitive);
fCaseSensitive.setEnabled(fInitialData.javaElement == null);
fSearchFor[fInitialData.searchFor].setSelection(true);
setLimitTo(fInitialData.searchFor);
fLimitTo[fInitialData.limitTo].setSelection(true);
fPattern.setText(fInitialData.pattern);
}
|
7,156 |
Bug 7156 Search using previous search from Java Search page's list gives wrong results
|
1. Search via Java Search page (search dialog) 2. Search for something else 3. Select the first Search from the drop down 4. Search ==> searched for wrong java element
|
verified fixed
|
680070c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T12:08:25Z | 2001-12-21T10:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
|
private SearchPatternData tryTypedTextSelection(ISelection selection) {
if (selection instanceof ITextSelection) {
IEditorPart e= getEditorPart();
if (e != null) {
ITextSelection ts= (ITextSelection)selection;
ICodeAssist assist= getCodeAssist(e);
if (assist != null) {
IJavaElement[] elements= null;
try {
elements= assist.codeSelect(ts.getOffset(), ts.getLength());
} catch (JavaModelException ex) {
ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.createJavaElement.title"), SearchMessages.getString("Search.Error.createJavaElement.message"));
}
if (elements != null && elements.length > 0) {
IJavaElement javaElement;
if (elements.length == 1)
javaElement= elements[0];
else
javaElement= chooseFromList(elements);
if (javaElement != null)
return determineInitValuesFrom(javaElement);
}
}
}
}
return null;
}
private ICodeAssist getCodeAssist(IEditorPart editorPart) {
IEditorInput input= editorPart.getEditorInput();
|
7,156 |
Bug 7156 Search using previous search from Java Search page's list gives wrong results
|
1. Search via Java Search page (search dialog) 2. Search for something else 3. Select the first Search from the drop down 4. Search ==> searched for wrong java element
|
verified fixed
|
680070c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T12:08:25Z | 2001-12-21T10:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
|
if (input instanceof IClassFileEditorInput)
return ((IClassFileEditorInput)input).getClassFile();
IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();
return manager.getWorkingCopy(input);
}
private SearchPatternData trySelection(ISelection selection) {
SearchPatternData result= null;
if (selection == null)
return result;
Object o= null;
if (selection instanceof IStructuredSelection)
o= ((IStructuredSelection)selection).getFirstElement();
if (o instanceof IJavaElement) {
result= determineInitValuesFrom((IJavaElement)o);
} else if (o instanceof ISearchResultViewEntry) {
IJavaElement element= getJavaElement(((ISearchResultViewEntry)o).getSelectedMarker());
result= determineInitValuesFrom(element);
} else if (o instanceof IAdaptable) {
IJavaElement element= (IJavaElement)((IAdaptable)o).getAdapter(IJavaElement.class);
if (element != null) {
result= determineInitValuesFrom(element);
} else {
IWorkbenchAdapter adapter= (IWorkbenchAdapter)((IAdaptable)o).getAdapter(IWorkbenchAdapter.class);
result= new SearchPatternData(TYPE, REFERENCES, adapter.getLabel(o), null);
}
}
return result;
}
private IJavaElement getJavaElement(IMarker marker) {
try {
|
7,156 |
Bug 7156 Search using previous search from Java Search page's list gives wrong results
|
1. Search via Java Search page (search dialog) 2. Search for something else 3. Select the first Search from the drop down 4. Search ==> searched for wrong java element
|
verified fixed
|
680070c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T12:08:25Z | 2001-12-21T10:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
|
return JavaCore.create((String)marker.getAttribute(IJavaSearchUIConstants.ATT_JE_HANDLE_ID));
} catch (CoreException ex) {
ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.createJavaElement.title"), SearchMessages.getString("Search.Error.createJavaElement.message"));
return null;
}
}
private SearchPatternData determineInitValuesFrom(IJavaElement element) {
if (element == null)
return null;
int searchFor= UNKNOWN;
int limitTo= UNKNOWN;
String pattern= null;
switch (element.getElementType()) {
case IJavaElement.PACKAGE_FRAGMENT:
searchFor= PACKAGE;
limitTo= REFERENCES;
pattern= element.getElementName();
break;
case IJavaElement.PACKAGE_FRAGMENT_ROOT:
searchFor= PACKAGE;
limitTo= REFERENCES;
pattern= element.getElementName();
break;
case IJavaElement.PACKAGE_DECLARATION:
searchFor= PACKAGE;
limitTo= REFERENCES;
pattern= element.getElementName();
break;
case IJavaElement.IMPORT_DECLARATION:
|
7,156 |
Bug 7156 Search using previous search from Java Search page's list gives wrong results
|
1. Search via Java Search page (search dialog) 2. Search for something else 3. Select the first Search from the drop down 4. Search ==> searched for wrong java element
|
verified fixed
|
680070c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T12:08:25Z | 2001-12-21T10:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
|
pattern= element.getElementName();
IImportDeclaration declaration= (IImportDeclaration)element;
if (declaration.isOnDemand()) {
searchFor= PACKAGE;
int index= pattern.lastIndexOf('.');
pattern= pattern.substring(0, index);
} else {
searchFor= TYPE;
}
limitTo= DECLARATIONS;
break;
case IJavaElement.TYPE:
searchFor= TYPE;
limitTo= REFERENCES;
pattern= JavaModelUtil.getFullyQualifiedName((IType)element);
break;
case IJavaElement.COMPILATION_UNIT:
ICompilationUnit cu= (ICompilationUnit)element;
String mainTypeName= element.getElementName().substring(0, element.getElementName().indexOf("."));
IType mainType= cu.getType(mainTypeName);
mainTypeName= JavaModelUtil.getTypeQualifiedName(mainType);
try {
mainType= JavaModelUtil.findTypeInCompilationUnit(cu, mainTypeName);
if (mainType == null) {
IType[] types= cu.getTypes();
if (types.length > 0)
mainType= types[0];
else
break;
|
7,156 |
Bug 7156 Search using previous search from Java Search page's list gives wrong results
|
1. Search via Java Search page (search dialog) 2. Search for something else 3. Select the first Search from the drop down 4. Search ==> searched for wrong java element
|
verified fixed
|
680070c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T12:08:25Z | 2001-12-21T10:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
|
}
} catch (JavaModelException ex) {
ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.javaElementAccess.title"), SearchMessages.getString("Search.Error.javaElementAccess.message"));
break;
}
searchFor= TYPE;
element= mainType;
limitTo= REFERENCES;
pattern= JavaModelUtil.getFullyQualifiedName((IType)mainType);
break;
case IJavaElement.CLASS_FILE:
IClassFile cf= (IClassFile)element;
try {
mainType= cf.getType();
} catch (JavaModelException ex) {
ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.javaElementAccess.title"), SearchMessages.getString("Search.Error.javaElementAccess.message"));
break;
}
if (mainType == null)
break;
element= mainType;
searchFor= TYPE;
limitTo= REFERENCES;
pattern= JavaModelUtil.getFullyQualifiedName(mainType);
break;
case IJavaElement.FIELD:
searchFor= FIELD;
limitTo= REFERENCES;
IType type= ((IField)element).getDeclaringType();
StringBuffer buffer= new StringBuffer();
|
7,156 |
Bug 7156 Search using previous search from Java Search page's list gives wrong results
|
1. Search via Java Search page (search dialog) 2. Search for something else 3. Select the first Search from the drop down 4. Search ==> searched for wrong java element
|
verified fixed
|
680070c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T12:08:25Z | 2001-12-21T10:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
|
buffer.append(JavaModelUtil.getFullyQualifiedName(type));
buffer.append('.');
buffer.append(element.getElementName());
pattern= buffer.toString();
break;
case IJavaElement.METHOD:
searchFor= METHOD;
try {
IMethod method= (IMethod)element;
if (method.isConstructor())
searchFor= CONSTRUCTOR;
} catch (JavaModelException ex) {
ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.javaElementAccess.title"), SearchMessages.getString("Search.Error.javaElementAccess.message"));
break;
}
limitTo= REFERENCES;
pattern= PrettySignature.getMethodSignature((IMethod)element);
break;
}
if (searchFor != UNKNOWN && limitTo != UNKNOWN && pattern != null)
return new SearchPatternData(searchFor, limitTo, pattern, element);
return null;
}
private SearchPatternData trySimpleTextSelection(ISelection selection) {
SearchPatternData result= null;
if (selection instanceof ITextSelection) {
BufferedReader reader= new BufferedReader(new StringReader(((ITextSelection)selection).getText()));
String text;
|
7,156 |
Bug 7156 Search using previous search from Java Search page's list gives wrong results
|
1. Search via Java Search page (search dialog) 2. Search for something else 3. Select the first Search from the drop down 4. Search ==> searched for wrong java element
|
verified fixed
|
680070c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T12:08:25Z | 2001-12-21T10:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
|
try {
text= reader.readLine();
if (text == null)
text= "";
} catch (IOException ex) {
text= "";
}
result= new SearchPatternData(TYPE, REFERENCES, text, null);
}
return result;
}
private SearchPatternData getDefaultInitValues() {
return new SearchPatternData(TYPE, REFERENCES, "", null);
}
private IJavaElement chooseFromList(IJavaElement[] openChoices) {
int flags= JavaElementLabelProvider.SHOW_DEFAULT | JavaElementLabelProvider.SHOW_QUALIFIED;
ILabelProvider labelProvider= new JavaElementLabelProvider(flags);
ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), labelProvider);
dialog.setTitle(SearchMessages.getString("SearchElementSelectionDialog.title"));
dialog.setMessage(SearchMessages.getString("SearchElementSelectionDialog.message"));
dialog.setElements(openChoices);
if (dialog.open() == dialog.OK)
return (IJavaElement)dialog.getFirstResult();
return null;
}
/*
* Implements method from ISearchPage
*/
public void setContainer(ISearchPageContainer container) {
|
7,156 |
Bug 7156 Search using previous search from Java Search page's list gives wrong results
|
1. Search via Java Search page (search dialog) 2. Search for something else 3. Select the first Search from the drop down 4. Search ==> searched for wrong java element
|
verified fixed
|
680070c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T12:08:25Z | 2001-12-21T10:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
|
fContainer= container;
}
/**
* Returns the search page's container.
*/
private ISearchPageContainer getContainer() {
return fContainer;
}
/**
* Returns the current active selection.
*/
private ISelection getSelection() {
return fContainer.getSelection();
}
/**
* Returns the current active editor part.
*/
private IEditorPart getEditorPart() {
IWorkbenchWindow window= JavaPlugin.getActiveWorkbenchWindow();
if (window != null) {
IWorkbenchPage page= window.getActivePage();
if (page != null)
return page.getActiveEditor();
}
return null;
}
|
7,156 |
Bug 7156 Search using previous search from Java Search page's list gives wrong results
|
1. Search via Java Search page (search dialog) 2. Search for something else 3. Select the first Search from the drop down 4. Search ==> searched for wrong java element
|
verified fixed
|
680070c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T12:08:25Z | 2001-12-21T10:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
|
/**
* Returns the page settings for this Java search page.
*
* @return the page settings to be used
*/
private IDialogSettings getDialogSettings() {
IDialogSettings settings= JavaPlugin.getDefault().getDialogSettings();
fDialogSettings= settings.getSection(PAGE_NAME);
if (fDialogSettings == null)
fDialogSettings= settings.addNewSection(PAGE_NAME);
return fDialogSettings;
}
/**
* Initializes itself from the stored page settings.
*/
private void readConfiguration() {
IDialogSettings s= getDialogSettings();
fIsCaseSensitive= s.getBoolean(STORE_CASE_SENSITIVE);
}
/**
* Stores it current configuration in the dialog store.
*/
private void writeConfiguration() {
IDialogSettings s= getDialogSettings();
s.put(STORE_CASE_SENSITIVE, fIsCaseSensitive);
}
}
|
6,824 |
Bug 6824 SWT "out of bounds" exception when clicking in packages view
|
Build: 2001-12-06, Win2000. Sorry, I have very little information to go on. I was working away, and I got a very generic "Internal Error" dialog... it gave no interesting information (check log). When I clicked OK on that dialog, the VM immediately exited. I believe making a selection in the packages view was my last action before death happened. I also had several java editors open. I'm logging the bug here because at first glance "LinkedPositionUI.getMinimumLocation" seems to be the offending code. The log contained only the following stack trace: Log: Tue Dec 11 16:49:49 EST 2001 4 org.eclipse.ui 0 Index out of bounds java.lang.IllegalArgumentException: Index out of bounds at org.eclipse.swt.SWT.error(SWT.java:1873) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.getMinimumLocation(Linked PositionUI.java:323) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.paintControl(LinkedPositi onUI.java:307) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java(Compiled Code)) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.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:758) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362)
|
resolved fixed
|
7245370
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T14:25:11Z | 2001-12-11T22:33:20Z |
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.widgets.Shell;
import org.eclipse.jface.dialogs.MessageDialog;
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;
|
6,824 |
Bug 6824 SWT "out of bounds" exception when clicking in packages view
|
Build: 2001-12-06, Win2000. Sorry, I have very little information to go on. I was working away, and I got a very generic "Internal Error" dialog... it gave no interesting information (check log). When I clicked OK on that dialog, the VM immediately exited. I believe making a selection in the packages view was my last action before death happened. I also had several java editors open. I'm logging the bug here because at first glance "LinkedPositionUI.getMinimumLocation" seems to be the offending code. The log contained only the following stack trace: Log: Tue Dec 11 16:49:49 EST 2001 4 org.eclipse.ui 0 Index out of bounds java.lang.IllegalArgumentException: Index out of bounds at org.eclipse.swt.SWT.error(SWT.java:1873) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.getMinimumLocation(Linked PositionUI.java:323) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.paintControl(LinkedPositi onUI.java:307) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java(Compiled Code)) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.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:758) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362)
|
resolved fixed
|
7245370
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T14:25:11Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.util.Assert;
import org.eclipse.jdt.internal.ui.JavaPlugin;
/**
* A user interface for <code>LinkedPositionManager</code>, using <code>ITextViewer</code>.
*/
public class LinkedPositionUI implements LinkedPositionListener,
ITextInputListener, ModifyListener, VerifyListener, VerifyKeyListener, PaintListener {
/**
* A listener for notification when the user cancelled the edit operation.
*/
public interface ExitListener {
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 final ITextViewer fViewer;
private final LinkedPositionManager fManager;
private final Color fFrameColor;
private int fFinalCaretOffset= -1;
private Position fFramePosition;
|
6,824 |
Bug 6824 SWT "out of bounds" exception when clicking in packages view
|
Build: 2001-12-06, Win2000. Sorry, I have very little information to go on. I was working away, and I got a very generic "Internal Error" dialog... it gave no interesting information (check log). When I clicked OK on that dialog, the VM immediately exited. I believe making a selection in the packages view was my last action before death happened. I also had several java editors open. I'm logging the bug here because at first glance "LinkedPositionUI.getMinimumLocation" seems to be the offending code. The log contained only the following stack trace: Log: Tue Dec 11 16:49:49 EST 2001 4 org.eclipse.ui 0 Index out of bounds java.lang.IllegalArgumentException: Index out of bounds at org.eclipse.swt.SWT.error(SWT.java:1873) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.getMinimumLocation(Linked PositionUI.java:323) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.paintControl(LinkedPositi onUI.java:307) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java(Compiled Code)) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.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:758) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362)
|
resolved fixed
|
7245370
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T14:25:11Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
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) {
Assert.isNotNull(viewer);
Assert.isNotNull(manager);
fViewer= viewer;
fManager= manager;
fManager.setLinkedPositionListener(this);
fFrameColor= viewer.getTextWidget().getDisplay().getSystemColor(SWT.COLOR_RED);
}
/**
* 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
|
6,824 |
Bug 6824 SWT "out of bounds" exception when clicking in packages view
|
Build: 2001-12-06, Win2000. Sorry, I have very little information to go on. I was working away, and I got a very generic "Internal Error" dialog... it gave no interesting information (check log). When I clicked OK on that dialog, the VM immediately exited. I believe making a selection in the packages view was my last action before death happened. I also had several java editors open. I'm logging the bug here because at first glance "LinkedPositionUI.getMinimumLocation" seems to be the offending code. The log contained only the following stack trace: Log: Tue Dec 11 16:49:49 EST 2001 4 org.eclipse.ui 0 Index out of bounds java.lang.IllegalArgumentException: Index out of bounds at org.eclipse.swt.SWT.error(SWT.java:1873) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.getMinimumLocation(Linked PositionUI.java:323) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.paintControl(LinkedPositi onUI.java:307) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java(Compiled Code)) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.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:758) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362)
|
resolved fixed
|
7245370
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T14:25:11Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
* is exited unsuccessfully by hitting ESC.
*/
public void setCancelListener(ExitListener listener) {
fExitListener= listener;
}
/*
* @see LinkedPositionManager.LinkedPositionListener#setCurrentPositions(Position, int)
*/
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) {
|
6,824 |
Bug 6824 SWT "out of bounds" exception when clicking in packages view
|
Build: 2001-12-06, Win2000. Sorry, I have very little information to go on. I was working away, and I got a very generic "Internal Error" dialog... it gave no interesting information (check log). When I clicked OK on that dialog, the VM immediately exited. I believe making a selection in the packages view was my last action before death happened. I also had several java editors open. I'm logging the bug here because at first glance "LinkedPositionUI.getMinimumLocation" seems to be the offending code. The log contained only the following stack trace: Log: Tue Dec 11 16:49:49 EST 2001 4 org.eclipse.ui 0 Index out of bounds java.lang.IllegalArgumentException: Index out of bounds at org.eclipse.swt.SWT.error(SWT.java:1873) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.getMinimumLocation(Linked PositionUI.java:323) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.paintControl(LinkedPositi onUI.java:307) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java(Compiled Code)) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.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:758) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362)
|
resolved fixed
|
7245370
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T14:25:11Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
openErrorDialog(fViewer.getTextWidget().getShell(), e);
} catch (BadPositionCategoryException e) {
JavaPlugin.log(e);
Assert.isTrue(false);
}
fViewer.addTextInputListener(this);
StyledText text= fViewer.getTextWidget();
text.addVerifyListener(this);
text.addVerifyKeyListener(this);
text.addModifyListener(this);
text.addPaintListener(this);
text.showSelection();
fFramePosition= fManager.getFirstPosition();
if (fFramePosition == null)
leave(UNINSTALL | COMMIT | UPDATE_CARET);
}
/**
* @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)
|
6,824 |
Bug 6824 SWT "out of bounds" exception when clicking in packages view
|
Build: 2001-12-06, Win2000. Sorry, I have very little information to go on. I was working away, and I got a very generic "Internal Error" dialog... it gave no interesting information (check log). When I clicked OK on that dialog, the VM immediately exited. I believe making a selection in the packages view was my last action before death happened. I also had several java editors open. I'm logging the bug here because at first glance "LinkedPositionUI.getMinimumLocation" seems to be the offending code. The log contained only the following stack trace: Log: Tue Dec 11 16:49:49 EST 2001 4 org.eclipse.ui 0 Index out of bounds java.lang.IllegalArgumentException: Index out of bounds at org.eclipse.swt.SWT.error(SWT.java:1873) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.getMinimumLocation(Linked PositionUI.java:323) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.paintControl(LinkedPositi onUI.java:307) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java(Compiled Code)) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.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:758) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362)
|
resolved fixed
|
7245370
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T14:25:11Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
return new Region(fFinalCaretOffset, 0);
else
return new Region(fFramePosition.getOffset(), fFramePosition.getLength());
}
private void leave(int flags) {
if ((flags & UNINSTALL) != 0)
fManager.uninstall((flags & COMMIT) != 0);
StyledText text= fViewer.getTextWidget();
text.removePaintListener(this);
text.removeModifyListener(this);
text.removeVerifyKeyListener(this);
text.removeVerifyListener(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);
}
}
|
6,824 |
Bug 6824 SWT "out of bounds" exception when clicking in packages view
|
Build: 2001-12-06, Win2000. Sorry, I have very little information to go on. I was working away, and I got a very generic "Internal Error" dialog... it gave no interesting information (check log). When I clicked OK on that dialog, the VM immediately exited. I believe making a selection in the packages view was my last action before death happened. I also had several java editors open. I'm logging the bug here because at first glance "LinkedPositionUI.getMinimumLocation" seems to be the offending code. The log contained only the following stack trace: Log: Tue Dec 11 16:49:49 EST 2001 4 org.eclipse.ui 0 Index out of bounds java.lang.IllegalArgumentException: Index out of bounds at org.eclipse.swt.SWT.error(SWT.java:1873) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.getMinimumLocation(Linked PositionUI.java:323) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.paintControl(LinkedPositi onUI.java:307) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java(Compiled Code)) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.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:758) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362)
|
resolved fixed
|
7245370
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T14:25:11Z | 2001-12-11T22:33:20Z |
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();
Position position= fManager.getPreviousPosition(fFramePosition.getOffset());
|
6,824 |
Bug 6824 SWT "out of bounds" exception when clicking in packages view
|
Build: 2001-12-06, Win2000. Sorry, I have very little information to go on. I was working away, and I got a very generic "Internal Error" dialog... it gave no interesting information (check log). When I clicked OK on that dialog, the VM immediately exited. I believe making a selection in the packages view was my last action before death happened. I also had several java editors open. I'm logging the bug here because at first glance "LinkedPositionUI.getMinimumLocation" seems to be the offending code. The log contained only the following stack trace: Log: Tue Dec 11 16:49:49 EST 2001 4 org.eclipse.ui 0 Index out of bounds java.lang.IllegalArgumentException: Index out of bounds at org.eclipse.swt.SWT.error(SWT.java:1873) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.getMinimumLocation(Linked PositionUI.java:323) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.paintControl(LinkedPositi onUI.java:307) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java(Compiled Code)) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.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:758) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362)
|
resolved fixed
|
7245370
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T14:25:11Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
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;
}
}
if (event.stateMask == SWT.SHIFT)
previous();
|
6,824 |
Bug 6824 SWT "out of bounds" exception when clicking in packages view
|
Build: 2001-12-06, Win2000. Sorry, I have very little information to go on. I was working away, and I got a very generic "Internal Error" dialog... it gave no interesting information (check log). When I clicked OK on that dialog, the VM immediately exited. I believe making a selection in the packages view was my last action before death happened. I also had several java editors open. I'm logging the bug here because at first glance "LinkedPositionUI.getMinimumLocation" seems to be the offending code. The log contained only the following stack trace: Log: Tue Dec 11 16:49:49 EST 2001 4 org.eclipse.ui 0 Index out of bounds java.lang.IllegalArgumentException: Index out of bounds at org.eclipse.swt.SWT.error(SWT.java:1873) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.getMinimumLocation(Linked PositionUI.java:323) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.paintControl(LinkedPositi onUI.java:307) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java(Compiled Code)) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.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:758) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362)
|
resolved fixed
|
7245370
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T14:25:11Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
else
next();
event.doit= false;
break;
case 0x1B:
leave(UNINSTALL);
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))
leave(UNINSTALL | COMMIT);
}
/*
* @see PaintListener#paintControl(PaintEvent)
*/
public void paintControl(PaintEvent event) {
if (fFramePosition == null)
|
6,824 |
Bug 6824 SWT "out of bounds" exception when clicking in packages view
|
Build: 2001-12-06, Win2000. Sorry, I have very little information to go on. I was working away, and I got a very generic "Internal Error" dialog... it gave no interesting information (check log). When I clicked OK on that dialog, the VM immediately exited. I believe making a selection in the packages view was my last action before death happened. I also had several java editors open. I'm logging the bug here because at first glance "LinkedPositionUI.getMinimumLocation" seems to be the offending code. The log contained only the following stack trace: Log: Tue Dec 11 16:49:49 EST 2001 4 org.eclipse.ui 0 Index out of bounds java.lang.IllegalArgumentException: Index out of bounds at org.eclipse.swt.SWT.error(SWT.java:1873) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.getMinimumLocation(Linked PositionUI.java:323) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.paintControl(LinkedPositi onUI.java:307) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java(Compiled Code)) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.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:758) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362)
|
resolved fixed
|
7245370
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T14:25:11Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
return;
IRegion region= fViewer.getVisibleRegion();
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);
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;
}
|
6,824 |
Bug 6824 SWT "out of bounds" exception when clicking in packages view
|
Build: 2001-12-06, Win2000. Sorry, I have very little information to go on. I was working away, and I got a very generic "Internal Error" dialog... it gave no interesting information (check log). When I clicked OK on that dialog, the VM immediately exited. I believe making a selection in the packages view was my last action before death happened. I also had several java editors open. I'm logging the bug here because at first glance "LinkedPositionUI.getMinimumLocation" seems to be the offending code. The log contained only the following stack trace: Log: Tue Dec 11 16:49:49 EST 2001 4 org.eclipse.ui 0 Index out of bounds java.lang.IllegalArgumentException: Index out of bounds at org.eclipse.swt.SWT.error(SWT.java:1873) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.getMinimumLocation(Linked PositionUI.java:323) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.paintControl(LinkedPositi onUI.java:307) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java(Compiled Code)) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.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:758) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362)
|
resolved fixed
|
7245370
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T14:25:11Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
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();
int offset= fFramePosition.getOffset() - region.getOffset();
int length= fFramePosition.getLength();
fViewer.getTextWidget().redrawRange(offset, length, true);
}
private void selectRegion() {
IRegion region= fViewer.getVisibleRegion();
int start= fFramePosition.getOffset() - region.getOffset();
int end= fFramePosition.getLength() + start;
fViewer.getTextWidget().setSelection(start, end);
}
private void updateCaret() {
IRegion region= fViewer.getVisibleRegion();
|
6,824 |
Bug 6824 SWT "out of bounds" exception when clicking in packages view
|
Build: 2001-12-06, Win2000. Sorry, I have very little information to go on. I was working away, and I got a very generic "Internal Error" dialog... it gave no interesting information (check log). When I clicked OK on that dialog, the VM immediately exited. I believe making a selection in the packages view was my last action before death happened. I also had several java editors open. I'm logging the bug here because at first glance "LinkedPositionUI.getMinimumLocation" seems to be the offending code. The log contained only the following stack trace: Log: Tue Dec 11 16:49:49 EST 2001 4 org.eclipse.ui 0 Index out of bounds java.lang.IllegalArgumentException: Index out of bounds at org.eclipse.swt.SWT.error(SWT.java:1873) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java(Compiled Code)) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.getMinimumLocation(Linked PositionUI.java:323) at org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.paintControl(LinkedPositi onUI.java:307) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java(Compiled Code)) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.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:758) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:82 0) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362)
|
resolved fixed
|
7245370
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-21T14:25:11Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
|
int offset= fFramePosition.getOffset() + fCaretOffset - region.getOffset();
if ((offset >= 0) && (offset <= region.getLength()))
fViewer.getTextWidget().setCaretOffset(offset);
}
/*
* @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) {
}
}
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
package org.eclipse.jdt.internal.ui.preferences;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.help.DialogPageContextComputer;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration;
import org.eclipse.jdt.ui.text.JavaTextTools;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.text.template.Template;
import org.eclipse.jdt.internal.ui.text.template.TemplateContentProvider;
import org.eclipse.jdt.internal.ui.text.template.TemplateContext;
import org.eclipse.jdt.internal.ui.text.template.TemplateLabelProvider;
import org.eclipse.jdt.internal.ui.text.template.TemplateMessages;
import org.eclipse.jdt.internal.ui.text.template.TemplateSet;
import org.eclipse.jdt.internal.ui.text.template.Templates;
import org.eclipse.jdt.internal.ui.util.SWTUtil;
public class TemplatePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
private static final String PREF_FORMAT_TEMPLATES= JavaUI.ID_PLUGIN + ".template.format";
private Templates fTemplates;
private CheckboxTableViewer fTableViewer;
private Button fAddButton;
private Button fEditButton;
private Button fImportButton;
private Button fExportButton;
private Button fExportAllButton;
private Button fRemoveButton;
private Button fEnableAllButton;
private Button fDisableAllButton;
private SourceViewer fPatternViewer;
private Button fFormatButton;
public TemplatePreferencePage() {
super();
setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore());
setDescription(TemplateMessages.getString("TemplatePreferencePage.message"));
fTemplates= Templates.getInstance();
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
}
/**
* @see PreferencePage#createContents(Composite)
*/
protected Control createContents(Composite ancestor) {
Composite parent= new Composite(ancestor, SWT.NULL);
GridLayout layout= new GridLayout();
layout.numColumns= 2;
layout.marginHeight= 0;
layout.marginWidth= 0;
parent.setLayout(layout);
fTableViewer= new CheckboxTableViewer(parent, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
Table table= fTableViewer.getTable();
GridData data= new GridData(GridData.FILL_BOTH);
data.widthHint= convertWidthInCharsToPixels(80);
data.heightHint= convertHeightInCharsToPixels(10);
fTableViewer.getTable().setLayoutData(data);
table.setHeaderVisible(true);
table.setLinesVisible(true);
TableLayout tableLayout= new TableLayout();
table.setLayout(tableLayout);
TableColumn column1= new TableColumn(table, SWT.NULL);
column1.setText(TemplateMessages.getString("TemplatePreferencePage.column.name"));
TableColumn column2= new TableColumn(table, SWT.NULL);
column2.setText(TemplateMessages.getString("TemplatePreferencePage.column.context"));
TableColumn column3= new TableColumn(table, SWT.NULL);
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
column3.setText(TemplateMessages.getString("TemplatePreferencePage.column.description"));
tableLayout.addColumnData(new ColumnWeightData(30));
tableLayout.addColumnData(new ColumnWeightData(20));
tableLayout.addColumnData(new ColumnWeightData(70));
fTableViewer.setLabelProvider(new TemplateLabelProvider());
fTableViewer.setContentProvider(new TemplateContentProvider());
fTableViewer.setSorter(new ViewerSorter() {
public int compare(Viewer viewer, Object object1, Object object2) {
if ((object1 instanceof Template) && (object2 instanceof Template)) {
Template left= (Template) object1;
Template right= (Template) object2;
int result= left.getName().compareToIgnoreCase(right.getName());
if (result != 0)
return result;
return left.getDescription().compareToIgnoreCase(right.getDescription());
}
return super.compare(viewer, object1, object2);
}
public boolean isSorterProperty(Object element, String property) {
return true;
}
});
fTableViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent e) {
edit();
}
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
});
fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent e) {
selectionChanged1();
}
});
fTableViewer.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
Template template= (Template) event.getElement();
template.setEnabled(event.getChecked());
}
});
Composite buttons= new Composite(parent, SWT.NULL);
buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
layout= new GridLayout();
layout.marginHeight= 0;
layout.marginWidth= 0;
buttons.setLayout(layout);
fAddButton= new Button(buttons, SWT.PUSH);
fAddButton.setLayoutData(getButtonGridData(fAddButton));
fAddButton.setText(TemplateMessages.getString("TemplatePreferencePage.new"));
fAddButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
add();
}
});
fEditButton= new Button(buttons, SWT.PUSH);
fEditButton.setLayoutData(getButtonGridData(fEditButton));
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
fEditButton.setText(TemplateMessages.getString("TemplatePreferencePage.edit"));
fEditButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
edit();
}
});
fRemoveButton= new Button(buttons, SWT.PUSH);
fRemoveButton.setLayoutData(getButtonGridData(fRemoveButton));
fRemoveButton.setText(TemplateMessages.getString("TemplatePreferencePage.remove"));
fRemoveButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
remove();
}
});
createSpacer(buttons);
fImportButton= new Button(buttons, SWT.PUSH);
fImportButton.setLayoutData(getButtonGridData(fImportButton));
fImportButton.setText(TemplateMessages.getString("TemplatePreferencePage.import"));
fImportButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
import_();
}
});
fExportButton= new Button(buttons, SWT.PUSH);
fExportButton.setLayoutData(getButtonGridData(fExportButton));
fExportButton.setText(TemplateMessages.getString("TemplatePreferencePage.export"));
fExportButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
export();
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
}
});
fExportAllButton= new Button(buttons, SWT.PUSH);
fExportAllButton.setLayoutData(getButtonGridData(fExportAllButton));
fExportAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.export.all"));
fExportAllButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
exportAll();
}
});
createSpacer(buttons);
fEnableAllButton= new Button(buttons, SWT.PUSH);
fEnableAllButton.setLayoutData(getButtonGridData(fEnableAllButton));
fEnableAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.enable.all"));
fEnableAllButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
enableAll(true);
}
});
fDisableAllButton= new Button(buttons, SWT.PUSH);
fDisableAllButton.setLayoutData(getButtonGridData(fDisableAllButton));
fDisableAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.disable.all"));
fDisableAllButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
enableAll(false);
}
});
fPatternViewer= createViewer(parent);
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
createSpacer(parent);
fFormatButton= new Button(parent, SWT.CHECK);
fFormatButton.setText(TemplateMessages.getString("TemplatePreferencePage.use.code.formatter"));
fTableViewer.setInput(fTemplates);
fTableViewer.setAllChecked(false);
fTableViewer.setCheckedElements(getEnabledTemplates());
IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();
fFormatButton.setSelection(prefs.getBoolean(PREF_FORMAT_TEMPLATES));
updateButtons();
WorkbenchHelp.setHelp(parent, new DialogPageContextComputer(this, IJavaHelpContextIds.TEMPLATE_PREFERENCE_PAGE));
return parent;
}
private Template[] getEnabledTemplates() {
Template[] templates= fTemplates.getTemplates();
List list= new ArrayList(templates.length);
for (int i= 0; i != templates.length; i++)
if (templates[i].isEnabled())
list.add(templates[i]);
return (Template[]) list.toArray(new Template[list.size()]);
}
private SourceViewer createViewer(Composite parent) {
SourceViewer viewer= new SourceViewer(parent, null, SWT.BORDER );
JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
viewer.configure(new JavaSourceViewerConfiguration(tools, null));
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
viewer.setEditable(false);
viewer.setDocument(new Document());
Font font= JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT);
viewer.getTextWidget().setFont(font);
Control control= viewer.getControl();
GridData data= new GridData(GridData.FILL_BOTH);
data.heightHint= convertHeightInCharsToPixels(5);
control.setLayoutData(data);
return viewer;
}
public void createSpacer(Composite parent) {
Label spacer= new Label(parent, SWT.NONE);
GridData data= new GridData();
data.horizontalAlignment= GridData.FILL;
data.verticalAlignment= GridData.BEGINNING;
data.heightHint= 4;
spacer.setLayoutData(data);
}
private static GridData getButtonGridData(Button button) {
GridData data= new GridData(GridData.FILL_HORIZONTAL);
data.widthHint= SWTUtil.getButtonWidthHint(button);
data.heightHint= SWTUtil.getButtonHeigthHint(button);
return data;
}
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
private void selectionChanged1() {
IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection();
if (selection.size() == 1) {
Template template= (Template) selection.getFirstElement();
fPatternViewer.getTextWidget().setText(template.getPattern());
} else {
fPatternViewer.getTextWidget().setText("");
}
updateButtons();
}
private void updateButtons() {
int selectionCount= ((IStructuredSelection) fTableViewer.getSelection()).size();
int itemCount= fTableViewer.getTable().getItemCount();
fEditButton.setEnabled(selectionCount == 1);
fExportButton.setEnabled(selectionCount > 0);
fRemoveButton.setEnabled(selectionCount > 0 && selectionCount <= itemCount);
fEnableAllButton.setEnabled(itemCount > 0);
fDisableAllButton.setEnabled(itemCount > 0);
}
private void add() {
Template template= new Template();
template.setContext(TemplateContext.JAVA);
EditTemplateDialog dialog= new EditTemplateDialog(getShell(), template, false);
if (dialog.open() == dialog.OK) {
fTemplates.add(template);
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
fTableViewer.refresh();
fTableViewer.setChecked(template, template.isEnabled());
fTableViewer.setSelection(new StructuredSelection(template));
}
}
private void edit() {
IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection();
Object[] objects= selection.toArray();
if ((objects == null) || (objects.length != 1))
return;
Template template= (Template) selection.getFirstElement();
edit(template);
}
private void edit(Template template) {
EditTemplateDialog dialog= new EditTemplateDialog(getShell(), template, true);
if (dialog.open() == dialog.OK) {
fTableViewer.refresh(template);
fTableViewer.setChecked(template, template.isEnabled());
fTableViewer.setSelection(new StructuredSelection(template));
}
}
private void import_() {
FileDialog dialog= new FileDialog(getShell());
dialog.setText(TemplateMessages.getString("TemplatePreferencePage.import.title"));
dialog.setFilterExtensions(new String[] {TemplateMessages.getString("TemplatePreferencePage.import.extension")});
String path= dialog.open();
if (path == null)
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
return;
try {
fTemplates.addFromFile(new File(path));
fTableViewer.refresh();
fTableViewer.setAllChecked(false);
fTableViewer.setCheckedElements(getEnabledTemplates());
} catch (CoreException e) {
JavaPlugin.log(e);
openReadErrorDialog(e);
}
}
private void exportAll() {
export(fTemplates);
}
private void export() {
IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection();
Object[] templates= selection.toArray();
TemplateSet templateSet= new TemplateSet();
for (int i= 0; i != templates.length; i++)
templateSet.add((Template) templates[i]);
export(templateSet);
}
private void export(TemplateSet templateSet) {
FileDialog dialog= new FileDialog(getShell(), SWT.SAVE);
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
dialog.setText(TemplateMessages.getFormattedString("TemplatePreferencePage.export.title", new Integer(templateSet.getTemplates().length)));
dialog.setFilterExtensions(new String[] {TemplateMessages.getString("TemplatePreferencePage.export.extension")});
dialog.setFileName(TemplateMessages.getString("TemplatePreferencePage.export.filename"));
String path= dialog.open();
if (path == null)
return;
try {
templateSet.saveToFile(new File(path));
} catch (CoreException e) {
JavaPlugin.log(e);
openWriteErrorDialog(e);
}
}
private void remove() {
IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection();
Iterator elements= selection.iterator();
while (elements.hasNext()) {
Template template= (Template) elements.next();
fTemplates.remove(template);
}
fTableViewer.refresh();
}
private void enableAll(boolean enable) {
Template[] templates= fTemplates.getTemplates();
for (int i= 0; i != templates.length; i++)
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
templates[i].setEnabled(enable);
fTableViewer.setAllChecked(enable);
}
/*
* @see IWorkbenchPreferencePage#init(IWorkbench)
*/
public void init(IWorkbench workbench) {}
/*
* @see Control#setVisible(boolean)
*/
public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible)
setTitle(TemplateMessages.getString("TemplatePreferencePage.title"));
}
/*
* @see PreferencePage#performDefaults()
*/
protected void performDefaults() {
IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();
fFormatButton.setSelection(prefs.getDefaultBoolean(PREF_FORMAT_TEMPLATES));
try {
fTemplates.restoreDefaults();
} catch (CoreException e) {
JavaPlugin.log(e);
openReadErrorDialog(e);
}
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
fTableViewer.refresh();
fTableViewer.setAllChecked(false);
fTableViewer.setCheckedElements(getEnabledTemplates());
}
/*
* @see PreferencePage#performOk()
*/
public boolean performOk() {
IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();
prefs.setValue(PREF_FORMAT_TEMPLATES, fFormatButton.getSelection());
try {
fTemplates.save();
} catch (CoreException e) {
JavaPlugin.log(e);
openWriteErrorDialog(e);
}
return super.performOk();
}
/*
* @see PreferencePage#performCancel()
*/
public boolean performCancel() {
try {
fTemplates.reset();
} catch (CoreException e) {
JavaPlugin.log(e);
|
6,582 |
Bug 6582 VMPreferencePage - CheckboxTableViewer has no columns anymore
|
20011204: CheckboxTableViewer has no more columns upon creation. You have to create the first column as well. I encountered the same problem in TemplatePreferencePage, because I used the same code as in VMPreferencePage.
|
verified fixed
|
a4ac68d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T15:14:44Z | 2001-12-05T11:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
|
openReadErrorDialog(e);
}
return super.performCancel();
}
/**
* Initializes the default values of this page in the preference bundle.
* Will be called on startup of the JavaPlugin
*/
public static void initDefaults(IPreferenceStore prefs) {
prefs.setDefault(PREF_FORMAT_TEMPLATES, true);
}
public static boolean useCodeFormatter() {
IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();
return prefs.getBoolean(PREF_FORMAT_TEMPLATES);
}
private void openReadErrorDialog(CoreException e) {
ErrorDialog.openError(getShell(),
TemplateMessages.getString("TemplatePreferencePage.error.read.title"),
e.getMessage(), e.getStatus());
}
private void openWriteErrorDialog(CoreException e) {
ErrorDialog.openError(getShell(),
TemplateMessages.getString("TemplatePreferencePage.error.write.title"),
e.getMessage(), e.getStatus());
}
}
|
5,346 |
Bug 5346 Debugger silently fails to prompt for source
|
20011025 Drop The debugger silently fails to bring up the source prompt dialog when the class file does not exist in the workspace. For example, I created Test.java in the filesystem public class Test { public static void main(String[] args) { while(true) { System.out.println(System.currentTimeMillis()); try { Thread.sleep(1000); } catch (InterruptedException ie) { return; } } } } I ran in via the command line and the JDI debug flags. I started the 20011025 version of Eclipse and started a remote debug launch. The debugger connected to the VM. I clicked the main method and hit pause. I clicked "step out" to get out of the Thread.sleep(long) call. I then could not get the debugger to prompt me for source.
|
verified fixed
|
b19cb6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T21:07:56Z | 2001-10-30T00:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
|
package org.eclipse.jdt.internal.ui.javaeditor;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
|
5,346 |
Bug 5346 Debugger silently fails to prompt for source
|
20011025 Drop The debugger silently fails to bring up the source prompt dialog when the class file does not exist in the workspace. For example, I created Test.java in the filesystem public class Test { public static void main(String[] args) { while(true) { System.out.println(System.currentTimeMillis()); try { Thread.sleep(1000); } catch (InterruptedException ie) { return; } } } } I ran in via the command line and the JDI debug flags. I started the 20011025 version of Eclipse and started a remote debug launch. The debugger connected to the VM. I clicked the main method and hit pause. I clicked "step out" to get out of the Thread.sleep(long) call. I then could not get the debugger to prompt me for source.
|
verified fixed
|
b19cb6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T21:07:56Z | 2001-10-30T00:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
|
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentListener;
import org.eclipse.jface.text.IDocumentPartitioner;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.jface.util.Assert;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.editors.text.FileDocumentProvider;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel;
import org.eclipse.ui.texteditor.MarkerAnnotation;
import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel;
import org.eclipse.jdt.core.BufferChangedEvent;
import org.eclipse.jdt.core.IBuffer;
import org.eclipse.jdt.core.IBufferChangedListener;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaModelStatusConstants;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.IWorkingCopyManager;
import org.eclipse.jdt.ui.text.JavaTextTools;
import org.eclipse.jdt.internal.core.JavaModelStatus;
import org.eclipse.jdt.internal.ui.JavaPlugin;
public class CompilationUnitDocumentProvider extends FileDocumentProvider implements IWorkingCopyManager {
|
5,346 |
Bug 5346 Debugger silently fails to prompt for source
|
20011025 Drop The debugger silently fails to bring up the source prompt dialog when the class file does not exist in the workspace. For example, I created Test.java in the filesystem public class Test { public static void main(String[] args) { while(true) { System.out.println(System.currentTimeMillis()); try { Thread.sleep(1000); } catch (InterruptedException ie) { return; } } } } I ran in via the command line and the JDI debug flags. I started the 20011025 version of Eclipse and started a remote debug launch. The debugger connected to the VM. I clicked the main method and hit pause. I clicked "step out" to get out of the Thread.sleep(long) call. I then could not get the debugger to prompt me for source.
|
verified fixed
|
b19cb6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T21:07:56Z | 2001-10-30T00:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
|
/**
* Synchronizes the buffer of a working copy with the document representing the buffer content.
* It would be more appropriate if the document could also serve as the working copy's buffer.
* Listens to buffer changes and translates those into document changes. Also listens to document
* changes and translates those into buffer changes, respectively.
*/
protected static class BufferSynchronizer implements IDocumentListener, IBufferChangedListener {
protected IDocument fDocument;
protected IBuffer fBuffer;
public BufferSynchronizer(IDocument document, ICompilationUnit unit) {
Assert.isNotNull(document);
Assert.isNotNull(unit);
fDocument= document;
try {
fBuffer= unit.getBuffer();
} catch (JavaModelException x) {
Assert.isNotNull(fBuffer);
}
}
|
5,346 |
Bug 5346 Debugger silently fails to prompt for source
|
20011025 Drop The debugger silently fails to bring up the source prompt dialog when the class file does not exist in the workspace. For example, I created Test.java in the filesystem public class Test { public static void main(String[] args) { while(true) { System.out.println(System.currentTimeMillis()); try { Thread.sleep(1000); } catch (InterruptedException ie) { return; } } } } I ran in via the command line and the JDI debug flags. I started the 20011025 version of Eclipse and started a remote debug launch. The debugger connected to the VM. I clicked the main method and hit pause. I clicked "step out" to get out of the Thread.sleep(long) call. I then could not get the debugger to prompt me for source.
|
verified fixed
|
b19cb6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T21:07:56Z | 2001-10-30T00:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
|
/**
* Installs the synchronizer to listen to document
* as well as buffer changes.
*/
public void install() {
fDocument.addDocumentListener(this);
fBuffer.addBufferChangedListener(this);
}
/**
* Uninstalls the synchronizer. The synchronizer does no
* longer listen to buffer or document changes.
*/
public void uninstall() {
fDocument.removeDocumentListener(this);
fBuffer.removeBufferChangedListener(this);
}
/**
* @see IDocumentListener#documentChanged
*/
public void documentChanged(DocumentEvent event) {
fBuffer.removeBufferChangedListener(this);
fBuffer.replace(event.getOffset(), event.getLength(), event.getText());
fBuffer.addBufferChangedListener(this);
}
/**
* @see IDocumentListener#documentAboutToBeChanged
*/
|
5,346 |
Bug 5346 Debugger silently fails to prompt for source
|
20011025 Drop The debugger silently fails to bring up the source prompt dialog when the class file does not exist in the workspace. For example, I created Test.java in the filesystem public class Test { public static void main(String[] args) { while(true) { System.out.println(System.currentTimeMillis()); try { Thread.sleep(1000); } catch (InterruptedException ie) { return; } } } } I ran in via the command line and the JDI debug flags. I started the 20011025 version of Eclipse and started a remote debug launch. The debugger connected to the VM. I clicked the main method and hit pause. I clicked "step out" to get out of the Thread.sleep(long) call. I then could not get the debugger to prompt me for source.
|
verified fixed
|
b19cb6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T21:07:56Z | 2001-10-30T00:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
|
public void documentAboutToBeChanged(DocumentEvent event) {
}
/**
* @see IBufferChangedListener#bufferChanged
*/
public void bufferChanged(BufferChangedEvent event) {
fDocument.removeDocumentListener(this);
try {
if (event.getLength() > 0 || event.getText() != null)
fDocument.replace(event.getOffset(), event.getLength(), event.getText());
} catch (BadLocationException x) {
Assert.isTrue(false, JavaEditorMessages.getString("CompilationUnitDocumentProvider.out_of_sync.message"));
} finally {
fDocument.addDocumentListener(this);
}
}
};
protected class _FileSynchronizer extends FileSynchronizer {
public _FileSynchronizer(IFileEditorInput fileEditorInput) {
super(fileEditorInput);
}
};
/**
* Bundle of all required informations to allow working copy management.
*/
protected class CompilationUnitInfo extends FileInfo {
|
5,346 |
Bug 5346 Debugger silently fails to prompt for source
|
20011025 Drop The debugger silently fails to bring up the source prompt dialog when the class file does not exist in the workspace. For example, I created Test.java in the filesystem public class Test { public static void main(String[] args) { while(true) { System.out.println(System.currentTimeMillis()); try { Thread.sleep(1000); } catch (InterruptedException ie) { return; } } } } I ran in via the command line and the JDI debug flags. I started the 20011025 version of Eclipse and started a remote debug launch. The debugger connected to the VM. I clicked the main method and hit pause. I clicked "step out" to get out of the Thread.sleep(long) call. I then could not get the debugger to prompt me for source.
|
verified fixed
|
b19cb6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T21:07:56Z | 2001-10-30T00:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
|
ICompilationUnit fCopy;
BufferSynchronizer fBufferSynchronizer;
CompilationUnitInfo(IDocument document, IAnnotationModel model, _FileSynchronizer fileSynchronizer, ICompilationUnit copy, BufferSynchronizer bufferSynchronizer) {
super(document, model, fileSynchronizer);
fCopy= copy;
fBufferSynchronizer= bufferSynchronizer;
}
void setModificationStamp(long timeStamp) {
fModificationStamp= timeStamp;
}
};
protected class CompilationUnitMarkerAnnotationModel extends ResourceMarkerAnnotationModel {
public CompilationUnitMarkerAnnotationModel(IResource resource) {
super(resource);
}
protected MarkerAnnotation createMarkerAnnotation(IMarker marker) {
return new JavaMarkerAnnotation(marker);
}
};
|
5,346 |
Bug 5346 Debugger silently fails to prompt for source
|
20011025 Drop The debugger silently fails to bring up the source prompt dialog when the class file does not exist in the workspace. For example, I created Test.java in the filesystem public class Test { public static void main(String[] args) { while(true) { System.out.println(System.currentTimeMillis()); try { Thread.sleep(1000); } catch (InterruptedException ie) { return; } } } } I ran in via the command line and the JDI debug flags. I started the 20011025 version of Eclipse and started a remote debug launch. The debugger connected to the VM. I clicked the main method and hit pause. I clicked "step out" to get out of the Thread.sleep(long) call. I then could not get the debugger to prompt me for source.
|
verified fixed
|
b19cb6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T21:07:56Z | 2001-10-30T00:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
|
private ISavePolicy fSavePolicy;
/**
* Constructor
*/
public CompilationUnitDocumentProvider() {
}
/**
* Sets the document provider's save policy.
*/
public void setSavePolicy(ISavePolicy savePolicy) {
fSavePolicy= savePolicy;
}
protected ICompilationUnit createCompilationUnit(IFile file) {
Object element= JavaCore.create(file);
if (element instanceof ICompilationUnit)
return (ICompilationUnit) element;
return null;
}
/**
* @see AbstractDocumentProvider#createElementInfo(Object)
*/
protected ElementInfo createElementInfo(Object element) throws CoreException {
if ( !(element instanceof IFileEditorInput))
throw new CoreException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_RESOURCE_TYPE));
|
5,346 |
Bug 5346 Debugger silently fails to prompt for source
|
20011025 Drop The debugger silently fails to bring up the source prompt dialog when the class file does not exist in the workspace. For example, I created Test.java in the filesystem public class Test { public static void main(String[] args) { while(true) { System.out.println(System.currentTimeMillis()); try { Thread.sleep(1000); } catch (InterruptedException ie) { return; } } } } I ran in via the command line and the JDI debug flags. I started the 20011025 version of Eclipse and started a remote debug launch. The debugger connected to the VM. I clicked the main method and hit pause. I clicked "step out" to get out of the Thread.sleep(long) call. I then could not get the debugger to prompt me for source.
|
verified fixed
|
b19cb6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T21:07:56Z | 2001-10-30T00:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
|
IFileEditorInput input= (IFileEditorInput) element;
ICompilationUnit original= createCompilationUnit(input.getFile());
if (original != null) {
try {
try {
input.getFile().refreshLocal(IResource.DEPTH_INFINITE, null);
} catch (CoreException x) {
handleCoreException(x, JavaEditorMessages.getString("CompilationUnitDocumentProvider.error.createElementInfo"));
}
ICompilationUnit c= (ICompilationUnit) original.getWorkingCopy();
IDocument d= createCompilationUnitDocument(c);
IAnnotationModel m= createCompilationUnitAnnotationModel(element);
_FileSynchronizer f= new _FileSynchronizer(input);
f.install();
BufferSynchronizer b= new BufferSynchronizer(d, c);
b.install();
CompilationUnitInfo info= new CompilationUnitInfo(d, m, f, c, b);
info.setModificationStamp(computeModificationStamp(input.getFile()));
return info;
} catch (JavaModelException x) {
throw new CoreException(x.getStatus());
}
} else {
return super.createElementInfo(element);
|
5,346 |
Bug 5346 Debugger silently fails to prompt for source
|
20011025 Drop The debugger silently fails to bring up the source prompt dialog when the class file does not exist in the workspace. For example, I created Test.java in the filesystem public class Test { public static void main(String[] args) { while(true) { System.out.println(System.currentTimeMillis()); try { Thread.sleep(1000); } catch (InterruptedException ie) { return; } } } } I ran in via the command line and the JDI debug flags. I started the 20011025 version of Eclipse and started a remote debug launch. The debugger connected to the VM. I clicked the main method and hit pause. I clicked "step out" to get out of the Thread.sleep(long) call. I then could not get the debugger to prompt me for source.
|
verified fixed
|
b19cb6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T21:07:56Z | 2001-10-30T00:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
|
}
}
/**
* @see AbstractDocumentProvider#disposeElementInfo(Object, ElementInfo)
*/
protected void disposeElementInfo(Object element, ElementInfo info) {
if (info instanceof CompilationUnitInfo) {
CompilationUnitInfo cuInfo= (CompilationUnitInfo) info;
if (cuInfo.fBufferSynchronizer != null)
cuInfo.fBufferSynchronizer.uninstall();
cuInfo.fCopy.destroy();
}
super.disposeElementInfo(element, info);
}
/**
* @see AbstractDocumentProvider#changed(Object)
*/
public void changed(Object element) {
ElementInfo elementInfo= getElementInfo(element);
if (elementInfo instanceof CompilationUnitInfo) {
CompilationUnitInfo info= (CompilationUnitInfo) elementInfo;
if (info.fBufferSynchronizer != null)
info.fBufferSynchronizer.install();
|
5,346 |
Bug 5346 Debugger silently fails to prompt for source
|
20011025 Drop The debugger silently fails to bring up the source prompt dialog when the class file does not exist in the workspace. For example, I created Test.java in the filesystem public class Test { public static void main(String[] args) { while(true) { System.out.println(System.currentTimeMillis()); try { Thread.sleep(1000); } catch (InterruptedException ie) { return; } } } } I ran in via the command line and the JDI debug flags. I started the 20011025 version of Eclipse and started a remote debug launch. The debugger connected to the VM. I clicked the main method and hit pause. I clicked "step out" to get out of the Thread.sleep(long) call. I then could not get the debugger to prompt me for source.
|
verified fixed
|
b19cb6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T21:07:56Z | 2001-10-30T00:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
|
}
super.changed(element);
}
/**
* @see AbstractDocumentProvider#doSaveDocument(IProgressMonitor, Object, IDocument, boolean)
*/
protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
ElementInfo elementInfo= getElementInfo(element);
if (elementInfo instanceof CompilationUnitInfo) {
CompilationUnitInfo info= (CompilationUnitInfo) elementInfo;
try {
info.fCopy.reconcile();
ICompilationUnit original= (ICompilationUnit) info.fCopy.getOriginalElement();
IResource resource= original.getUnderlyingResource();
if (resource != null && !overwrite)
checkSynchronizationState(info.fModificationStamp, resource);
if (fSavePolicy != null)
fSavePolicy.preSave(info.fCopy);
if (info.fBufferSynchronizer != null)
info.fBufferSynchronizer.uninstall();
|
5,346 |
Bug 5346 Debugger silently fails to prompt for source
|
20011025 Drop The debugger silently fails to bring up the source prompt dialog when the class file does not exist in the workspace. For example, I created Test.java in the filesystem public class Test { public static void main(String[] args) { while(true) { System.out.println(System.currentTimeMillis()); try { Thread.sleep(1000); } catch (InterruptedException ie) { return; } } } } I ran in via the command line and the JDI debug flags. I started the 20011025 version of Eclipse and started a remote debug launch. The debugger connected to the VM. I clicked the main method and hit pause. I clicked "step out" to get out of the Thread.sleep(long) call. I then could not get the debugger to prompt me for source.
|
verified fixed
|
b19cb6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T21:07:56Z | 2001-10-30T00:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
|
info.fCopy.commit(overwrite, monitor);
AbstractMarkerAnnotationModel model= (AbstractMarkerAnnotationModel) info.fModel;
model.updateMarkers(info.fDocument);
if (resource != null)
info.setModificationStamp(computeModificationStamp(resource));
if (fSavePolicy != null) {
ICompilationUnit unit= fSavePolicy.postSave(original);
if (unit != null) {
IResource r= unit.getUnderlyingResource();
IMarker[] markers= r.findMarkers(IMarker.MARKER, true, IResource.DEPTH_ZERO);
if (markers != null && markers.length > 0) {
for (int i= 0; i < markers.length; i++)
model.updateMarker(markers[i], info.fDocument, null);
}
}
}
} catch (JavaModelException x) {
throw new CoreException(x.getStatus());
}
} else {
super.doSaveDocument(monitor, element, document, overwrite);
}
}
|
5,346 |
Bug 5346 Debugger silently fails to prompt for source
|
20011025 Drop The debugger silently fails to bring up the source prompt dialog when the class file does not exist in the workspace. For example, I created Test.java in the filesystem public class Test { public static void main(String[] args) { while(true) { System.out.println(System.currentTimeMillis()); try { Thread.sleep(1000); } catch (InterruptedException ie) { return; } } } } I ran in via the command line and the JDI debug flags. I started the 20011025 version of Eclipse and started a remote debug launch. The debugger connected to the VM. I clicked the main method and hit pause. I clicked "step out" to get out of the Thread.sleep(long) call. I then could not get the debugger to prompt me for source.
|
verified fixed
|
b19cb6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T21:07:56Z | 2001-10-30T00:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
|
/**
* Replaces createAnnotionModel of the super class
*/
protected IAnnotationModel createCompilationUnitAnnotationModel(Object element) throws CoreException {
if ( !(element instanceof IFileEditorInput))
throw new CoreException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_RESOURCE_TYPE));
IFileEditorInput input= (IFileEditorInput) element;
return new CompilationUnitMarkerAnnotationModel(input.getFile());
}
/**
* Replaces createDocument of the super class.
*/
protected IDocument createCompilationUnitDocument(ICompilationUnit unit) throws CoreException {
String contents= "";
try {
contents= unit.getSource();
} catch (JavaModelException x) {
throw new CoreException(x.getStatus());
}
Document document= new Document(contents);
JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
IDocumentPartitioner partitioner= tools.createDocumentPartitioner();
partitioner.connect(document);
document.setDocumentPartitioner(partitioner);
|
5,346 |
Bug 5346 Debugger silently fails to prompt for source
|
20011025 Drop The debugger silently fails to bring up the source prompt dialog when the class file does not exist in the workspace. For example, I created Test.java in the filesystem public class Test { public static void main(String[] args) { while(true) { System.out.println(System.currentTimeMillis()); try { Thread.sleep(1000); } catch (InterruptedException ie) { return; } } } } I ran in via the command line and the JDI debug flags. I started the 20011025 version of Eclipse and started a remote debug launch. The debugger connected to the VM. I clicked the main method and hit pause. I clicked "step out" to get out of the Thread.sleep(long) call. I then could not get the debugger to prompt me for source.
|
verified fixed
|
b19cb6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T21:07:56Z | 2001-10-30T00:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
|
return document;
}
/**
* @see AbstractDocumentProvider#resetDocument(Object)
*/
public void resetDocument(Object element) throws CoreException {
if (element == null)
return;
ElementInfo elementInfo= getElementInfo(element);
if (elementInfo instanceof CompilationUnitInfo) {
CompilationUnitInfo info= (CompilationUnitInfo) elementInfo;
if (info.fCanBeSaved) {
try {
ICompilationUnit original= (ICompilationUnit) info.fCopy.getOriginalElement();
fireElementContentAboutToBeReplaced(element);
removeUnchangedElementListeners(element, info);
info.fDocument.set(original.getSource());
info.fCanBeSaved= false;
addUnchangedElementListeners(element, info);
fireElementContentReplaced(element);
} catch (JavaModelException x) {
throw new CoreException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_RESOURCE, x));
|
5,346 |
Bug 5346 Debugger silently fails to prompt for source
|
20011025 Drop The debugger silently fails to bring up the source prompt dialog when the class file does not exist in the workspace. For example, I created Test.java in the filesystem public class Test { public static void main(String[] args) { while(true) { System.out.println(System.currentTimeMillis()); try { Thread.sleep(1000); } catch (InterruptedException ie) { return; } } } } I ran in via the command line and the JDI debug flags. I started the 20011025 version of Eclipse and started a remote debug launch. The debugger connected to the VM. I clicked the main method and hit pause. I clicked "step out" to get out of the Thread.sleep(long) call. I then could not get the debugger to prompt me for source.
|
verified fixed
|
b19cb6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T21:07:56Z | 2001-10-30T00:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
|
}
}
} else {
super.resetDocument(element);
}
}
/**
* @see IWorkingCopyManager#connect(IEditorInput)
*/
public void connect(IEditorInput input) throws CoreException {
super.connect(input);
}
/**
* @see IWorkingCopyManager#disconnect(IEditorInput)
*/
public void disconnect(IEditorInput input) {
super.disconnect(input);
}
/**
* @see IWorkingCopyManager#getWorkingCopy(Object)
*/
public ICompilationUnit getWorkingCopy(IEditorInput element) {
ElementInfo elementInfo= getElementInfo(element);
if (elementInfo instanceof CompilationUnitInfo) {
CompilationUnitInfo info= (CompilationUnitInfo) elementInfo;
return info.fCopy;
|
5,346 |
Bug 5346 Debugger silently fails to prompt for source
|
20011025 Drop The debugger silently fails to bring up the source prompt dialog when the class file does not exist in the workspace. For example, I created Test.java in the filesystem public class Test { public static void main(String[] args) { while(true) { System.out.println(System.currentTimeMillis()); try { Thread.sleep(1000); } catch (InterruptedException ie) { return; } } } } I ran in via the command line and the JDI debug flags. I started the 20011025 version of Eclipse and started a remote debug launch. The debugger connected to the VM. I clicked the main method and hit pause. I clicked "step out" to get out of the Thread.sleep(long) call. I then could not get the debugger to prompt me for source.
|
verified fixed
|
b19cb6e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-03T21:07:56Z | 2001-10-30T00:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
|
}
return null;
}
/**
* @see IWorkingCopyManager#shutdown
*/
public void shutdown() {
Iterator e= getConnectedElements();
while (e.hasNext())
disconnect(e.next());
}
/**
* Returns all working copies manages by this document provider.
*
* @return all managed working copies
*/
public ICompilationUnit[] getAllWorkingCopies() {
List result= new ArrayList(10);
for (Iterator iter= getConnectedElements(); iter.hasNext();) {
ElementInfo element= getElementInfo(iter.next());
if (element instanceof CompilationUnitInfo) {
CompilationUnitInfo info= (CompilationUnitInfo)element;
result.add(info.fCopy);
}
}
return (ICompilationUnit[]) result.toArray(new ICompilationUnit[result.size()]);
}
}
|
7,122 |
Bug 7122 Action Cleanup/Dispose
|
It would nice to have a package that was strictly for actions...just like jdt debug ui. org.eclipse.debug.iternal.ui.actions
|
closed wontfix
|
a5e098d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T02:36:24Z | 2001-12-20T03:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.preferences;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
|
7,122 |
Bug 7122 Action Cleanup/Dispose
|
It would nice to have a package that was strictly for actions...just like jdt debug ui. org.eclipse.debug.iternal.ui.actions
|
closed wontfix
|
a5e098d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T02:36:24Z | 2001-12-20T03:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
|
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.debug.internal.ui.TextViewerAction;
import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.IAction;
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.resource.JFaceResources;
import org.eclipse.jface.text.Document;
|
7,122 |
Bug 7122 Action Cleanup/Dispose
|
It would nice to have a package that was strictly for actions...just like jdt debug ui. org.eclipse.debug.iternal.ui.actions
|
closed wontfix
|
a5e098d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T02:36:24Z | 2001-12-20T03:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
|
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextListener;
import org.eclipse.jface.text.ITextOperationTarget;
import org.eclipse.jface.text.TextEvent;
import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.IContentAssistant;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
import org.eclipse.ui.texteditor.IUpdate;
import org.eclipse.jdt.ui.IContextMenuConstants;
import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration;
import org.eclipse.jdt.ui.text.JavaTextTools;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.dialogs.StatusDialog;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.text.template.Template;
import org.eclipse.jdt.internal.ui.text.template.TemplateContext;
import org.eclipse.jdt.internal.ui.text.template.TemplateInterpolator;
import org.eclipse.jdt.internal.ui.text.template.TemplateMessages;
import org.eclipse.jdt.internal.ui.text.template.TemplateVariableProcessor;
import org.eclipse.jdt.internal.ui.text.template.VariableEvaluator;
import org.eclipse.jdt.internal.ui.util.SWTUtil;
/**
* Dialog to edit a template.
*/
public class EditTemplateDialog extends StatusDialog {
|
7,122 |
Bug 7122 Action Cleanup/Dispose
|
It would nice to have a package that was strictly for actions...just like jdt debug ui. org.eclipse.debug.iternal.ui.actions
|
closed wontfix
|
a5e098d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T02:36:24Z | 2001-12-20T03:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
|
private static class SimpleJavaSourceViewerConfiguration extends JavaSourceViewerConfiguration {
SimpleJavaSourceViewerConfiguration(JavaTextTools tools, ITextEditor editor) {
super(tools, editor);
}
/*
* @see SourceViewerConfiguration#getContentAssistant(ISourceViewer)
*/
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
ContentAssistant assistant= new ContentAssistant();
assistant.setContentAssistProcessor(new TemplateVariableProcessor(), IDocument.DEFAULT_CONTENT_TYPE);
assistant.enableAutoActivation(true);
assistant.setAutoActivationDelay(500);
assistant.setProposalPopupOrientation(assistant.PROPOSAL_OVERLAY);
assistant.setContextInformationPopupOrientation(assistant.CONTEXT_INFO_ABOVE);
assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
Color background= getColorManager().getColor(new RGB(254, 241, 233));
assistant.setContextInformationPopupBackground(background);
assistant.setContextSelectorBackground(background);
assistant.setProposalSelectorBackground(background);
return assistant;
}
}
private static class TemplateVerifier implements VariableEvaluator {
|
7,122 |
Bug 7122 Action Cleanup/Dispose
|
It would nice to have a package that was strictly for actions...just like jdt debug ui. org.eclipse.debug.iternal.ui.actions
|
closed wontfix
|
a5e098d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T02:36:24Z | 2001-12-20T03:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
|
private String fErrorMessage;
private boolean fHasAdjacentVariables;
private boolean fEndsWithVariable;
public void reset() {
fErrorMessage= null;
fHasAdjacentVariables= false;
fEndsWithVariable= false;
}
public void acceptError(String message) {
if (fErrorMessage == null)
fErrorMessage= message;
}
public void acceptText(String text) {
if (text.length() > 0)
fEndsWithVariable= false;
}
|
7,122 |
Bug 7122 Action Cleanup/Dispose
|
It would nice to have a package that was strictly for actions...just like jdt debug ui. org.eclipse.debug.iternal.ui.actions
|
closed wontfix
|
a5e098d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T02:36:24Z | 2001-12-20T03:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
|
public void acceptVariable(String variable) {
if (fEndsWithVariable)
fHasAdjacentVariables= true;
fEndsWithVariable= true;
}
public boolean hasErrors() {
return fHasAdjacentVariables || (fErrorMessage != null);
}
public String getErrorMessage() {
if (fHasAdjacentVariables)
return TemplateMessages.getString("EditTemplateDialog.error.adjacent.variables");
return fErrorMessage;
}
}
private Template fTemplate;
private Text fNameText;
private Text fDescriptionText;
private Combo fContextCombo;
private SourceViewer fPatternEditor;
private Button fInsertVariableButton;
private TemplateInterpolator fInterpolator= new TemplateInterpolator();
private TemplateVerifier fVerifier= new TemplateVerifier();
private boolean fSuppressError= true;
private Map fGlobalActions= new HashMap(10);
private List fSelectionActions = new ArrayList(3);
|
7,122 |
Bug 7122 Action Cleanup/Dispose
|
It would nice to have a package that was strictly for actions...just like jdt debug ui. org.eclipse.debug.iternal.ui.actions
|
closed wontfix
|
a5e098d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T02:36:24Z | 2001-12-20T03:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
|
public EditTemplateDialog(Shell parent, Template template, boolean edit) {
super(parent);
int shellStyle= getShellStyle();
setShellStyle(shellStyle | SWT.MAX | SWT.RESIZE);
if (edit)
setTitle(TemplateMessages.getString("EditTemplateDialog.title.edit"));
else
setTitle(TemplateMessages.getString("EditTemplateDialog.title.new"));
fTemplate= template;
}
/*
* @see Dialog#createDialogArea(Composite)
*/
protected Control createDialogArea(Composite ancestor) {
Composite parent= new Composite(ancestor, SWT.NONE);
GridLayout layout= new GridLayout();
layout.numColumns= 2;
parent.setLayout(layout);
parent.setLayoutData(new GridData(GridData.FILL_BOTH));
createLabel(parent, TemplateMessages.getString("EditTemplateDialog.name"));
Composite composite= new Composite(parent, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
layout= new GridLayout();
layout.numColumns= 3;
|
7,122 |
Bug 7122 Action Cleanup/Dispose
|
It would nice to have a package that was strictly for actions...just like jdt debug ui. org.eclipse.debug.iternal.ui.actions
|
closed wontfix
|
a5e098d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T02:36:24Z | 2001-12-20T03:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
|
layout.marginWidth= 0;
layout.marginHeight= 0;
composite.setLayout(layout);
fNameText= createText(composite);
fNameText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
if (fSuppressError && (fNameText.getText().trim().length() != 0))
fSuppressError= false;
updateButtons();
}
});
createLabel(composite, TemplateMessages.getString("EditTemplateDialog.context"));
fContextCombo= new Combo(composite, SWT.READ_ONLY);
fContextCombo.setItems(new String[] {TemplateContext.JAVA, TemplateContext.JAVADOC});
createLabel(parent, TemplateMessages.getString("EditTemplateDialog.description"));
fDescriptionText= createText(parent);
composite= new Composite(parent, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_VERTICAL));
layout= new GridLayout();
layout.marginWidth= 0;
layout.marginHeight= 0;
composite.setLayout(layout);
createLabel(composite, TemplateMessages.getString("EditTemplateDialog.pattern"));
fPatternEditor= createEditor(parent);
Label filler= new Label(composite, SWT.NONE);
filler.setLayoutData(new GridData(GridData.FILL_VERTICAL));
fInsertVariableButton= new Button(composite, SWT.NONE);
|
7,122 |
Bug 7122 Action Cleanup/Dispose
|
It would nice to have a package that was strictly for actions...just like jdt debug ui. org.eclipse.debug.iternal.ui.actions
|
closed wontfix
|
a5e098d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T02:36:24Z | 2001-12-20T03:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
|
fInsertVariableButton.setLayoutData(getButtonGridData(fInsertVariableButton));
fInsertVariableButton.setText(TemplateMessages.getString("EditTemplateDialog.insert.variable"));
fInsertVariableButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
fPatternEditor.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
}
public void widgetDefaultSelected(SelectionEvent e) {}
});
fNameText.setText(fTemplate.getName());
fDescriptionText.setText(fTemplate.getDescription());
fContextCombo.select(getIndex(fTemplate.getContext()));
initializeActions();
return composite;
}
private static GridData getButtonGridData(Button button) {
GridData data= new GridData(GridData.FILL_HORIZONTAL);
data.heightHint= SWTUtil.getButtonHeigthHint(button);
return data;
}
private static Label createLabel(Composite parent, String name) {
Label label= new Label(parent, SWT.NULL);
label.setText(name);
label.setLayoutData(new GridData());
return label;
}
private static Text createText(Composite parent) {
Text text= new Text(parent, SWT.BORDER);
text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
7,122 |
Bug 7122 Action Cleanup/Dispose
|
It would nice to have a package that was strictly for actions...just like jdt debug ui. org.eclipse.debug.iternal.ui.actions
|
closed wontfix
|
a5e098d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T02:36:24Z | 2001-12-20T03:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
|
return text;
}
private SourceViewer createEditor(Composite parent) {
SourceViewer viewer= new SourceViewer(parent, null, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
viewer.configure(new SimpleJavaSourceViewerConfiguration(tools, null));
viewer.setEditable(true);
viewer.setDocument(new Document(fTemplate.getPattern()));
Font font= JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT);
viewer.getTextWidget().setFont(font);
Control control= viewer.getControl();
GridData data= new GridData(GridData.FILL_BOTH);
data.widthHint= convertWidthInCharsToPixels(60);
data.heightHint= convertHeightInCharsToPixels(5);
control.setLayoutData(data);
viewer.addTextListener(new ITextListener() {
public void textChanged(TextEvent event) {
fInterpolator.interpolate(event.getDocumentEvent().getDocument().get(), fVerifier);
updateUndoAction();
updateButtons();
}
});
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
updateSelectionDependentActions();
}
|
7,122 |
Bug 7122 Action Cleanup/Dispose
|
It would nice to have a package that was strictly for actions...just like jdt debug ui. org.eclipse.debug.iternal.ui.actions
|
closed wontfix
|
a5e098d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T02:36:24Z | 2001-12-20T03:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
|
});
viewer.getTextWidget().addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent e) {
handleKeyPressed(e);
}
public void keyReleased(KeyEvent e) {}
});
return viewer;
}
private void handleKeyPressed(KeyEvent event) {
if (event.stateMask != SWT.CTRL)
return;
switch (event.character) {
case ' ':
fPatternEditor.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
break;
case (int) 'z' - (int) 'a' + 1:
fPatternEditor.doOperation(ITextOperationTarget.UNDO);
break;
}
}
private void initializeActions() {
TextViewerAction action= new TextViewerAction(fPatternEditor, fPatternEditor.UNDO);
action.setText(TemplateMessages.getString("EditTemplateDialog.undo"));
fGlobalActions.put(ITextEditorActionConstants.UNDO, action);
action= new TextViewerAction(fPatternEditor, fPatternEditor.CUT);
|
7,122 |
Bug 7122 Action Cleanup/Dispose
|
It would nice to have a package that was strictly for actions...just like jdt debug ui. org.eclipse.debug.iternal.ui.actions
|
closed wontfix
|
a5e098d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T02:36:24Z | 2001-12-20T03:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
|
action.setText(TemplateMessages.getString("EditTemplateDialog.cut"));
fGlobalActions.put(ITextEditorActionConstants.CUT, action);
action= new TextViewerAction(fPatternEditor, fPatternEditor.COPY);
action.setText(TemplateMessages.getString("EditTemplateDialog.copy"));
fGlobalActions.put(ITextEditorActionConstants.COPY, action);
action= new TextViewerAction(fPatternEditor, fPatternEditor.PASTE);
action.setText(TemplateMessages.getString("EditTemplateDialog.paste"));
fGlobalActions.put(ITextEditorActionConstants.PASTE, action);
action= new TextViewerAction(fPatternEditor, fPatternEditor.SELECT_ALL);
action.setText(TemplateMessages.getString("EditTemplateDialog.select.all"));
fGlobalActions.put(ITextEditorActionConstants.SELECT_ALL, action);
action= new TextViewerAction(fPatternEditor, fPatternEditor.CONTENTASSIST_PROPOSALS);
action.setText(TemplateMessages.getString("EditTemplateDialog.content.assist"));
fGlobalActions.put("ContentAssistProposal", action);
fSelectionActions.add(ITextEditorActionConstants.CUT);
fSelectionActions.add(ITextEditorActionConstants.COPY);
fSelectionActions.add(ITextEditorActionConstants.PASTE);
MenuManager manager= new MenuManager(null, null);
manager.setRemoveAllWhenShown(true);
manager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager mgr) {
fillContextMenu(mgr);
}
});
StyledText text= fPatternEditor.getTextWidget();
Menu menu= manager.createContextMenu(text);
text.setMenu(menu);
}
|
7,122 |
Bug 7122 Action Cleanup/Dispose
|
It would nice to have a package that was strictly for actions...just like jdt debug ui. org.eclipse.debug.iternal.ui.actions
|
closed wontfix
|
a5e098d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T02:36:24Z | 2001-12-20T03:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
|
private void fillContextMenu(IMenuManager menu) {
menu.add(new GroupMarker(ITextEditorActionConstants.GROUP_UNDO));
menu.appendToGroup(ITextEditorActionConstants.GROUP_UNDO, (IAction) fGlobalActions.get(ITextEditorActionConstants.UNDO));
menu.add(new Separator(ITextEditorActionConstants.GROUP_EDIT));
menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, (IAction) fGlobalActions.get(ITextEditorActionConstants.CUT));
menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, (IAction) fGlobalActions.get(ITextEditorActionConstants.COPY));
menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, (IAction) fGlobalActions.get(ITextEditorActionConstants.PASTE));
menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, (IAction) fGlobalActions.get(ITextEditorActionConstants.SELECT_ALL));
menu.add(new Separator(IContextMenuConstants.GROUP_GENERATE));
menu.appendToGroup(IContextMenuConstants.GROUP_GENERATE, (IAction) fGlobalActions.get("ContentAssistProposal"));
}
protected void updateSelectionDependentActions() {
Iterator iterator= fSelectionActions.iterator();
while (iterator.hasNext())
updateAction((String)iterator.next());
}
protected void updateUndoAction() {
IAction action= (IAction) fGlobalActions.get(ITextEditorActionConstants.UNDO);
if (action instanceof IUpdate)
((IUpdate) action).update();
}
protected void updateAction(String actionId) {
IAction action= (IAction) fGlobalActions.get(actionId);
if (action instanceof IUpdate)
((IUpdate) action).update();
}
private static int getIndex(String context) {
if (context.equals(TemplateContext.JAVA))
return 0;
|
7,122 |
Bug 7122 Action Cleanup/Dispose
|
It would nice to have a package that was strictly for actions...just like jdt debug ui. org.eclipse.debug.iternal.ui.actions
|
closed wontfix
|
a5e098d
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T02:36:24Z | 2001-12-20T03:46:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
|
else if (context.equals(TemplateContext.JAVADOC))
return 1;
else
return -1;
}
protected void okPressed() {
fTemplate.setName(fNameText.getText());
fTemplate.setDescription(fDescriptionText.getText());
fTemplate.setContext(fContextCombo.getText());
fTemplate.setPattern(fPatternEditor.getTextWidget().getText());
super.okPressed();
}
private void updateButtons() {
boolean valid= fNameText.getText().trim().length() != 0;
StatusInfo status= new StatusInfo();
if (!valid) {
if (fSuppressError)
status.setError("");
else
status.setError(TemplateMessages.getString("EditTemplateDialog.error.noname"));
} else if (fVerifier.hasErrors()) {
status.setError(fVerifier.getErrorMessage());
}
updateStatus(status);
}
}
|
7,251 |
Bug 7251 compiler preference page: combo boxes should have equal sizes
|
combo boxes have different sizes - depending on whether the entry is 'error' or 'warning' - they should be equal-sized
|
verified fixed
|
ffb4e57
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T12:01:47Z | 2002-01-04T10:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.preferences;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Hashtable;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
|
7,251 |
Bug 7251 compiler preference page: combo boxes should have equal sizes
|
combo boxes have different sizes - depending on whether the entry is 'error' or 'warning' - they should be equal-sized
|
verified fixed
|
ffb4e57
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T12:01:47Z | 2002-01-04T10:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.help.DialogPageContextComputer;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
import org.eclipse.jdt.internal.ui.util.TabFolderLayout;
/*
* The page for setting the compiler options.
*/
public class CompilerPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
|
7,251 |
Bug 7251 compiler preference page: combo boxes should have equal sizes
|
combo boxes have different sizes - depending on whether the entry is 'error' or 'warning' - they should be equal-sized
|
verified fixed
|
ffb4e57
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T12:01:47Z | 2002-01-04T10:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
private static final String PREF_LOCAL_VARIABLE_ATTR= "org.eclipse.jdt.core.compiler.debug.localVariable";
private static final String PREF_LINE_NUMBER_ATTR= "org.eclipse.jdt.core.compiler.debug.lineNumber";
private static final String PREF_SOURCE_FILE_ATTR= "org.eclipse.jdt.core.compiler.debug.sourceFile";
private static final String PREF_CODEGEN_UNUSED_LOCAL= "org.eclipse.jdt.core.compiler.codegen.unusedLocal";
private static final String PREF_CODEGEN_TARGET_PLATFORM= "org.eclipse.jdt.core.compiler.codegen.targetPlatform";
private static final String PREF_PB_UNREACHABLE_CODE= "org.eclipse.jdt.core.compiler.problem.unreachableCode";
private static final String PREF_PB_INVALID_IMPORT= "org.eclipse.jdt.core.compiler.problem.invalidImport";
private static final String PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD= "org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod";
private static final String PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME= "org.eclipse.jdt.core.compiler.problem.methodWithConstructorName";
private static final String PREF_PB_DEPRECATION= "org.eclipse.jdt.core.compiler.problem.deprecation";
private static final String PREF_PB_HIDDEN_CATCH_BLOCK= "org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock";
private static final String PREF_PB_UNUSED_LOCAL= "org.eclipse.jdt.core.compiler.problem.unusedLocal";
private static final String PREF_PB_UNUSED_PARAMETER= "org.eclipse.jdt.core.compiler.problem.unusedParameter";
private static final String PREF_PB_SYNTHETIC_ACCESS_EMULATION= "org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation";
private static final String PREF_PB_NON_EXTERNALIZED_STRINGS= "org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral";
private static final String PREF_PB_ASSERT_AS_IDENTIFIER= "org.eclipse.jdt.core.compiler.problem.assertIdentifier";
private static final String PREF_SOURCE_COMPATIBILITY= "org.eclipse.jdt.core.compiler.source";
private static final String GENERATE= "generate";
private static final String DO_NOT_GENERATE= "do not generate";
private static final String PRESERVE= "preserve";
private static final String OPTIMIZE_OUT= "optimize out";
private static final String VERSION_1_1= "1.1";
private static final String VERSION_1_2= "1.2";
private static final String VERSION_1_3= "1.3";
private static final String VERSION_1_4= "1.4";
|
7,251 |
Bug 7251 compiler preference page: combo boxes should have equal sizes
|
combo boxes have different sizes - depending on whether the entry is 'error' or 'warning' - they should be equal-sized
|
verified fixed
|
ffb4e57
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T12:01:47Z | 2002-01-04T10:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
private static final String ERROR= "error";
private static final String WARNING= "warning";
private static final String IGNORE= "ignore";
private static String[] getAllKeys() {
return new String[] {
PREF_LOCAL_VARIABLE_ATTR, PREF_LINE_NUMBER_ATTR, PREF_SOURCE_FILE_ATTR, PREF_CODEGEN_UNUSED_LOCAL,
PREF_CODEGEN_TARGET_PLATFORM, PREF_PB_UNREACHABLE_CODE, PREF_PB_INVALID_IMPORT, PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD,
PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME, PREF_PB_DEPRECATION, PREF_PB_HIDDEN_CATCH_BLOCK, PREF_PB_UNUSED_LOCAL,
PREF_PB_UNUSED_PARAMETER, PREF_PB_SYNTHETIC_ACCESS_EMULATION, PREF_PB_NON_EXTERNALIZED_STRINGS,
PREF_PB_ASSERT_AS_IDENTIFIER, PREF_SOURCE_COMPATIBILITY
};
}
/**
* Initializes the current options (read from preference store)
*/
public static void initDefaults(IPreferenceStore store) {
Hashtable hashtable= JavaCore.getDefaultOptions();
Hashtable currOptions= JavaCore.getOptions();
String[] allKeys= getAllKeys();
for (int i= 0; i < allKeys.length; i++) {
String key= allKeys[i];
String defValue= (String) hashtable.get(key);
if (defValue != null) {
store.setDefault(key, defValue);
} else {
JavaPlugin.logErrorMessage("CompilerPreferencePage: value is null: " + key);
}
String val= store.getString(key);
|
7,251 |
Bug 7251 compiler preference page: combo boxes should have equal sizes
|
combo boxes have different sizes - depending on whether the entry is 'error' or 'warning' - they should be equal-sized
|
verified fixed
|
ffb4e57
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T12:01:47Z | 2002-01-04T10:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
if (val != null) {
currOptions.put(key, val);
}
}
JavaCore.setOptions(currOptions);
}
private static class ControlData {
private String fKey;
private String[] fValues;
public ControlData(String key, String[] values) {
fKey= key;
fValues= values;
}
public String getKey() {
return fKey;
}
public String getValue(boolean selection) {
int index= selection ? 0 : 1;
return fValues[index];
}
public String getValue(int index) {
return fValues[index];
}
public int getSelection(String value) {
for (int i= 0; i < fValues.length; i++) {
|
7,251 |
Bug 7251 compiler preference page: combo boxes should have equal sizes
|
combo boxes have different sizes - depending on whether the entry is 'error' or 'warning' - they should be equal-sized
|
verified fixed
|
ffb4e57
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T12:01:47Z | 2002-01-04T10:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
if (value.equals(fValues[i])) {
return i;
}
}
throw new IllegalArgumentException();
}
}
private Hashtable fWorkingValues;
private ArrayList fCheckBoxes;
private ArrayList fComboBoxes;
private SelectionListener fSelectionListener;
public CompilerPreferencePage() {
setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore());
setDescription(JavaUIMessages.getString("CompilerPreferencePage.description"));
fWorkingValues= JavaCore.getOptions();
fCheckBoxes= new ArrayList();
fComboBoxes= new ArrayList();
fSelectionListener= new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {}
public void widgetSelected(SelectionEvent e) {
controlChanged(e.widget);
}
};
}
/**
|
7,251 |
Bug 7251 compiler preference page: combo boxes should have equal sizes
|
combo boxes have different sizes - depending on whether the entry is 'error' or 'warning' - they should be equal-sized
|
verified fixed
|
ffb4e57
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T12:01:47Z | 2002-01-04T10:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
* @see IWorkbenchPreferencePage#init()
*/
public void init(IWorkbench workbench) {
}
/**
* @see PreferencePage#createControl(Composite)
*/
public void createControl(Composite parent) {
super.createControl(parent);
WorkbenchHelp.setHelp(getControl(), new DialogPageContextComputer(this, IJavaHelpContextIds.COMPILER_PREFERENCE_PAGE));
}
/**
* @see PreferencePage#createContents(Composite)
*/
protected Control createContents(Composite parent) {
TabFolder folder= new TabFolder(parent, SWT.NONE);
folder.setLayout(new TabFolderLayout());
folder.setLayoutData(new GridData(GridData.FILL_BOTH));
String[] errorWarningIgnore= new String[] { ERROR, WARNING, IGNORE };
String[] errorWarningIgnoreLabels= new String[] {
JavaUIMessages.getString("CompilerPreferencePage.error"),
JavaUIMessages.getString("CompilerPreferencePage.warning"),
JavaUIMessages.getString("CompilerPreferencePage.ignore")
};
GridLayout layout= new GridLayout();
layout.numColumns= 2;
|
7,251 |
Bug 7251 compiler preference page: combo boxes should have equal sizes
|
combo boxes have different sizes - depending on whether the entry is 'error' or 'warning' - they should be equal-sized
|
verified fixed
|
ffb4e57
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T12:01:47Z | 2002-01-04T10:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
Composite warningsComposite= new Composite(folder, SWT.NULL);
warningsComposite.setLayout(layout);
String label= JavaUIMessages.getString("CompilerPreferencePage.pb_unreachable_code.label");
addComboBox(warningsComposite, label, PREF_PB_UNREACHABLE_CODE, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_invalid_import.label");
addComboBox(warningsComposite, label, PREF_PB_INVALID_IMPORT, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_overriding_pkg_dflt.label");
addComboBox(warningsComposite, label, PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_method_naming.label");
addComboBox(warningsComposite, label, PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_deprecation.label");
addComboBox(warningsComposite, label, PREF_PB_DEPRECATION, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_hidden_catchblock.label");
addComboBox(warningsComposite, label, PREF_PB_HIDDEN_CATCH_BLOCK, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_unused_local.label");
addComboBox(warningsComposite, label, PREF_PB_UNUSED_LOCAL, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_unused_parameter.label");
addComboBox(warningsComposite, label, PREF_PB_UNUSED_PARAMETER, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_synth_access_emul.label");
addComboBox(warningsComposite, label, PREF_PB_SYNTHETIC_ACCESS_EMULATION, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_non_externalized_strings.label");
addComboBox(warningsComposite, label, PREF_PB_NON_EXTERNALIZED_STRINGS, errorWarningIgnore, errorWarningIgnoreLabels);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_assert_as_identifier.label");
addComboBox(warningsComposite, label, PREF_PB_ASSERT_AS_IDENTIFIER, errorWarningIgnore, errorWarningIgnoreLabels);
|
7,251 |
Bug 7251 compiler preference page: combo boxes should have equal sizes
|
combo boxes have different sizes - depending on whether the entry is 'error' or 'warning' - they should be equal-sized
|
verified fixed
|
ffb4e57
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T12:01:47Z | 2002-01-04T10:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
String[] generateValues= new String[] { GENERATE, DO_NOT_GENERATE };
layout= new GridLayout();
layout.numColumns= 2;
Composite codeGenComposite= new Composite(folder, SWT.NULL);
codeGenComposite.setLayout(layout);
label= JavaUIMessages.getString("CompilerPreferencePage.variable_attr.label");
addCheckBox(codeGenComposite, label, PREF_LOCAL_VARIABLE_ATTR, generateValues);
label= JavaUIMessages.getString("CompilerPreferencePage.line_number_attr.label");
addCheckBox(codeGenComposite, label, PREF_LINE_NUMBER_ATTR, generateValues);
label= JavaUIMessages.getString("CompilerPreferencePage.source_file_attr.label");
addCheckBox(codeGenComposite, label, PREF_SOURCE_FILE_ATTR, generateValues);
label= JavaUIMessages.getString("CompilerPreferencePage.codegen_unused_local.label");
addCheckBox(codeGenComposite, label, PREF_CODEGEN_UNUSED_LOCAL, new String[] { PRESERVE, OPTIMIZE_OUT });
String[] values= new String[] { VERSION_1_1, VERSION_1_2, VERSION_1_3, VERSION_1_4 };
String[] valuesLabels= new String[] {
JavaUIMessages.getString("CompilerPreferencePage.jvm11"),
JavaUIMessages.getString("CompilerPreferencePage.jvm12"),
JavaUIMessages.getString("CompilerPreferencePage.jvm13"),
JavaUIMessages.getString("CompilerPreferencePage.jvm14")
};
label= JavaUIMessages.getString("CompilerPreferencePage.codegen_targetplatform.label");
addComboBox(codeGenComposite, label, PREF_CODEGEN_TARGET_PLATFORM, values, valuesLabels);
values= new String[] { VERSION_1_3, VERSION_1_4 };
valuesLabels= new String[] {
JavaUIMessages.getString("CompilerPreferencePage.version13"),
JavaUIMessages.getString("CompilerPreferencePage.version14")
};
|
7,251 |
Bug 7251 compiler preference page: combo boxes should have equal sizes
|
combo boxes have different sizes - depending on whether the entry is 'error' or 'warning' - they should be equal-sized
|
verified fixed
|
ffb4e57
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T12:01:47Z | 2002-01-04T10:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
label= JavaUIMessages.getString("CompilerPreferencePage.source_compatibility.label");
addComboBox(codeGenComposite, label, PREF_SOURCE_COMPATIBILITY, values, valuesLabels);
TabItem item= new TabItem(folder, SWT.NONE);
item.setText(JavaUIMessages.getString("CompilerPreferencePage.warnings.tabtitle"));
item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_REFACTORING_WARNING));
item.setControl(warningsComposite);
item= new TabItem(folder, SWT.NONE);
item.setText(JavaUIMessages.getString("CompilerPreferencePage.generation.tabtitle"));
item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_CFILE));
item.setControl(codeGenComposite);
return folder;
}
private void addCheckBox(Composite parent, String label, String key, String[] values) {
ControlData data= new ControlData(key, values);
GridData gd= new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan= 2;
Button checkBox= new Button(parent, SWT.CHECK);
checkBox.setText(label);
checkBox.setData(data);
checkBox.setLayoutData(gd);
checkBox.addSelectionListener(fSelectionListener);
String currValue= (String)fWorkingValues.get(key);
checkBox.setSelection(data.getSelection(currValue) == 0);
|
7,251 |
Bug 7251 compiler preference page: combo boxes should have equal sizes
|
combo boxes have different sizes - depending on whether the entry is 'error' or 'warning' - they should be equal-sized
|
verified fixed
|
ffb4e57
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T12:01:47Z | 2002-01-04T10:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
fCheckBoxes.add(checkBox);
}
private void addComboBox(Composite parent, String label, String key, String[] values, String[] valueLabels) {
ControlData data= new ControlData(key, values);
Label labelControl= new Label(parent, SWT.NONE);
labelControl.setText(label);
labelControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
GridData gd= new GridData();
gd.horizontalAlignment= GridData.END;
Combo comboBox= new Combo(parent, SWT.READ_ONLY);
comboBox.setItems(valueLabels);
comboBox.setData(data);
comboBox.setLayoutData(gd);
comboBox.addSelectionListener(fSelectionListener);
String currValue= (String)fWorkingValues.get(key);
comboBox.select(data.getSelection(currValue));
fComboBoxes.add(comboBox);
}
private void controlChanged(Widget widget) {
ControlData data= (ControlData) widget.getData();
String newValue= null;
if (widget instanceof Button) {
|
7,251 |
Bug 7251 compiler preference page: combo boxes should have equal sizes
|
combo boxes have different sizes - depending on whether the entry is 'error' or 'warning' - they should be equal-sized
|
verified fixed
|
ffb4e57
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T12:01:47Z | 2002-01-04T10:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
newValue= data.getValue(((Button)widget).getSelection());
} else if (widget instanceof Combo) {
newValue= data.getValue(((Combo)widget).getSelectionIndex());
} else {
return;
}
fWorkingValues.put(data.getKey(), newValue);
}
/*
* @see IPreferencePage#performOk()
*/
public boolean performOk() {
String[] allKeys= getAllKeys();
Hashtable actualOptions= JavaCore.getOptions();
IPreferenceStore store= getPreferenceStore();
boolean hasChanges= false;
for (int i= 0; i < allKeys.length; i++) {
String key= allKeys[i];
String val= (String) fWorkingValues.get(key);
String oldVal= (String) actualOptions.get(key);
hasChanges= hasChanges | !val.equals(oldVal);
actualOptions.put(key, val);
store.setValue(key, val);
}
JavaCore.setOptions(actualOptions);
|
7,251 |
Bug 7251 compiler preference page: combo boxes should have equal sizes
|
combo boxes have different sizes - depending on whether the entry is 'error' or 'warning' - they should be equal-sized
|
verified fixed
|
ffb4e57
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T12:01:47Z | 2002-01-04T10:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
if (hasChanges) {
String title= JavaUIMessages.getString("CompilerPreferencePage.needsbuild.title");
String message= JavaUIMessages.getString("CompilerPreferencePage.needsbuild.message");
if (MessageDialog.openQuestion(getShell(), title, message)) {
doFullBuild();
}
}
return super.performOk();
}
private void doFullBuild() {
ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell());
try {
dialog.run(true, true, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
JavaPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
} catch (CoreException e) {
throw new InvocationTargetException(e);
}
}
});
} catch (InterruptedException e) {
} catch (InvocationTargetException e) {
String title= JavaUIMessages.getString("CompilerPreferencePage.builderror.title");
String message= JavaUIMessages.getString("CompilerPreferencePage.builderror.message");
ExceptionHandler.handle(e, getShell(), title, message);
}
}
|
7,251 |
Bug 7251 compiler preference page: combo boxes should have equal sizes
|
combo boxes have different sizes - depending on whether the entry is 'error' or 'warning' - they should be equal-sized
|
verified fixed
|
ffb4e57
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-04T12:01:47Z | 2002-01-04T10:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
/*
* @see PreferencePage#performDefaults()
*/
protected void performDefaults() {
fWorkingValues= JavaCore.getDefaultOptions();
updateControls();
super.performDefaults();
}
private void updateControls() {
for (int i= fCheckBoxes.size() - 1; i >= 0; i--) {
Button curr= (Button) fCheckBoxes.get(i);
ControlData data= (ControlData) curr.getData();
String currValue= (String) fWorkingValues.get(data.getKey());
curr.setSelection(data.getSelection(currValue) == 0);
}
for (int i= fComboBoxes.size() - 1; i >= 0; i--) {
Combo curr= (Combo) fComboBoxes.get(i);
ControlData data= (ControlData) curr.getData();
String currValue= (String) fWorkingValues.get(data.getKey());
curr.select(data.getSelection(currValue));
}
}
}
|
6,233 |
Bug 6233 keep property value if IPropertySource.getEditableValue returns null
|
If IPropertySource is appearing in the property sheet as the value of a property of some other IPropertySource then the source is asked for getEditableValue. If the returned value is null, then the PropertySheetEntry should use the original value, and not null value. For example, my PropertySource contains a property with value of type jdt.IType. The PropertySource for IType returns null in getEditableValue, and this null is actually used by PropertySheetEntry as the edit value; the consequence is that CellEditor provided in PropertyDescriptor of the property does not work. @see PropertySheetEntry#getEditValue
|
resolved fixed
|
f20a13b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T12:58:14Z | 2001-11-22T17:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/JavaElementProperties.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui;
import org.eclipse.jface.viewers.IBasicPropertyConstants;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.eclipse.jdt.core.IJavaElement;
public class JavaElementProperties implements IPropertySource {
private IJavaElement fSource;
static private IPropertyDescriptor[] fgPropertyDescriptors= new IPropertyDescriptor[1];
{
PropertyDescriptor descriptor;
descriptor= new PropertyDescriptor(IBasicPropertyConstants.P_TEXT, JavaUIMessages.getString("JavaElementProperties.name"));
descriptor.setAlwaysIncompatible(true);
fgPropertyDescriptors[0]= descriptor;
}
|
6,233 |
Bug 6233 keep property value if IPropertySource.getEditableValue returns null
|
If IPropertySource is appearing in the property sheet as the value of a property of some other IPropertySource then the source is asked for getEditableValue. If the returned value is null, then the PropertySheetEntry should use the original value, and not null value. For example, my PropertySource contains a property with value of type jdt.IType. The PropertySource for IType returns null in getEditableValue, and this null is actually used by PropertySheetEntry as the edit value; the consequence is that CellEditor provided in PropertyDescriptor of the property does not work. @see PropertySheetEntry#getEditValue
|
resolved fixed
|
f20a13b
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T12:58:14Z | 2001-11-22T17:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/JavaElementProperties.java
|
public JavaElementProperties(IJavaElement source) {
fSource= source;
}
public IPropertyDescriptor[] getPropertyDescriptors() {
return fgPropertyDescriptors;
}
public Object getPropertyValue(Object name) {
if (name.equals(IBasicPropertyConstants.P_TEXT)) {
return fSource.getElementName();
}
return null;
}
public void setPropertyValue(Object name, Object value) {
}
public Object getEditableValue() {
return null;
}
public boolean isPropertySet(Object property) {
return false;
}
public void resetPropertyValue(Object property) {
}
}
|
6,828 |
Bug 6828 Support with replace with previous
|
This is likely a dup, but filed as a reminder. The replace from local history action should provide a replace with previous action.
|
resolved fixed
|
8c876d9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T15:39:42Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistory.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.compare;
import java.util.ResourceBundle;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.*;
import org.eclipse.ui.IEditorInput;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.*;
import org.eclipse.jdt.core.*;
import org.eclipse.jdt.internal.corext.codemanipulation.MemberEdit;
import org.eclipse.jdt.internal.corext.textmanipulation.*;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.compare.JavaHistoryAction.JavaTextBufferNode;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
import org.eclipse.jdt.internal.ui.preferences.CodeFormatterPreferencePage;
import org.eclipse.jdt.ui.IWorkingCopyManager;
import org.eclipse.compare.*;
public class JavaAddElementFromHistory extends JavaHistoryAction {
|
6,828 |
Bug 6828 Support with replace with previous
|
This is likely a dup, but filed as a reminder. The replace from local history action should provide a replace with previous action.
|
resolved fixed
|
8c876d9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T15:39:42Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistory.java
|
private static final String BUNDLE_NAME= "org.eclipse.jdt.internal.ui.compare.AddFromHistoryAction";
private JavaEditor fEditor;
public JavaAddElementFromHistory() {
}
public void run(IAction action) {
|
6,828 |
Bug 6828 Support with replace with previous
|
This is likely a dup, but filed as a reminder. The replace from local history action should provide a replace with previous action.
|
resolved fixed
|
8c876d9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T15:39:42Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistory.java
|
String errorTitle= CompareMessages.getString("AddFromHistory.title");
String errorMessage= CompareMessages.getString("AddFromHistory.internalErrorMessage");
Shell shell= JavaPlugin.getActiveWorkbenchShell();
ICompilationUnit cu= null;
IParent parent= null;
IMember input= null;
ISelection selection= getSelection();
if (selection.isEmpty()) {
if (fEditor != null) {
IEditorInput editorInput= fEditor.getEditorInput();
IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();
if (manager != null) {
cu= manager.getWorkingCopy(editorInput);
parent= cu;
}
}
} else {
input= getEditionElement(selection);
if (input != null) {
cu= input.getCompilationUnit();
if (input instanceof IParent) {
parent= (IParent)input;
input= null;
|
6,828 |
Bug 6828 Support with replace with previous
|
This is likely a dup, but filed as a reminder. The replace from local history action should provide a replace with previous action.
|
resolved fixed
|
8c876d9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T15:39:42Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistory.java
|
} else {
IJavaElement parentElement= input.getParent();
if (parentElement instanceof IParent)
parent= (IParent)parentElement;
}
} else {
if (selection instanceof IStructuredSelection) {
Object o= ((IStructuredSelection)selection).getFirstElement();
if (o instanceof ICompilationUnit) {
cu= (ICompilationUnit) o;
parent= cu;
}
}
}
}
if (parent == null || cu == null) {
MessageDialog.openError(shell, errorTitle, errorMessage);
return;
}
IFile file= getFile(parent);
if (file == null) {
MessageDialog.openError(shell, errorTitle, errorMessage);
return;
}
boolean inEditor= beingEdited(file);
if (inEditor) {
parent= (IParent) getWorkingCopy((IJavaElement)parent);
|
6,828 |
Bug 6828 Support with replace with previous
|
This is likely a dup, but filed as a reminder. The replace from local history action should provide a replace with previous action.
|
resolved fixed
|
8c876d9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T15:39:42Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistory.java
|
if (input != null)
input= (IMember) getWorkingCopy(input);
}
TextBuffer buffer= null;
try {
buffer= TextBuffer.acquire(file);
ITypedElement target= new JavaTextBufferNode(buffer, inEditor);
ITypedElement[] editions= buildEditions(target, file);
ResourceBundle bundle= ResourceBundle.getBundle(BUNDLE_NAME);
EditionSelectionDialog d= new EditionSelectionDialog(shell, bundle);
d.setAddMode(true);
ITypedElement ti= d.selectEdition(target, editions, parent);
if (!(ti instanceof IStreamContentAccessor))
return;
String[] lines= null;
try {
lines= JavaCompareUtilities.readLines(((IStreamContentAccessor) ti).getContents());
} catch (CoreException ex) {
JavaPlugin.log(ex);
}
if (lines == null) {
MessageDialog.openError(shell, errorTitle, errorMessage);
return;
}
|
6,828 |
Bug 6828 Support with replace with previous
|
This is likely a dup, but filed as a reminder. The replace from local history action should provide a replace with previous action.
|
resolved fixed
|
8c876d9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T15:39:42Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistory.java
|
TextEdit edit= null;
if (input != null)
edit= new MemberEdit(input, MemberEdit.INSERT_AFTER, lines,
CodeFormatterPreferencePage.getTabSize());
else
edit= createEdit(lines, parent);
if (edit == null) {
MessageDialog.openError(shell, errorTitle, errorMessage);
return;
}
TextBufferEditor editor= new TextBufferEditor(buffer);
editor.add(edit);
editor.performEdits(new NullProgressMonitor());
TextBuffer.commitChanges(buffer, false, new NullProgressMonitor());
} catch(CoreException ex) {
JavaPlugin.log(ex);
MessageDialog.openError(shell, errorTitle, errorMessage);
} finally {
if (buffer != null)
TextBuffer.release(buffer);
}
}
/**
* Creates a TextEdit for inserting the given lines into the container.
|
6,828 |
Bug 6828 Support with replace with previous
|
This is likely a dup, but filed as a reminder. The replace from local history action should provide a replace with previous action.
|
resolved fixed
|
8c876d9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T15:39:42Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistory.java
|
*/
private TextEdit createEdit(String[] lines, IParent container) {
IJavaElement[] children= null;
try {
children= container.getChildren();
} catch(JavaModelException ex) {
}
if (children != null) {
IJavaElement candidate= null;
for (int i= 0; i < children.length; i++) {
IJavaElement chld= children[i];
switch (chld.getElementType()) {
case IJavaElement.PACKAGE_DECLARATION:
case IJavaElement.IMPORT_CONTAINER:
candidate= chld;
continue;
default:
return new MemberEdit(chld, MemberEdit.INSERT_BEFORE, lines,
CodeFormatterPreferencePage.getTabSize());
}
}
if (candidate != null)
return new MemberEdit(candidate, MemberEdit.INSERT_AFTER, lines,
CodeFormatterPreferencePage.getTabSize());
}
|
6,828 |
Bug 6828 Support with replace with previous
|
This is likely a dup, but filed as a reminder. The replace from local history action should provide a replace with previous action.
|
resolved fixed
|
8c876d9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T15:39:42Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistory.java
|
if (container instanceof IJavaElement)
return new MemberEdit((IJavaElement)container, MemberEdit.ADD_AT_END, lines,
CodeFormatterPreferencePage.getTabSize());
return null;
}
protected boolean isEnabled(ISelection selection) {
if (selection.isEmpty()) {
if (fEditor != null) {
IEditorInput editorInput= fEditor.getEditorInput();
IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();
return manager.getWorkingCopy(editorInput) != null;
}
return false;
}
if (selection instanceof IStructuredSelection) {
Object o= ((IStructuredSelection)selection).getFirstElement();
if (o instanceof ICompilationUnit)
return true;
}
return super.isEnabled(selection);
}
}
|
6,828 |
Bug 6828 Support with replace with previous
|
This is likely a dup, but filed as a reminder. The replace from local history action should provide a replace with previous action.
|
resolved fixed
|
8c876d9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T15:39:42Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaCompareWithEditionAction.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.compare;
import java.util.ResourceBundle;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.*;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.internal.corext.codemanipulation.MemberEdit;
import org.eclipse.jdt.internal.corext.textmanipulation.*;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.compare.JavaHistoryAction.JavaTextBufferNode;
import org.eclipse.jdt.internal.ui.preferences.CodeFormatterPreferencePage;
import org.eclipse.compare.*;
/**
* Provides "Replace from local history" for Java elements.
*/
public class JavaCompareWithEditionAction extends JavaHistoryAction {
|
6,828 |
Bug 6828 Support with replace with previous
|
This is likely a dup, but filed as a reminder. The replace from local history action should provide a replace with previous action.
|
resolved fixed
|
8c876d9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T15:39:42Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaCompareWithEditionAction.java
|
private static final String BUNDLE_NAME= "org.eclipse.jdt.internal.ui.compare.CompareWithEditionAction";
public JavaCompareWithEditionAction() {
}
public void run(IAction action) {
String errorTitle= CompareMessages.getString("ReplaceFromHistory.title");
String errorMessage= CompareMessages.getString("ReplaceFromHistory.internalErrorMessage");
Shell shell= JavaPlugin.getActiveWorkbenchShell();
|
6,828 |
Bug 6828 Support with replace with previous
|
This is likely a dup, but filed as a reminder. The replace from local history action should provide a replace with previous action.
|
resolved fixed
|
8c876d9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T15:39:42Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaCompareWithEditionAction.java
|
ISelection selection= getSelection();
IMember input= getEditionElement(selection);
if (input == null) {
MessageDialog.openInformation(shell, errorTitle, errorMessage);
return;
}
IFile file= getFile(input);
if (file == null) {
MessageDialog.openError(shell, errorTitle, errorMessage);
return;
}
boolean inEditor= beingEdited(file);
if (inEditor)
input= (IMember) getWorkingCopy(input);
TextBuffer buffer= null;
try {
buffer= TextBuffer.acquire(file);
ITypedElement target= new JavaTextBufferNode(buffer, inEditor);
ITypedElement[] editions= buildEditions(target, file);
ResourceBundle bundle= ResourceBundle.getBundle(BUNDLE_NAME);
EditionSelectionDialog d= new EditionSelectionDialog(shell, bundle);
d.setCompareMode(true);
ITypedElement ti= d.selectEdition(target, editions, input);
if (ti instanceof IStreamContentAccessor) {
|
6,828 |
Bug 6828 Support with replace with previous
|
This is likely a dup, but filed as a reminder. The replace from local history action should provide a replace with previous action.
|
resolved fixed
|
8c876d9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T15:39:42Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaCompareWithEditionAction.java
|
String[] lines= null;
try {
lines= JavaCompareUtilities.readLines(((IStreamContentAccessor) ti).getContents());
} catch (CoreException ex) {
JavaPlugin.log(ex);
}
if (lines == null) {
MessageDialog.openError(shell, errorTitle, errorMessage);
return;
}
TextEdit edit= new MemberEdit(input, MemberEdit.REPLACE, lines,
CodeFormatterPreferencePage.getTabSize());
TextBufferEditor editor= new TextBufferEditor(buffer);
editor.add(edit);
editor.performEdits(new NullProgressMonitor());
TextBuffer.commitChanges(buffer, false, new NullProgressMonitor());
}
} catch(CoreException ex) {
JavaPlugin.log(ex);
MessageDialog.openError(shell, errorTitle, errorMessage);
} finally {
if (buffer != null)
TextBuffer.release(buffer);
}
}
}
|
6,828 |
Bug 6828 Support with replace with previous
|
This is likely a dup, but filed as a reminder. The replace from local history action should provide a replace with previous action.
|
resolved fixed
|
8c876d9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T15:39:42Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaReplaceWithEditionAction.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.compare;
import java.util.ResourceBundle;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.internal.corext.codemanipulation.MemberEdit;
import org.eclipse.jdt.internal.corext.textmanipulation.*;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.compare.JavaHistoryAction.JavaTextBufferNode;
import org.eclipse.jdt.internal.ui.preferences.CodeFormatterPreferencePage;
import org.eclipse.compare.*;
/**
* Provides "Replace from local history" for Java elements.
*/
public class JavaReplaceWithEditionAction extends JavaHistoryAction {
|
6,828 |
Bug 6828 Support with replace with previous
|
This is likely a dup, but filed as a reminder. The replace from local history action should provide a replace with previous action.
|
resolved fixed
|
8c876d9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T15:39:42Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaReplaceWithEditionAction.java
|
private static final String BUNDLE_NAME= "org.eclipse.jdt.internal.ui.compare.ReplaceWithEditionAction";
public JavaReplaceWithEditionAction() {
}
protected ITypedElement[] buildEditions(ITypedElement target, IFile file, IFileState[] states) {
ITypedElement[] editions= new ITypedElement[states.length+1];
editions[0]= new ResourceNode(file);
for (int i= 0; i < states.length; i++)
editions[i+1]= new HistoryItem(target, states[i]);
return editions;
}
/**
* @see Action#run
*/
public void run(IAction action) {
String errorTitle= CompareMessages.getString("ReplaceFromHistory.title");
String errorMessage= CompareMessages.getString("ReplaceFromHistory.internalErrorMessage");
Shell shell= JavaPlugin.getActiveWorkbenchShell();
|
6,828 |
Bug 6828 Support with replace with previous
|
This is likely a dup, but filed as a reminder. The replace from local history action should provide a replace with previous action.
|
resolved fixed
|
8c876d9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T15:39:42Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaReplaceWithEditionAction.java
|
ISelection selection= getSelection();
IMember input= getEditionElement(selection);
if (input == null) {
MessageDialog.openError(shell, errorTitle, errorMessage);
return;
}
IFile file= getFile(input);
if (file == null) {
MessageDialog.openError(shell, errorTitle, errorMessage);
return;
}
boolean inEditor= beingEdited(file);
if (inEditor)
input= (IMember) getWorkingCopy(input);
TextBuffer buffer= null;
try {
buffer= TextBuffer.acquire(file);
ResourceBundle bundle= ResourceBundle.getBundle(BUNDLE_NAME);
EditionSelectionDialog d= new EditionSelectionDialog(shell, bundle);
ITypedElement target= new JavaTextBufferNode(buffer, inEditor);
ITypedElement[] editions= buildEditions(target, file);
ITypedElement ti= d.selectEdition(target, editions, input);
if (ti instanceof IStreamContentAccessor) {
|
6,828 |
Bug 6828 Support with replace with previous
|
This is likely a dup, but filed as a reminder. The replace from local history action should provide a replace with previous action.
|
resolved fixed
|
8c876d9
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-01-08T15:39:42Z | 2001-12-11T22:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaReplaceWithEditionAction.java
|
String[] lines= null;
try {
lines= JavaCompareUtilities.readLines(((IStreamContentAccessor) ti).getContents());
} catch (CoreException ex) {
JavaPlugin.log(ex);
}
if (lines == null) {
MessageDialog.openError(shell, errorTitle, errorMessage);
return;
}
TextEdit edit= new MemberEdit(input, MemberEdit.REPLACE, lines,
CodeFormatterPreferencePage.getTabSize());
TextBufferEditor editor= new TextBufferEditor(buffer);
editor.add(edit);
editor.performEdits(new NullProgressMonitor());
TextBuffer.commitChanges(buffer, false, new NullProgressMonitor());
}
} catch(CoreException ex) {
JavaPlugin.log(ex);
MessageDialog.openError(shell, errorTitle, errorMessage);
} finally {
if (buffer != null)
TextBuffer.release(buffer);
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.