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
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
} private void stopBracketHighlighting() { if (fBracketHighlighter != null) { fBracketHighlighter.dispose(); fBracketHighlighter= null; } } private boolean isBracketHighlightingEnabled() { IPreferenceStore store= getPreferenceStore(); return store.getBoolean(MATCHING_BRACKETS); } private Color getColor(String key) { RGB rgb= PreferenceConverter.getColor(getPreferenceStore(), key); JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools(); return textTools.getColorManager().getColor(rgb); } /* * @see AbstractTextEditor#dispose() */ public void dispose() { if (fJavaEditorErrorTickUpdater != null) { fJavaEditorErrorTickUpdater.setAnnotationModel(null); fJavaEditorErrorTickUpdater= null; } stopBracketHighlighting();
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
super.dispose(); } /* * @see AbstractTextEditor#createPartControl(Composite) */ public void createPartControl(Composite parent) { super.createPartControl(parent); if (isBracketHighlightingEnabled()) startBracketHighlighting(); } /* * @see AbstractTextEditor#handlePreferenceStoreChanged(PropertyChangeEvent) */ protected void handlePreferenceStoreChanged(PropertyChangeEvent event) { try { String p= event.getProperty(); if (MATCHING_BRACKETS.equals(p)) { if (isBracketHighlightingEnabled()) startBracketHighlighting(); else stopBracketHighlighting(); return; } if (MATCHING_BRACKETS_COLOR.equals(p)) {
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
if (fBracketHighlighter != null) fBracketHighlighter.setHighlightColor(getColor(MATCHING_BRACKETS_COLOR)); return; } InternalSourceViewer isv= (InternalSourceViewer) getSourceViewer(); IContentAssistant c= isv.getContentAssistant(); if (c instanceof ContentAssistant) ContentAssistPreference.changeConfiguration((ContentAssistant) c, getPreferenceStore(), event); } finally { super.handlePreferenceStoreChanged(event); } } /* * @see AbstractTextEditor#affectsTextPresentation(PropertyChangeEvent) */ protected boolean affectsTextPresentation(PropertyChangeEvent event) { String p= event.getProperty(); boolean affects=MATCHING_BRACKETS_COLOR.equals(p); return affects ? affects : super.affectsTextPresentation(event); } /* * @see AbstractTextEditor#createSourceViewer(Composite, IVerticalRuler, int) */ protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { return new InternalSourceViewer(parent, ruler, styles); } }
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/WorkInProgressPreferencePage.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.preferences; import org.eclipse.swt.widgets.Composite; import org.eclipse.jface.preference.BooleanFieldEditor; import org.eclipse.jface.preference.FieldEditorPreferencePage; import org.eclipse.jface.preference.IPreferenceStore; 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.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaUIMessages; import org.eclipse.jdt.internal.ui.text.java.ExperimentalPreference; /* * The page for setting 'work in progress' features preferences. */ public class WorkInProgressPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { public WorkInProgressPreferencePage() { super(GRID); setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore()); setDescription(JavaUIMessages.getString("WorkInProgressPreferencePage.description")); }
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/WorkInProgressPreferencePage.java
public static void initDefaults(IPreferenceStore store) { store.setDefault(ExperimentalPreference.CODE_ASSIST_EXPERIMENTAL, false); } /* * @see PreferencePage#createControl(Composite) */ public void createControl(Composite parent) { super.createControl(parent); WorkbenchHelp.setHelp(getControl(), new DialogPageContextComputer(this, IJavaHelpContextIds.WORK_IN_PROGRESS_PREFERENCE_PAGE)); } protected void createFieldEditors() { Composite parent= getFieldEditorParent(); BooleanFieldEditor boolEditor= new BooleanFieldEditor( ExperimentalPreference.CODE_ASSIST_EXPERIMENTAL, JavaUIMessages.getString("WorkInProgressPreferencePage.codeassist.experimental"), parent ); addField(boolEditor); } /* * @see IWorkbenchPreferencePage#init(IWorkbench) */ public void init(IWorkbench workbench) { } }
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaTextHover.java
package org.eclipse.jdt.internal.ui.text.java.hover; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ import org.eclipse.debug.ui.IDebugUIConstants; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextHover; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.information.IInformationProvider; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IPartListener; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.jdt.internal.ui.IPreferencesConstants; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.text.JavaWordFinder; /** * Caution: this implementation is a layer breaker and contains some "shortcuts" */ public class JavaTextHover implements ITextHover, IInformationProvider {
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaTextHover.java
class EditorWatcher implements IPartListener { /** * @see IPartListener#partOpened(IWorkbenchPart) */ public void partOpened(IWorkbenchPart part) { } /** * @see IPartListener#partDeactivated(IWorkbenchPart) */ public void partDeactivated(IWorkbenchPart part) { } /** * @see IPartListener#partClosed(IWorkbenchPart) */ public void partClosed(IWorkbenchPart part) { if (part == fEditor) { fEditor.getSite().getWorkbenchWindow().getPartService().removePartListener(fPartListener); fPartListener= null; IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore(); store.removePropertyChangeListener(fPropertyChangeListener); fPropertyChangeListener= null; } } /**
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaTextHover.java
* @see IPartListener#partActivated(IWorkbenchPart) */ public void partActivated(IWorkbenchPart part) { update(); } public void partBroughtToTop(IWorkbenchPart part) { update(); } }; class PropertyChangeListener implements IPropertyChangeListener { /** * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent) */ public void propertyChange(PropertyChangeEvent event) { if (IPreferencesConstants.EDITOR_SHOW_HOVER.equals(event.getProperty())) { Object newValue= event.getNewValue(); if (newValue instanceof Boolean) fEnabled= ((Boolean) newValue).booleanValue(); } } }; protected IEditorPart fEditor; protected IPartListener fPartListener; protected IPropertyChangeListener fPropertyChangeListener; protected String fCurrentPerspective;
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaTextHover.java
protected ITextHover[] fImplementations; protected boolean fEnabled; public JavaTextHover(IEditorPart editor) { fEditor= editor; if (fEditor != null) { fPartListener= new EditorWatcher(); IWorkbenchWindow window= fEditor.getSite().getWorkbenchWindow(); window.getPartService().addPartListener(fPartListener); fPropertyChangeListener= new PropertyChangeListener(); IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore(); store.addPropertyChangeListener(fPropertyChangeListener); fEnabled= store.getBoolean(IPreferencesConstants.EDITOR_SHOW_HOVER); update(); } } protected void update() { IWorkbenchWindow window= fEditor.getSite().getWorkbenchWindow(); IWorkbenchPage page= window.getActivePage();
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaTextHover.java
if (page != null) { String newPerspective= page.getPerspective().getId(); if (fCurrentPerspective == null || fCurrentPerspective != newPerspective) { fCurrentPerspective= newPerspective; if (IDebugUIConstants.ID_DEBUG_PERSPECTIVE.equals(fCurrentPerspective)) fImplementations= new ITextHover[] { new JavaDebugHover(fEditor) }; else fImplementations= new ITextHover[] { new JavaDebugHover(fEditor), new JavaTypeHover(fEditor) }; } } } /* * @see ITextHover#getHoverRegion(ITextViewer, int) */ public IRegion getHoverRegion(ITextViewer textViewer, int offset) { return getSubject(textViewer, offset); } /* * @see ITextHover#getHoverInfo(ITextViewer, IRegion) */ public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaTextHover.java
return getInformation(textViewer, hoverRegion); } /* * @see IInformationProvider#getSubject(ITextViewer, int) */ public IRegion getSubject(ITextViewer textViewer, int offset) { if (!fEnabled) return null; if (textViewer != null) return JavaWordFinder.findWord(textViewer.getDocument(), offset); return null; } /* * @see IInformationProvider#getInformation(ITextViewer, IRegion) */ public String getInformation(ITextViewer textViewer, IRegion subject) { if (fImplementations != null && fEnabled) { for (int i= 0; i < fImplementations.length; i++) { String s= fImplementations[i].getHoverInfo(textViewer, subject); if (s != null && s.trim().length() > 0) return s; } } return null; } }
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaTypeHover.java
package org.eclipse.jdt.internal.ui.text.java.hover; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextHover; import org.eclipse.jface.text.ITextViewer; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IEditorPart; import org.eclipse.jdt.core.ICodeAssist; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IMember; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.ui.IWorkingCopyManager; import org.eclipse.jdt.ui.JavaElementLabelProvider; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.javaeditor.IClassFileEditorInput; import org.eclipse.jdt.internal.ui.text.HTMLPrinter; import org.eclipse.jdt.internal.ui.text.JavaWordFinder; import org.eclipse.jdt.internal.ui.text.javadoc.JavaDocAccess; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabels; public class JavaTypeHover implements ITextHover {
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaTypeHover.java
private IEditorPart fEditor; private final int LABEL_FLAGS= JavaElementLabels.ALL_FULLY_QUALIFIED | JavaElementLabels.M_PRE_RETURNTYPE | JavaElementLabels.M_PARAMETER_TYPES | JavaElementLabels.M_PARAMETER_NAMES | JavaElementLabels.M_EXCEPTIONS | JavaElementLabels.F_PRE_TYPE_SIGNATURE; public JavaTypeHover(IEditorPart editor) { fEditor= editor; } private ICodeAssist getCodeAssist() { if (fEditor != null) { IEditorInput input= fEditor.getEditorInput(); if (input instanceof IClassFileEditorInput) { IClassFileEditorInput cfeInput= (IClassFileEditorInput) input; return cfeInput.getClassFile(); } IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager(); return manager.getWorkingCopy(input); } return null; } private String getInfoText(IMember member) { return JavaElementLabels.getElementLabel(member, LABEL_FLAGS); }
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaTypeHover.java
/* * @see ITextHover#getHoverRegion(ITextViewer, int) */ public IRegion getHoverRegion(ITextViewer textViewer, int offset) { return JavaWordFinder.findWord(textViewer.getDocument(), offset); } /* * @see ITextHover#getHoverInfo(ITextViewer, IRegion) */ public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) { ICodeAssist resolve= getCodeAssist(); if (resolve != null) { try { IJavaElement[] result= resolve.codeSelect(hoverRegion.getOffset(), hoverRegion.getLength()); if (result == null) return null; int nResults= result.length; if (nResults == 0) return null; StringBuffer buffer= new StringBuffer(); if (nResults > 1) { for (int i= 0; i < result.length; i++) { HTMLPrinter.startBulletList(buffer);
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaTypeHover.java
IJavaElement curr= result[i]; if (curr instanceof IMember) HTMLPrinter.addBullet(buffer, getInfoText((IMember) curr)); HTMLPrinter.endBulletList(buffer); } } else { IJavaElement curr= result[0]; if (curr instanceof IMember) { IMember member= (IMember) curr; HTMLPrinter.addSmallHeader(buffer, getInfoText(member)); HTMLPrinter.addParagraph(buffer, JavaDocAccess.getJavaDoc(member)); } } if (buffer.length() > 0) { HTMLPrinter.insertPageProlog(buffer, 0); HTMLPrinter.addPageEpilog(buffer); return buffer.toString(); } } catch (JavaModelException x) { JavaPlugin.log(x.getStatus()); } } return null; } }
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java
package org.eclipse.jdt.ui.text; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.widgets.Shell; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.text.DefaultTextDoubleClickStrategy; import org.eclipse.jface.text.DefaultInformationControl; import org.eclipse.jface.text.IAutoIndentStrategy; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IInformationControl; import org.eclipse.jface.text.IInformationControlCreator; import org.eclipse.jface.text.ITextDoubleClickStrategy; import org.eclipse.jface.text.ITextHover; import org.eclipse.jface.text.TextAttribute; import org.eclipse.jface.text.contentassist.ContentAssistant; import org.eclipse.jface.text.contentassist.IContentAssistant; import org.eclipse.jface.text.formatter.ContentFormatter; import org.eclipse.jface.text.formatter.IContentFormatter; import org.eclipse.jface.text.formatter.IFormattingStrategy; import org.eclipse.jface.text.information.IInformationPresenter; import org.eclipse.jface.text.information.IInformationProvider; import org.eclipse.jface.text.information.InformationPresenter; import org.eclipse.jface.text.internal.html.HoverBrowserControl; import org.eclipse.jface.text.presentation.IPresentationReconciler;
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java
import org.eclipse.jface.text.presentation.PresentationReconciler; import org.eclipse.jface.text.reconciler.IReconciler; import org.eclipse.jface.text.reconciler.MonoReconciler; import org.eclipse.jface.text.rules.RuleBasedDamagerRepairer; import org.eclipse.jface.text.rules.RuleBasedScanner; import org.eclipse.jface.text.rules.Token; import org.eclipse.jface.text.source.IAnnotationHover; import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.text.source.SourceViewerConfiguration; import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.text.ContentAssistPreference; import org.eclipse.jdt.internal.ui.text.HTMLTextPresenter; import org.eclipse.jdt.internal.ui.text.JavaAnnotationHover; import org.eclipse.jdt.internal.ui.text.JavaPartitionScanner; import org.eclipse.jdt.internal.ui.text.java.JavaAutoIndentStrategy; import org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor; import org.eclipse.jdt.internal.ui.text.java.JavaDoubleClickSelector; import org.eclipse.jdt.internal.ui.text.java.JavaFormattingStrategy; import org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy; import org.eclipse.jdt.internal.ui.text.java.hover.JavaTextHover; import org.eclipse.jdt.internal.ui.text.javadoc.JavaDocAutoIndentStrategy; import org.eclipse.jdt.internal.ui.text.javadoc.JavaDocCompletionProcessor; /** * Configuration for a source viewer which shows Java code. * <p> * This class may be instantiated; it is not intended to be subclassed. * </p> */ public class JavaSourceViewerConfiguration extends SourceViewerConfiguration {
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java
private JavaTextTools fJavaTextTools; private ITextEditor fTextEditor; /** * Creates a new Java source viewer configuration for viewers in the given editor * using the given Java tools. * * @param tools the Java tools to be used * @param editor the editor in which the configured viewer(s) will reside */ public JavaSourceViewerConfiguration(JavaTextTools tools, ITextEditor editor) { fJavaTextTools= tools; fTextEditor= editor; } /** * Returns the Java source code scanner for this configuration. * * @return the Java source code scanner */ protected RuleBasedScanner getCodeScanner() { return fJavaTextTools.getCodeScanner(); }
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java
/** * Returns the Java multiline comment scanner for this configuration. * * @return the Java multiline comment scanner */ protected RuleBasedScanner getMultilineCommentScanner() { return fJavaTextTools.getMultilineCommentScanner(); } /** * Returns the Java singleline comment scanner for this configuration. * * @return the Java singleline comment scanner */ protected RuleBasedScanner getSinglelineCommentScanner() { return fJavaTextTools.getSinglelineCommentScanner(); } /** * Returns the JavaDoc scanner for this configuration. * * @return the JavaDoc scanner */ protected RuleBasedScanner getJavaDocScanner() { return fJavaTextTools.getJavaDocScanner(); } /** * Returns the color manager for this configuration.
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java
* * @return the color manager */ protected IColorManager getColorManager() { return fJavaTextTools.getColorManager(); } /** * Returns the editor in which the configured viewer(s) will reside. * * @return the enclosing editor */ protected ITextEditor getEditor() { return fTextEditor; } /** * Returns the preference store used for by this configuration to initialize * the individula bits and pieces. */ protected IPreferenceStore getPreferenceStore() { return JavaPlugin.getDefault().getPreferenceStore(); } /* * @see ISourceViewerConfiguration#getPresentationReconciler(ISourceViewer) */ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) { PresentationReconciler reconciler= new PresentationReconciler(); RuleBasedDamagerRepairer dr= new RuleBasedDamagerRepairer(getCodeScanner());
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java
reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE); reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE); dr= new RuleBasedDamagerRepairer(getJavaDocScanner()); reconciler.setDamager(dr, JavaPartitionScanner.JAVA_DOC); reconciler.setRepairer(dr, JavaPartitionScanner.JAVA_DOC); dr= new RuleBasedDamagerRepairer(getMultilineCommentScanner()); reconciler.setDamager(dr, JavaPartitionScanner.JAVA_MULTI_LINE_COMMENT); reconciler.setRepairer(dr, JavaPartitionScanner.JAVA_MULTI_LINE_COMMENT); dr= new RuleBasedDamagerRepairer(getSinglelineCommentScanner()); reconciler.setDamager(dr, JavaPartitionScanner.JAVA_SINGLE_LINE_COMMENT); reconciler.setRepairer(dr, JavaPartitionScanner.JAVA_SINGLE_LINE_COMMENT); return reconciler; } /* * @see SourceViewerConfiguration#getContentAssistant(ISourceViewer) */ public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { if (getEditor() != null) { ContentAssistant assistant= new ContentAssistant(); assistant.setContentAssistProcessor(new JavaCompletionProcessor(getEditor()), IDocument.DEFAULT_CONTENT_TYPE); assistant.setContentAssistProcessor(new JavaDocCompletionProcessor(getEditor()), JavaPartitionScanner.JAVA_DOC); ContentAssistPreference.configure(assistant, getPreferenceStore()); assistant.setContextInformationPopupOrientation(assistant.CONTEXT_INFO_ABOVE); assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java
return assistant; } return null; } /* * @see SourceViewerConfiguration#getReconciler(ISourceViewer) */ public IReconciler getReconciler(ISourceViewer sourceViewer) { if (getEditor() != null && getEditor().isEditable()) { MonoReconciler reconciler= new MonoReconciler(new JavaReconcilingStrategy(getEditor()), false); reconciler.setDelay(500); return reconciler; } return null; } /* * @see SourceViewerConfiguration#getAutoIndentStrategy(ISourceViewer, String) */ public IAutoIndentStrategy getAutoIndentStrategy(ISourceViewer sourceViewer, String contentType) { if (JavaPartitionScanner.JAVA_DOC.equals(contentType) || JavaPartitionScanner.JAVA_MULTI_LINE_COMMENT.equals(contentType)) return new JavaDocAutoIndentStrategy(); return new JavaAutoIndentStrategy(); } /* * @see SourceViewerConfiguration#getDoubleClickStrategy(ISourceViewer, String) */
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java
public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) { if (JavaPartitionScanner.JAVA_DOC.equals(contentType) || JavaPartitionScanner.JAVA_MULTI_LINE_COMMENT.equals(contentType) || JavaPartitionScanner.JAVA_SINGLE_LINE_COMMENT.equals(contentType)) return new DefaultTextDoubleClickStrategy(); return new JavaDoubleClickSelector(); } /* * @see SourceViewerConfiguration#getDefaultPrefix(ISourceViewer, String) */ public String[] getDefaultPrefixes(ISourceViewer sourceViewer, String contentType) { return new String[] { "//", "" }; } /* * @see SourceViewerConfiguration#getIndentPrefixes(ISourceViewer, String) */ public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) { return new String[] {"\t", " ", ""}; } /* * @see SourceViewerConfiguration#getTabWidth(ISourceViewer) */ public int getTabWidth(ISourceViewer sourceViewer) { return 4; } /* * @see SourceViewerConfiguration#getAnnotationHover(ISourceViewer) */ public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) { return new JavaAnnotationHover();
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java
} /* * @see SourceViewerConfiguration#getTextHover(ISourceViewer, String) */ public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return new JavaTextHover(getEditor()); } /* * @see SourceViewerConfiguration#getConfiguredContentTypes(ISourceViewer) */ public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { return new String[] { IDocument.DEFAULT_CONTENT_TYPE, JavaPartitionScanner.JAVA_DOC, JavaPartitionScanner.JAVA_MULTI_LINE_COMMENT, JavaPartitionScanner.JAVA_SINGLE_LINE_COMMENT }; } /* * @see SourceViewerConfiguration#getContentFormatter(ISourceViewer) */ public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) { ContentFormatter formatter= new ContentFormatter(); IFormattingStrategy strategy= new JavaFormattingStrategy(sourceViewer); formatter.setFormattingStrategy(strategy, IDocument.DEFAULT_CONTENT_TYPE); formatter.enablePartitionAwareFormatting(false); formatter.setPartitionManagingPositionCategories(fJavaTextTools.getPartitionManagingPositionCategories()); return formatter; }
4,369
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
resolved fixed
ce37c8c
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:37:50Z
2001-10-11T11:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java
/* * @see SourceViewerConfiguration#getHoverControlCreator(ISourceViewer) */ public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer) { return getInformationControlCreator(sourceViewer, true); } private IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer, final boolean cutDown) { return new IInformationControlCreator() { public IInformationControl createInformationControl(Shell parent) { int style= cutDown ? SWT.NONE : (SWT.V_SCROLL | SWT.H_SCROLL); return new DefaultInformationControl(parent, style, new HTMLTextPresenter(cutDown)); } }; } /* * @see SourceViewerConfiguration#getInformationPresenter(ISourceViewer) */ public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) { InformationPresenter presenter= new InformationPresenter(getInformationControlCreator(sourceViewer, false)); IInformationProvider provider= new JavaTextHover(getEditor()); presenter.setInformationProvider(provider, IDocument.DEFAULT_CONTENT_TYPE); presenter.setInformationProvider(provider, JavaPartitionScanner.JAVA_DOC); presenter.setSizeConstraints(60, 10, true, true); return presenter; } }
6,308
Bug 6308 Open type dialog should trim entered value
Leading and trailing spaces should be ignored in the input field of this dialog
verified fixed
6e296de
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:49:38Z
2001-11-26T13:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredList.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.dialogs; import java.util.Comparator; import java.util.HashSet; import java.util.Set; import java.util.Vector; import org.eclipse.swt.SWT; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event;
6,308
Bug 6308 Open type dialog should trim entered value
Leading and trailing spaces should be ignored in the input field of this dialog
verified fixed
6e296de
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:49:38Z
2001-11-26T13:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredList.java
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableItem; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jdt.internal.core.Assert; import org.eclipse.jdt.internal.ui.util.StringMatcher; /** * A composite widget which holds a list of elements for user selection. * The elements are sorted alphabetically. * Optionally, the elements can be filtered and duplicate entries can * be hidden (folding). */ public class FilteredList extends Composite { public interface FilterMatcher { /** * Sets the filter. * * @param pattern the filter pattern. * @param ignoreCase a flag indicating whether pattern matching is case insensitive or not. * @param ignoreWildCards a flag indicating whether wildcard characters are interpreted or not. */ void setFilter(String pattern, boolean ignoreCase, boolean ignoreWildCards); /** * Returns <code>true</code> if the object matches the pattern, <code>false</code> otherwise. * <code>setFilter()</code> must have been called at least once prior to a call to this method. */ boolean match(Object element); } private class DefaultFilterMatcher implements FilterMatcher {
6,308
Bug 6308 Open type dialog should trim entered value
Leading and trailing spaces should be ignored in the input field of this dialog
verified fixed
6e296de
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:49:38Z
2001-11-26T13:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredList.java
private StringMatcher fMatcher; public void setFilter(String pattern, boolean ignoreCase, boolean ignoreWildCards) { fMatcher= new StringMatcher(pattern + '*', ignoreCase, ignoreWildCards); } public boolean match(Object element) { return fMatcher.match(fRenderer.getText(element)); } } private Table fList; private ILabelProvider fRenderer; private boolean fMatchEmtpyString= true; private boolean fIgnoreCase; private boolean fAllowDuplicates; private String fFilter= ""; private TwoArrayQuickSorter fSorter; private Object[] fElements= new Object[0]; private Label[] fLabels; private Vector fImages= new Vector(); private int[] fFoldedIndices; private int fFoldedCount; private int[] fFilteredIndices; private int fFilteredCount; private FilterMatcher fFilterMatcher= new DefaultFilterMatcher(); private static class Label {
6,308
Bug 6308 Open type dialog should trim entered value
Leading and trailing spaces should be ignored in the input field of this dialog
verified fixed
6e296de
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:49:38Z
2001-11-26T13:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredList.java
public final String string; public final Image image; public Label(String string, Image image) { this.string= string; this.image= image; } public boolean equals(Label label) { if (label == null) return false; return string.equals(label.string) && image.equals(label.image); } } private class LabelComparator implements Comparator {
6,308
Bug 6308 Open type dialog should trim entered value
Leading and trailing spaces should be ignored in the input field of this dialog
verified fixed
6e296de
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:49:38Z
2001-11-26T13:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredList.java
private boolean fIgnoreCase; LabelComparator(boolean ignoreCase) { fIgnoreCase= ignoreCase; } public int compare(Object left, Object right) { Label leftLabel= (Label) left; Label rightLabel= (Label) right; int value= fIgnoreCase ? leftLabel.string.compareToIgnoreCase(rightLabel.string) : leftLabel.string.compareTo(rightLabel.string); if (value != 0) return value; if (leftLabel.image == null) { return (rightLabel.image == null) ? 0 : -1;
6,308
Bug 6308 Open type dialog should trim entered value
Leading and trailing spaces should be ignored in the input field of this dialog
verified fixed
6e296de
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:49:38Z
2001-11-26T13:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredList.java
} else if (rightLabel.image == null) { return +1; } else { return fImages.indexOf(leftLabel.image) - fImages.indexOf(rightLabel.image); } } } /** * Constructs a new instance of a filtered list. * @param parent the parent composite. * @param style the widget style. * @param renderer the label renderer. * @param ignoreCase specifies whether sorting and folding is case sensitive. * @param allowDuplicates specifies whether folding of duplicates is desired. * @param matchEmptyString specifies whether empty filter strings should filter everything or nothing. */ public FilteredList(Composite parent, int style, ILabelProvider renderer, boolean ignoreCase, boolean allowDuplicates, boolean matchEmptyString) { super(parent, SWT.NONE); GridLayout layout= new GridLayout(); layout.marginHeight= 0; layout.marginWidth= 0; setLayout(layout); fList= new Table(this, style);
6,308
Bug 6308 Open type dialog should trim entered value
Leading and trailing spaces should be ignored in the input field of this dialog
verified fixed
6e296de
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:49:38Z
2001-11-26T13:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredList.java
fList.setLayoutData(new GridData(GridData.FILL_BOTH)); fList.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { fRenderer.dispose(); } }); fRenderer= renderer; fIgnoreCase= ignoreCase; fSorter= new TwoArrayQuickSorter(new LabelComparator(ignoreCase)); fAllowDuplicates= allowDuplicates; fMatchEmtpyString= matchEmptyString; } /** * Sets the list of elements. * @param elements the elements to be shown in the list. */ public void setElements(Object[] elements) { if (elements == null) { fElements= new Object[0]; } else { fElements= new Object[elements.length]; System.arraycopy(elements, 0, fElements, 0, elements.length); } int length= fElements.length; fLabels= new Label[length]; Set imageSet= new HashSet();
6,308
Bug 6308 Open type dialog should trim entered value
Leading and trailing spaces should be ignored in the input field of this dialog
verified fixed
6e296de
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:49:38Z
2001-11-26T13:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredList.java
for (int i= 0; i != length; i++) { String text= fRenderer.getText(fElements[i]); Image image= fRenderer.getImage(fElements[i]); fLabels[i]= new Label(text, image); imageSet.add(image); } fImages.clear(); fImages.addAll(imageSet); fSorter.sort(fLabels, fElements); fFilteredIndices= new int[length]; fFilteredCount= filter(); fFoldedIndices= new int[length]; fFoldedCount= fold(); updateList(); } /** * Tests if the list (before folding and filtering) is empty. * @return returns <code>true</code> if the list is empty, <code>false</code> otherwise. */ public boolean isEmpty() { return (fElements == null) || (fElements.length == 0); } /** * Sets the filter matcher. */ public void setFilterMatcher(FilterMatcher filterMatcher) { Assert.isNotNull(filterMatcher); fFilterMatcher= filterMatcher;
6,308
Bug 6308 Open type dialog should trim entered value
Leading and trailing spaces should be ignored in the input field of this dialog
verified fixed
6e296de
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:49:38Z
2001-11-26T13:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredList.java
} /** * Adds a selection listener to the list. * @param listener the selection listener to be added. */ public void addSelectionListener(SelectionListener listener) { fList.addSelectionListener(listener); } /** * Removes a selection listener from the list. * @param listener the selection listener to be removed. */ public void removeSelectionListener(SelectionListener listener) { fList.removeSelectionListener(listener); } /** * Sets the selection of the list. * @param selection an array of indices specifying the selection. */ public void setSelection(int[] selection) { fList.setSelection(selection); } /** * Returns the selection of the list. * @return returns an array of indices specifying the current selection. */ public int[] getSelectionIndices() { return fList.getSelectionIndices(); }
6,308
Bug 6308 Open type dialog should trim entered value
Leading and trailing spaces should be ignored in the input field of this dialog
verified fixed
6e296de
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:49:38Z
2001-11-26T13:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredList.java
/** * Returns the selection of the list. * This is a convenience function for <code>getSelectionIndices()</code>. * @return returns the index of the selection, -1 for no selection. */ public int getSelectionIndex() { return fList.getSelectionIndex(); } /** * Sets the selection of the list. * @param elements the array of elements to be selected. */ public void setSelection(Object[] elements) { if ((elements == null) || (fElements == null)) return; int[] indices= new int[elements.length]; for (int i= 0; i != elements.length; i++) { int j; for (j= 0; j != fFoldedCount; j++) { int max= (j == fFoldedCount - 1) ? fFilteredCount : fFoldedIndices[j + 1]; int l; for (l= fFoldedIndices[j]; l != max; l++) { if (fElements[fFilteredIndices[l]].equals(elements[i])) {
6,308
Bug 6308 Open type dialog should trim entered value
Leading and trailing spaces should be ignored in the input field of this dialog
verified fixed
6e296de
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:49:38Z
2001-11-26T13:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredList.java
indices[i]= j; break; } } if (l != max) break; } if (j == fFoldedCount) indices[i] = 0; } fList.setSelection(indices); } /** * Returns an array of the selected elements. The type of the elements * returned in the list are the same as the ones passed with * <code>setElements</code>. The array does not contain the rendered strings. * @return returns the array of selected elements. */ public Object[] getSelection() { if (fList.isDisposed() || (fList.getSelectionCount() == 0)) return new Object[0]; int[] indices= fList.getSelectionIndices(); Object[] elements= new Object[indices.length]; for (int i= 0; i != indices.length; i++)
6,308
Bug 6308 Open type dialog should trim entered value
Leading and trailing spaces should be ignored in the input field of this dialog
verified fixed
6e296de
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:49:38Z
2001-11-26T13:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredList.java
elements[i]= fElements[fFilteredIndices[fFoldedIndices[indices[i]]]]; return elements; } /** * Sets the filter pattern. Current only prefix filter patterns are supported. * @param filter the filter pattern. */ public void setFilter(String filter) { fFilter= (filter == null) ? "" : filter; fFilteredCount= filter(); fFoldedCount= fold(); updateList(); } /** * Returns the filter pattern. * @return returns the filter pattern. */ public String getFilter() { return fFilter; } /** * Returns all elements which are folded together to one entry in the list. * @param index the index selecting the entry in the list. * @return returns an array of elements folded together, <code>null</code> if index is out of range. */ public Object[] getFoldedElements(int index) { if ((index < 0) || (index >= fFoldedCount)) return null;
6,308
Bug 6308 Open type dialog should trim entered value
Leading and trailing spaces should be ignored in the input field of this dialog
verified fixed
6e296de
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:49:38Z
2001-11-26T13:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredList.java
int start= fFoldedIndices[index]; int count= (index == fFoldedCount - 1) ? fFilteredCount - start : fFoldedIndices[index + 1] - start; Object[] elements= new Object[count]; for (int i= 0; i != count; i++) elements[i]= fElements[fFilteredIndices[start + i]]; return elements; } /* * Folds duplicate entries. Two elements are considered as a pair of * duplicates if they coiincide in the rendered string and image. * @return returns the number of elements after folding. */ private int fold() { if (fAllowDuplicates) { for (int i= 0; i != fFilteredCount; i++) fFoldedIndices[i]= i; return fFilteredCount; } else { int k= 0; Label last= null; for (int i= 0; i != fFilteredCount; i++) { int j= fFilteredIndices[i]; Label current= fLabels[j];
6,308
Bug 6308 Open type dialog should trim entered value
Leading and trailing spaces should be ignored in the input field of this dialog
verified fixed
6e296de
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:49:38Z
2001-11-26T13:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredList.java
if (! current.equals(last)) { fFoldedIndices[k]= i; k++; last= current; } } return k; } } /* * Filters the list with the filter pattern. * @return returns the number of elements after filtering. */ private int filter() { if (((fFilter == null) || (fFilter.length() == 0)) && !fMatchEmtpyString) return 0; fFilterMatcher.setFilter(fFilter, fIgnoreCase, false); int k= 0; for (int i= 0; i != fElements.length; i++) { if (fFilterMatcher.match(fElements[i])) fFilteredIndices[k++]= i; } return k; } /* * Updates the list widget. */ private void updateList() {
6,308
Bug 6308 Open type dialog should trim entered value
Leading and trailing spaces should be ignored in the input field of this dialog
verified fixed
6e296de
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T17:49:38Z
2001-11-26T13:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredList.java
if (fList.isDisposed()) return; fList.setRedraw(false); int itemCount= fList.getItemCount(); if (fFoldedCount < itemCount) fList.remove(0, itemCount - fFoldedCount - 1); else if (fFoldedCount > itemCount) for (int i= 0; i != fFoldedCount - itemCount; i++) new TableItem(fList, SWT.NONE); TableItem[] items= fList.getItems(); for (int i= 0; i != fFoldedCount; i++) { TableItem item= items[i]; Label label= fLabels[fFilteredIndices[fFoldedIndices[i]]]; item.setText(label.string); item.setImage(label.image); } if (fList.getItemCount() > 0) fList.setSelection(0); fList.setRedraw(true); fList.notifyListeners(SWT.Selection, new Event()); } }
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.dialogs; import java.util.ArrayList; import java.util.List; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.BusyIndicator; import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.KeyListener; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.util.Assert; import org.eclipse.jface.viewers.ILabelProvider; /** * An abstract class to select elements out of a list of elements. */ public abstract class AbstractElementListSelectionDialog extends SelectionStatusDialog {
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java
private ILabelProvider fRenderer; private boolean fIgnoreCase= true; private boolean fIsMultipleSelection= false;
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java
private boolean fMatchEmptyString= true; private boolean fAllowDuplicates= true; private Label fMessage; protected FilteredList fFilteredList; private Text fFilterText; private ISelectionValidator fValidator; private String fFilter= null; private String fEmptyListMessage= ""; private String fEmptySelectionMessage= ""; private int fWidth= 60; private int fHeight= 18; private Object[] fSelection= new Object[0]; /** * Constructs a list selection dialog. * @param renderer The label renderer used * @param ignoreCase Decides if the match string ignores lower/upppr case * @param multipleSelection Allow multiple selection */ protected AbstractElementListSelectionDialog(Shell parent, ILabelProvider renderer) { super(parent); fRenderer= renderer; } /**
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java
* Handles default selection (double click). * By default, the OK button is pressed. */ protected void handleDefaultSelected() { if (validateCurrentSelection()) buttonPressed(IDialogConstants.OK_ID); } /** * Specifies if sorting, filtering and folding is case sensitive. */ public void setIgnoreCase(boolean ignoreCase) { fIgnoreCase= ignoreCase; } /** * Returns if sorting, filtering and folding is case sensitive. */ public boolean isCaseIgnored() { return fIgnoreCase; } /** * Specifies whether everything or nothing should be filtered on * empty filter string. */ public void setMatchEmptyString(boolean matchEmptyString) { fMatchEmptyString= matchEmptyString; }
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java
/** * Specifies if multiple selection is allowed. */ public void setMultipleSelection(boolean multipleSelection) { fIsMultipleSelection= multipleSelection; } /** * Specifies whether duplicate entries are displayed or not. */ public void setAllowDuplicates(boolean allowDuplicates) { fAllowDuplicates= allowDuplicates; } /** * Sets the list size in unit of characters. * @param width the width of the list. * @param height the height of the list. */ public void setSize(int width, int height) { fWidth= width; fHeight= height; } /** * Sets the message to be displayed if the list is empty. * @param message the message to be displayed. */ public void setEmptyListMessage(String message) { fEmptyListMessage= message; }
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java
/** * Sets the message to be displayed if the selection is empty. * @param message the message to be displayed. */ public void setEmptySelectionMessage(String message) { fEmptySelectionMessage= message; } /** * Sets an optional validator to check if the selection is valid. * The validator is invoked whenever the selection changes. * @param validator the validator to validate the selection. */ public void setValidator(ISelectionValidator validator) { fValidator= validator; } /** * Sets the elements of the list (widget). * To be called within open(). * @param elements the elements of the list. */ protected void setListElements(Object[] elements) { Assert.isNotNull(fFilteredList); fFilteredList.setElements(elements); } /** * Sets the filter pattern. * @param filter the filter pattern. */
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java
public void setFilter(String filter) { if (fFilterText == null) fFilter= filter; else fFilterText.setText(filter); } /** * Returns the current filter pattern. * @return returns the current filter pattern or <code>null<code> if filter was not set. */ public String getFilter() { if (fFilteredList == null) return fFilter; else return fFilteredList.getFilter(); } /** * Returns the indices referring the current selection. * To be called within open(). * @return returns the indices of the current selection. */ protected int[] getSelectionIndices() { Assert.isNotNull(fFilteredList); return fFilteredList.getSelectionIndices(); } /** * Returns an index referring the first current selection. * To be called within open(). * @return returns the indices of the current selection.
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java
*/ protected int getSelectionIndex() { Assert.isNotNull(fFilteredList); return fFilteredList.getSelectionIndex(); } /** * Sets the selection referenced by an array of elements. * To be called within open(). * @param selection the indices of the selection. */ protected void setSelection(Object[] selection) { Assert.isNotNull(fFilteredList); fFilteredList.setSelection(selection); } /** * Returns an array of the currently selected elements. * To be called within or after open(). * @return returns an array of the currently selected elements. */ protected Object[] getSelectedElements() { Assert.isNotNull(fFilteredList); return fFilteredList.getSelection(); } /** * Returns all elements which are folded together to one entry in the list. * @param index the index selecting the entry in the list. * @return returns an array of elements folded together. */
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java
public Object[] getFoldedElements(int index) { Assert.isNotNull(fFilteredList); return fFilteredList.getFoldedElements(index); } /** * Creates the message text widget and sets layout data. * @param composite the parent composite of the message area. */ protected Label createMessageArea(Composite composite) { Label label= super.createMessageArea(composite); GridData data= new GridData(); data.grabExcessVerticalSpace= false; data.grabExcessHorizontalSpace= true; data.horizontalAlignment= GridData.FILL; data.verticalAlignment= GridData.BEGINNING; label.setLayoutData(data); fMessage= label; return label; } /** * Handles a selection changed event. * By default, the current selection is validated. */ protected void handleSelectionChanged() { validateCurrentSelection(); }
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java
/** * Validates the current selection and updates the status line * accordingly. */ protected boolean validateCurrentSelection() { Assert.isNotNull(fFilteredList); IStatus status; Object[] elements= getSelectedElements(); if (elements.length > 0) { if (fValidator != null) { status= fValidator.validate(elements); } else { status= new StatusInfo(); } } else { if (fFilteredList.isEmpty()) { status= new StatusInfo(IStatus.ERROR, fEmptyListMessage); } else { status= new StatusInfo(IStatus.ERROR, fEmptySelectionMessage); } } updateStatus(status); return status.isOK(); } /* * @see Dialog#cancelPressed */ protected void cancelPressed() { setResult(null);
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java
super.cancelPressed(); } /** * Creates a filtered list. * @param parent the parent composite. * @return returns the filtered list widget. */ protected FilteredList createFilteredList(Composite parent) { int flags= SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | (fIsMultipleSelection ? SWT.MULTI : SWT.SINGLE); FilteredList list= new FilteredList(parent, flags, fRenderer, fIgnoreCase, fAllowDuplicates, fMatchEmptyString); GridData data= new GridData(); data.widthHint= convertWidthInCharsToPixels(fWidth); data.heightHint= convertHeightInCharsToPixels(fHeight); data.grabExcessVerticalSpace= true; data.grabExcessHorizontalSpace= true; data.horizontalAlignment= GridData.FILL; data.verticalAlignment= GridData.FILL; list.setLayoutData(data); list.setFilter((fFilter == null ? "" : fFilter)); list.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { handleDefaultSelected(); } public void widgetSelected(SelectionEvent e) { handleWidgetSelected(); }
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java
}); fFilteredList= list; return list; } private void handleWidgetSelected() { Object[] newSelection= fFilteredList.getSelection(); if (newSelection.length != fSelection.length) { fSelection= newSelection; handleSelectionChanged(); } else { for (int i= 0; i != newSelection.length; i++) { if (!newSelection[i].equals(fSelection[i])) { fSelection= newSelection; handleSelectionChanged(); break; } } } } protected Text createFilterText(Composite parent) { Text text= new Text(parent, SWT.BORDER); GridData data= new GridData(); data.grabExcessVerticalSpace= false; data.grabExcessHorizontalSpace= true; data.horizontalAlignment= GridData.FILL; data.verticalAlignment= GridData.BEGINNING; text.setLayoutData(data); text.setText((fFilter == null ? "" : fFilter));
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java
Listener listener= new Listener() { public void handleEvent(Event e) { fFilteredList.setFilter(fFilterText.getText()); } }; text.addListener(SWT.Modify, listener); text.addKeyListener(new KeyListener() { public void keyPressed(KeyEvent e) { if (e.keyCode == SWT.ARROW_DOWN) fFilteredList.setFocus(); } public void keyReleased(KeyEvent e) {} }); fFilterText= text; return text; } /* * @see Window#open() */ public int open() { BusyIndicator.showWhile(null, new Runnable() { public void run() { access$superOpen(); } }); return getReturnCode(); }
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java
private void access$superOpen() { super.open(); } /* * @see Window#create(Shell) */ public void create() { super.create(); Assert.isNotNull(fFilteredList); if (fFilteredList.isEmpty()) { handleEmptyList(); } else { validateCurrentSelection(); fFilterText.selectAll(); fFilterText.setFocus(); } } /** * Handles empty list by disabling widgets. */ protected void handleEmptyList() { fMessage.setEnabled(false); fFilterText.setEnabled(false); fFilteredList.setEnabled(false); } }
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
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;
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
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;
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
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 {
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
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 {
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
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)
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
fEndsWithVariable= false; } 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;
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
private Map fGlobalActions= new HashMap(10); private List fSelectionActions = new ArrayList(3); public EditTemplateDialog(Shell parent, Template template, boolean edit) { super(parent); 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;
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
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); Label patternLabel= 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);
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
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));
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
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(); }
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
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);
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
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); }
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
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;
6,181
Bug 6181 Edit template panel doesn't resize
The panel is small and can't be resized. It also has a maximize button that is not operational.
verified fixed
ac79605
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-26T19:09:41Z
2001-11-21T19:13:20Z
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); } }
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
package org.eclipse.jdt.internal.ui.javaeditor; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ import java.util.Iterator; import org.eclipse.core.runtime.CoreException; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IMember; import org.eclipse.jdt.core.ISourceRange; import org.eclipse.jdt.core.ISourceReference; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.actions.AddMethodEntryBreakpointAction; import org.eclipse.jdt.internal.ui.actions.AddWatchpointAction; import org.eclipse.jdt.internal.ui.actions.OpenImportDeclarationAction; import org.eclipse.jdt.internal.ui.actions.OpenSuperImplementationAction;
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
import org.eclipse.jdt.internal.ui.actions.ShowInPackageViewAction; import org.eclipse.jdt.internal.ui.actions.StructuredSelectionProvider; import org.eclipse.jdt.internal.ui.search.JavaSearchGroup; import org.eclipse.jdt.ui.IContextMenuConstants; import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; import org.eclipse.jdt.ui.text.JavaTextTools; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.IStatusLineManager; import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.swt.graphics.Image; import org.eclipse.ui.IEditorActionBarContributor; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IPartService; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.part.EditorActionBarContributor; import org.eclipse.ui.texteditor.AbstractTextEditor; import org.eclipse.ui.texteditor.DefaultRangeIndicator; import org.eclipse.ui.texteditor.ITextEditorActionConstants; import org.eclipse.ui.texteditor.TextOperationAction; import org.eclipse.ui.views.contentoutline.IContentOutlinePage; /** * Java specific text editor. */ public abstract class JavaEditor extends AbstractTextEditor implements ISelectionChangedListener {
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
protected JavaOutlinePage fOutlinePage; protected String fOutlinerContextMenuId; /** * Returns the most narrow java element including the given offset */ abstract protected IJavaElement getElementAt(int offset); /** * Returns the java element of this editor's input corresponding to the given IJavaElement
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
*/ abstract protected IJavaElement getCorrespondingElement(IJavaElement element); /** * Sets the input of the editor's outline page. */ abstract protected void setOutlinePageInput(JavaOutlinePage page, IEditorInput input); /** * Default constructor. */ public JavaEditor() { super(); JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools(); setSourceViewerConfiguration(new JavaSourceViewerConfiguration(textTools, this)); setRangeIndicator(new DefaultRangeIndicator()); setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore()); } /** * @see AbstractTextEditor#createSourceViewer(Composite, IVerticalRuler, int) * * This is the code that can be found in 1.0 fixing the bidi rendering of Java code. * Looking for something less vulernable in this stream. * protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { ISourceViewer viewer= super.createSourceViewer(parent, ruler, styles); StyledText text= viewer.getTextWidget(); text.setBidiColoring(true);
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
return viewer; } */ /** * @see AbstractTextEditor#affectsTextPresentation(PropertyChangeEvent) */ protected boolean affectsTextPresentation(PropertyChangeEvent event) { JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools(); return textTools.affectsBehavior(event); } /** * Sets the outliner's context menu ID. */ protected void setOutlinerContextMenuId(String menuId) { fOutlinerContextMenuId= menuId; } /** * @see AbstractTextEditor#editorContextMenuAboutToShow */ public void editorContextMenuAboutToShow(IMenuManager menu) { super.editorContextMenuAboutToShow(menu); addGroup(menu, ITextEditorActionConstants.GROUP_EDIT, IContextMenuConstants.GROUP_REORGANIZE); addGroup(menu, ITextEditorActionConstants.GROUP_EDIT, IContextMenuConstants.GROUP_GENERATE); addGroup(menu, ITextEditorActionConstants.GROUP_EDIT, IContextMenuConstants.GROUP_NEW); new JavaSearchGroup(false).fill(menu, ITextEditorActionConstants.GROUP_FIND, isTextSelectionEmpty());
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
addAction(menu, ITextEditorActionConstants.GROUP_FIND, "ShowJavaDoc"); addAction(menu, ITextEditorActionConstants.GROUP_FIND, "OpenSuperImplementation"); menu.appendToGroup(ITextEditorActionConstants.GROUP_FIND, new ShowInPackageViewAction()); addAction(menu, "RunToLine"); } /** * Creates the outline page used with this editor. */ protected JavaOutlinePage createOutlinePage() { JavaOutlinePage page= new JavaOutlinePage(fOutlinerContextMenuId, this); page.addSelectionChangedListener(this); setOutlinePageInput(page, getEditorInput()); page.setAction("OpenImportDeclaration", new OpenImportDeclarationAction(page)); page.setAction("ShowInPackageView", new ShowInPackageViewAction()); page.setAction("AddMethodEntryBreakpoint", new AddMethodEntryBreakpointAction(page)); page.setAction("AddWatchpoint", new AddWatchpointAction(page)); StructuredSelectionProvider selectionProvider= StructuredSelectionProvider.createFrom(page); page.setAction("OpenSuperImplementation", new OpenSuperImplementationAction(selectionProvider)); return page; } /** * Informs the editor that its outliner has been closed. */
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
public void outlinePageClosed() { if (fOutlinePage != null) { fOutlinePage.removeSelectionChangedListener(this); fOutlinePage= null; resetHighlightRange(); } } /* * Get the dektop's StatusLineManager */ protected IStatusLineManager getStatusLineManager() { IEditorActionBarContributor contributor= getEditorSite().getActionBarContributor(); if (contributor instanceof EditorActionBarContributor) { return ((EditorActionBarContributor) contributor).getActionBars().getStatusLineManager(); } return null; } /** * @see AbstractTextEditor#getAdapter(Class) */ public Object getAdapter(Class required) { if (IContentOutlinePage.class.equals(required)) { if (fOutlinePage == null) fOutlinePage= createOutlinePage(); return fOutlinePage; } return super.getAdapter(required);
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
} protected void setSelection(ISourceReference reference, boolean moveCursor) { if (reference != null) { try { ISourceRange range= reference.getSourceRange(); if (range == null) return; int offset= range.getOffset(); int length= range.getLength(); if (offset > -1 && length >= 0) { setHighlightRange(offset, length, moveCursor); if (moveCursor && (reference instanceof IMember)) { range= ((IMember) reference).getNameRange(); offset= range.getOffset(); length= range.getLength(); if (range != null && offset > -1 && length > 0) { if (getSourceViewer() != null) { getSourceViewer().revealRange(offset, length); getSourceViewer().setSelectedRange(offset, length); } } }
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
} return; } catch (JavaModelException x) { } catch (IllegalArgumentException x) { } } if (moveCursor) resetHighlightRange(); } public void setSelection(IJavaElement element) { if (element == null || element instanceof ICompilationUnit) { /* * If the element is an ICompilationUnit this unit is either the input * of this editor or not being displayed. In both cases, nothing should * happened. (http://dev.eclipse.org/bugs/show_bug.cgi?id=5128) */ return; } IJavaElement corresponding= getCorrespondingElement(element); if (corresponding instanceof ISourceReference) { ISourceReference reference= (ISourceReference) corresponding; setSelection(reference, true);
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
if (fOutlinePage != null) { fOutlinePage.removeSelectionChangedListener(this); fOutlinePage.select(reference); fOutlinePage.addSelectionChangedListener(this); } } } public void selectionChanged(SelectionChangedEvent event) { ISourceReference reference= null; ISelection selection= event.getSelection(); Iterator iter= ((IStructuredSelection) selection).iterator(); while (iter.hasNext()) { Object o= iter.next(); if (o instanceof ISourceReference) { reference= (ISourceReference) o; break; } } if (!isActivePart() && JavaPlugin.getActivePage() != null) JavaPlugin.getActivePage().bringToTop(this); setSelection(reference, !isActivePart()); } /** * @see AbstractTextEditor#adjustHighlightRange(int, int) */ protected void adjustHighlightRange(int offset, int length) {
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
try { IJavaElement element= getElementAt(offset); while (element instanceof ISourceReference) { ISourceRange range= ((ISourceReference) element).getSourceRange(); if (offset < range.getOffset() + range.getLength() && range.getOffset() < offset + length) { setHighlightRange(range.getOffset(), range.getLength(), true); if (fOutlinePage != null) { fOutlinePage.removeSelectionChangedListener(this); fOutlinePage.select((ISourceReference) element); fOutlinePage.addSelectionChangedListener(this); } return; } element= element.getParent(); } } catch (JavaModelException x) { } resetHighlightRange(); } protected boolean isActivePart() { IWorkbenchWindow window= getSite().getWorkbenchWindow(); IPartService service= window.getPartService(); return (this == service.getActivePart()); }
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
/** * @see AbstractTextEditor#doSetInput */ protected void doSetInput(IEditorInput input) throws CoreException { super.doSetInput(input); setOutlinePageInput(fOutlinePage, input); } protected void createActions() { super.createActions(); setAction("ShowJavaDoc", new TextOperationAction(JavaEditorMessages.getResourceBundle(), "ShowJavaDoc.", this, ISourceViewer.INFORMATION)); setAction("RunToLine", new RunToLineAction(this)); StructuredSelectionProvider provider= StructuredSelectionProvider.createFrom(getSite().getWorkbenchWindow().getSelectionService()); setAction("OpenSuperImplementation", new OpenSuperImplementationAction(provider)); } private boolean isTextSelectionEmpty() { ISelection selection= getSelectionProvider().getSelection(); if (!(selection instanceof ITextSelection)) return true; return ((ITextSelection)selection).getLength() == 0; } public void updatedTitleImage(Image image) { setTitleImage(image); } }
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.preferences; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Hashtable; import org.eclipse.swt.SWT; 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.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;
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.TabFolder; import org.eclipse.swt.widgets.TabItem; import org.eclipse.swt.widgets.Text; import org.eclipse.core.runtime.IStatus; 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.IDocument; import org.eclipse.jface.text.source.SourceViewer; 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.ui.text.JavaSourceViewerConfiguration; import org.eclipse.jdt.ui.text.JavaTextTools; import org.eclipse.jdt.internal.formatter.CodeFormatter; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.JavaUIMessages; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; import org.eclipse.jdt.internal.ui.dialogs.StatusUtil; import org.eclipse.jdt.internal.ui.util.TabFolderLayout; /* * The page for setting code formatter options */ public class CodeFormatterPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
private static final String PREF_NEWLINE_OPENING_BRACES= "org.eclipse.jdt.core.formatter.newline.openingBrace"; private static final String PREF_NEWLINE_CONTROL_STATEMENT= "org.eclipse.jdt.core.formatter.newline.controlStatement"; private static final String PREF_NEWLINE_CLEAR_ALL= "org.eclipse.jdt.core.formatter.newline.clearAll"; private static final String PREF_NEWLINE_ELSE_IF= "org.eclipse.jdt.core.formatter.newline.elseIf"; private static final String PREF_NEWLINE_EMPTY_BLOCK= "org.eclipse.jdt.core.formatter.newline.emptyBlock"; private static final String PREF_LINE_SPLIT= "org.eclipse.jdt.core.formatter.lineSplit"; private static final String PREF_STYLE_COMPACT_ASSIGNEMENT= "org.eclipse.jdt.core.formatter.style.assignment"; private static final String PREF_TAB_CHAR= "org.eclipse.jdt.core.formatter.tabulation.char"; private static final String PREF_TAB_SIZE= "org.eclipse.jdt.core.formatter.tabulation.size"; private static final String INSERT= "insert"; private static final String DO_NOT_INSERT= "do not insert"; private static final String COMPACT= "compact"; private static final String NORMAL= "normal"; private static final String TAB= "tab"; private static final String SPACE= "space"; private static final String CLEAR_ALL= "clear all"; private static final String PRESERVE_ONE= "preserve one"; private static String[] getAllKeys() { return new String[] { PREF_NEWLINE_OPENING_BRACES, PREF_NEWLINE_CONTROL_STATEMENT, PREF_NEWLINE_CLEAR_ALL, PREF_NEWLINE_ELSE_IF, PREF_NEWLINE_EMPTY_BLOCK, PREF_LINE_SPLIT,
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
PREF_STYLE_COMPACT_ASSIGNEMENT, PREF_TAB_CHAR, PREF_TAB_SIZE }; } /** * Gets the currently configured tab size */ public static int getTabSize() { String string= (String) JavaCore.getOptions().get(PREF_TAB_SIZE); return getIntValue(string, 4); } /** * Gets the current compating assignement configuration */ public static boolean isCompactingAssignment() { return COMPACT.equals(JavaCore.getOptions().get(PREF_STYLE_COMPACT_ASSIGNEMENT)); } /** * Gets the current compating assignement configuration */ public static boolean useSpaces() { return SPACE.equals(JavaCore.getOptions().get(PREF_TAB_CHAR)); } private static int getIntValue(String string, int dflt) { try { return Integer.parseInt(string);
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
} catch (NumberFormatException e) { } return dflt; } /** * 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("CodeFormatterPreferencePage: value is null: " + key); } String val= store.getString(key); if (val != null) { currOptions.put(key, val); } } JavaCore.setOptions(currOptions); } private static class ControlData {
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
private String fKey; private String[] fValues; public ControlData(String key, String[] values) { fKey= key; fValues= values; } public String getKey() { return fKey; } public String getValue(boolean selection) { int index= selection ? 0 : 1; return fValues[index]; } public String getValue(int index) { return fValues[index]; }
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
public int getSelection(String value) { for (int i= 0; i < fValues.length; i++) { if (value.equals(fValues[i])) { return i; } } throw new IllegalArgumentException(); } } private Hashtable fWorkingValues; private ArrayList fCheckBoxes; private ArrayList fTextBoxes; private SelectionListener fButtonSelectionListener; private ModifyListener fTextModifyListener; private String fPreviewText; private IDocument fPreviewDocument; private Text fTabSizeTextBox; public CodeFormatterPreferencePage() { setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore()); setDescription(JavaUIMessages.getString("CodeFormatterPreferencePage.description")); fWorkingValues= JavaCore.getOptions(); fCheckBoxes= new ArrayList(); fTextBoxes= new ArrayList();
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
fButtonSelectionListener= new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) {} public void widgetSelected(SelectionEvent e) { if (!e.widget.isDisposed()) { controlChanged((Button) e.widget); } } }; fTextModifyListener= new ModifyListener() { public void modifyText(ModifyEvent e) { if (!e.widget.isDisposed()) { textChanged((Text) e.widget); } } }; fPreviewDocument= new Document(); fPreviewText= loadPreviewFile("CodeFormatterPreviewCode.txt"); } /* * @see IWorkbenchPreferencePage#init() */ public void init(IWorkbench workbench) { } /* * @see PreferencePage#createControl(Composite) */ public void createControl(Composite parent) {
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
super.createControl(parent); WorkbenchHelp.setHelp(getControl(), new DialogPageContextComputer(this, IJavaHelpContextIds.CODEFORMATTER_PREFERENCE_PAGE)); } /* * @see PreferencePage#createContents(Composite) */ protected Control createContents(Composite parent) { GridLayout layout= new GridLayout(); layout.marginHeight= 0; layout.marginWidth= 0; Composite composite= new Composite(parent, SWT.NONE); composite.setLayout(layout); TabFolder folder= new TabFolder(composite, SWT.NONE); folder.setLayout(new TabFolderLayout()); folder.setLayoutData(new GridData(GridData.FILL_BOTH)); String[] insertNotInsert= new String[] { INSERT, DO_NOT_INSERT }; layout= new GridLayout(); layout.numColumns= 2; Composite newlineComposite= new Composite(folder, SWT.NULL); newlineComposite.setLayout(layout); String label= JavaUIMessages.getString("CodeFormatterPreferencePage.newline_opening_braces.label"); addCheckBox(newlineComposite, label, PREF_NEWLINE_OPENING_BRACES, insertNotInsert);
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
label= JavaUIMessages.getString("CodeFormatterPreferencePage.newline_control_statement.label"); addCheckBox(newlineComposite, label, PREF_NEWLINE_CONTROL_STATEMENT, insertNotInsert); label= JavaUIMessages.getString("CodeFormatterPreferencePage.newline_clear_lines"); addCheckBox(newlineComposite, label, PREF_NEWLINE_CLEAR_ALL, new String[] { CLEAR_ALL, PRESERVE_ONE } ); label= JavaUIMessages.getString("CodeFormatterPreferencePage.newline_else_if.label"); addCheckBox(newlineComposite, label, PREF_NEWLINE_ELSE_IF, insertNotInsert); label= JavaUIMessages.getString("CodeFormatterPreferencePage.newline_empty_block.label"); addCheckBox(newlineComposite, label, PREF_NEWLINE_EMPTY_BLOCK, insertNotInsert); layout= new GridLayout(); layout.numColumns= 2; Composite lineSplittingComposite= new Composite(folder, SWT.NULL); lineSplittingComposite.setLayout(layout); label= JavaUIMessages.getString("CodeFormatterPreferencePage.split_line.label"); addTextField(lineSplittingComposite, label, PREF_LINE_SPLIT); layout= new GridLayout(); layout.numColumns= 2; Composite styleComposite= new Composite(folder, SWT.NULL); styleComposite.setLayout(layout); label= JavaUIMessages.getString("CodeFormatterPreferencePage.style_compact_assignement.label"); addCheckBox(styleComposite, label, PREF_STYLE_COMPACT_ASSIGNEMENT, new String[] { COMPACT, NORMAL } ); label= JavaUIMessages.getString("CodeFormatterPreferencePage.tab_char.label"); addCheckBox(styleComposite, label, PREF_TAB_CHAR, new String[] { TAB, SPACE } ); label= JavaUIMessages.getString("CodeFormatterPreferencePage.tab_size.label"); fTabSizeTextBox= addTextField(styleComposite, label, PREF_TAB_SIZE); fTabSizeTextBox.setEnabled(!usesTabs()); TabItem item= new TabItem(folder, SWT.NONE);
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
item.setText(JavaUIMessages.getString("CodeFormatterPreferencePage.tab.newline.tabtitle")); item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_IMPDECL)); item.setControl(newlineComposite); item= new TabItem(folder, SWT.NONE); item.setText(JavaUIMessages.getString("CodeFormatterPreferencePage.tab.linesplit.tabtitle")); item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_CFILE)); item.setControl(lineSplittingComposite); item= new TabItem(folder, SWT.NONE); item.setText(JavaUIMessages.getString("CodeFormatterPreferencePage.tab.style.tabtitle")); item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_SEARCH_REF)); item.setControl(styleComposite); createPreview(parent); updatePreview(); return composite; } private Control createPreview(Composite parent) { SourceViewer previewViewer= new SourceViewer(parent, null, SWT.V_SCROLL | SWT.H_SCROLL); JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools(); previewViewer.configure(new JavaSourceViewerConfiguration(tools, null)); previewViewer.getTextWidget().setFont(JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT)); previewViewer.setEditable(false); previewViewer.setDocument(fPreviewDocument); Control control= previewViewer.getControl(); GridData gdata= new GridData(GridData.FILL_BOTH); gdata.widthHint= convertWidthInCharsToPixels(80);
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
gdata.heightHint= convertHeightInCharsToPixels(15); control.setLayoutData(gdata); return control; } private Button 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); String currValue= (String)fWorkingValues.get(key); checkBox.setSelection(data.getSelection(currValue) == 0); checkBox.addSelectionListener(fButtonSelectionListener); fCheckBoxes.add(checkBox); return checkBox; } private Text addTextField(Composite parent, String label, String key) { Label labelControl= new Label(parent, SWT.NONE); labelControl.setText(label); labelControl.setLayoutData(new GridData()); Text textBox= new Text(parent, SWT.BORDER | SWT.SINGLE);
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
textBox.setData(key); textBox.setLayoutData(new GridData()); String currValue= (String)fWorkingValues.get(key); textBox.setText(String.valueOf(getIntValue(currValue, 1))); textBox.setTextLimit(3); textBox.addModifyListener(fTextModifyListener); GridData gd= new GridData(); gd.widthHint= convertWidthInCharsToPixels(5); textBox.setLayoutData(gd); fTextBoxes.add(textBox); return textBox; } private void controlChanged(Button button) { ControlData data= (ControlData) button.getData(); boolean selection= button.getSelection(); String newValue= data.getValue(selection); fWorkingValues.put(data.getKey(), newValue); updatePreview(); if (PREF_TAB_CHAR.equals(data.getKey())) { fTabSizeTextBox.setEnabled(!selection); updateStatus(new StatusInfo()); if (selection) { fTabSizeTextBox.setText((String)fWorkingValues.get(PREF_TAB_SIZE)); } } }
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
private void textChanged(Text textControl) { String key= (String) textControl.getData(); String number= textControl.getText(); IStatus status= validatePositiveNumber(number); if (!status.matches(IStatus.ERROR)) { fWorkingValues.put(key, number); } updateStatus(status); updatePreview(); } /* * @see IPreferencePage#performOk() */ public boolean performOk() { String[] allKeys= getAllKeys(); Hashtable actualOptions= JavaCore.getOptions(); IPreferenceStore store= getPreferenceStore(); for (int i= 0; i < allKeys.length; i++) { String key= allKeys[i]; String val= (String) fWorkingValues.get(key); actualOptions.put(key, val); store.setValue(key, val); } JavaCore.setOptions(actualOptions); return super.performOk(); }
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
/* * @see PreferencePage#performDefaults() */ protected void performDefaults() { fWorkingValues= JavaCore.getDefaultOptions(); updateControls(); super.performDefaults(); } private String loadPreviewFile(String filename) { String separator= System.getProperty("line.separator"); StringBuffer btxt= new StringBuffer(512); BufferedReader rin= null; try { rin= new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(filename))); String line; while ((line= rin.readLine()) != null) { btxt.append(line); btxt.append(separator); } } catch (IOException io) { JavaPlugin.log(io); } finally { if (rin != null) { try { rin.close(); } catch (IOException e) {} } } return btxt.toString(); } private void updatePreview() {
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
fPreviewDocument.set(CodeFormatter.format(fPreviewText, 0, fWorkingValues)); } 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= fTextBoxes.size() - 1; i >= 0; i--) { Text curr= (Text) fTextBoxes.get(i); String key= (String) curr.getData(); String currValue= (String) fWorkingValues.get(key); curr.setText(currValue); } fTabSizeTextBox.setEnabled(!usesTabs()); } private IStatus validatePositiveNumber(String number) { StatusInfo status= new StatusInfo(); if (number.length() == 0) { status.setError(JavaUIMessages.getString("CodeFormatterPreferencePage.empty_input")); } else { try { int value= Integer.parseInt(number); if (value < 0) { status.setError(JavaUIMessages.getFormattedString("CodeFormatterPreferencePage.invalid_input", number));
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
} } catch (NumberFormatException e) { status.setError(JavaUIMessages.getFormattedString("CodeFormatterPreferencePage.invalid_input", number)); } } return status; } private void updateStatus(IStatus status) { if (!status.matches(IStatus.ERROR)) { for (int i= 0; i < fTextBoxes.size(); i++) { Text curr= (Text) fTextBoxes.get(i); if (!(curr == fTabSizeTextBox && usesTabs())) { IStatus currStatus= validatePositiveNumber(curr.getText()); status= StatusUtil.getMoreSevere(currStatus, status); } } } setValid(!status.matches(IStatus.ERROR)); StatusUtil.applyToStatusLine(this, status); } private boolean usesTabs() { return TAB.equals(fWorkingValues.get(PREF_TAB_CHAR)); } }
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.preferences; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import org.eclipse.swt.SWT; 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.RGB; 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.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.List; import org.eclipse.swt.widgets.TabFolder; import org.eclipse.swt.widgets.TabItem; import org.eclipse.swt.widgets.Text;
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.jface.preference.PreferencePage; import org.eclipse.jface.resource.JFaceResources; import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IDocumentPartitioner; import org.eclipse.jface.text.source.SourceViewer; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; 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.ui.texteditor.AbstractTextEditor; import org.eclipse.ui.texteditor.WorkbenchChainedTextFontFieldEditor; import org.eclipse.jdt.ui.text.IJavaColorConstants; 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.JavaPluginImages; import org.eclipse.jdt.internal.ui.JavaUIMessages; import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor; import org.eclipse.jdt.internal.ui.text.ContentAssistPreference; import org.eclipse.jdt.internal.ui.util.TabFolderLayout; /* * The page for setting the editor options. */ public class JavaEditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
6,092
Bug 6092 JavaEditor should honor the tab width setting of the JavaFormatter
null
verified fixed
896299e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-11-27T15:00:03Z
2001-11-20T09:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
public final OverlayPreferenceStore.OverlayKey[] fKeys= new OverlayPreferenceStore.OverlayKey[] { new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND), new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND), new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, IJavaColorConstants.JAVA_MULTI_LINE_COMMENT), new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IJavaColorConstants.JAVA_MULTI_LINE_COMMENT + "_bold"), new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, IJavaColorConstants.JAVA_SINGLE_LINE_COMMENT), new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IJavaColorConstants.JAVA_SINGLE_LINE_COMMENT + "_bold"), new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, IJavaColorConstants.JAVA_KEYWORD),