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
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
import org.eclipse.jface.text.ITextViewerExtension; import org.eclipse.jface.text.TextEvent; import org.eclipse.jface.text.contentassist.ContentAssistant; import org.eclipse.jface.text.contentassist.IContentAssistProcessor; 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.corext.template.ContextTypeRegistry; import org.eclipse.jdt.internal.corext.template.Template; import org.eclipse.jdt.internal.corext.template.TemplateMessages; import org.eclipse.jdt.internal.corext.template.TemplateTranslator; 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.ContentAssistPreference; import org.eclipse.jdt.internal.ui.text.template.TemplateVariableProcessor; import org.eclipse.jdt.internal.ui.util.SWTUtil; /** * Dialog to edit a template. */ public class EditTemplateDialog extends StatusDialog { private static class SimpleJavaSourceViewerConfiguration extends JavaSourceViewerConfiguration {
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
private final IContentAssistProcessor fProcessor; SimpleJavaSourceViewerConfiguration(JavaTextTools tools, ITextEditor editor, IContentAssistProcessor processor) { super(tools, editor); fProcessor= processor; } /* * @see SourceViewerConfiguration#getContentAssistant(ISourceViewer) */ public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore(); ContentAssistant assistant= new ContentAssistant(); assistant.setContentAssistProcessor(fProcessor, IDocument.DEFAULT_CONTENT_TYPE); assistant.enableAutoInsert(store.getBoolean(ContentAssistPreference.AUTOINSERT)); assistant.enableAutoActivation(store.getBoolean(ContentAssistPreference.AUTOACTIVATION)); assistant.setAutoActivationDelay(store.getInt(ContentAssistPreference.AUTOACTIVATION_DELAY)); assistant.setProposalPopupOrientation(assistant.PROPOSAL_OVERLAY); assistant.setContextInformationPopupOrientation(assistant.CONTEXT_INFO_ABOVE); assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer)); Display display= sourceViewer.getTextWidget().getDisplay(); Color background= createColor(store, ContentAssistPreference.PROPOSALS_BACKGROUND, display); assistant.setContextInformationPopupBackground(background); assistant.setContextSelectorBackground(background); assistant.setProposalSelectorBackground(background); Color foreground= createColor(store, ContentAssistPreference.PROPOSALS_FOREGROUND, display); assistant.setContextInformationPopupForeground(foreground); assistant.setContextSelectorForeground(foreground); assistant.setProposalSelectorForeground(foreground);
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
return assistant; } /** * Creates a color from the information stored in the given preference store. * Returns <code>null</code> if there is no such information available. */ private Color createColor(IPreferenceStore store, String key, Display display) { RGB rgb= null; if (store.contains(key)) { if (store.isDefault(key)) rgb= PreferenceConverter.getDefaultColor(store, key); else rgb= PreferenceConverter.getColor(store, key); if (rgb != null) return new Color(display, rgb); } return null; } } private static class TextViewerAction extends Action implements IUpdate { private int fOperationCode= -1; private ITextOperationTarget fOperationTarget; public TextViewerAction(ITextViewer viewer, int operationCode) {
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
fOperationCode= operationCode; fOperationTarget= viewer.getTextOperationTarget(); update(); } /** * Updates the enabled state of the action. * Fires a property change if the enabled state changes. * * @see Action#firePropertyChange(String, Object, Object) */ public void update() { boolean wasEnabled= isEnabled(); boolean isEnabled= (fOperationTarget != null && fOperationTarget.canDoOperation(fOperationCode)); setEnabled(isEnabled); if (wasEnabled != isEnabled) { firePropertyChange(ENABLED, wasEnabled ? Boolean.TRUE : Boolean.FALSE, isEnabled ? Boolean.TRUE : Boolean.FALSE); } } /** * @see Action#run() */ public void run() { if (fOperationCode != -1 && fOperationTarget != null) { fOperationTarget.doOperation(fOperationCode); } }
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
} private final Template fTemplate; private Text fNameText; private Text fDescriptionText; private Combo fContextCombo; private SourceViewer fPatternEditor; private Button fInsertVariableButton; private TemplateTranslator fTranslator= new TemplateTranslator(); private boolean fSuppressError= true; private Map fGlobalActions= new HashMap(10); private List fSelectionActions = new ArrayList(3); private Vector fContextTypes= new Vector(); private final TemplateVariableProcessor fProcessor= new TemplateVariableProcessor(); public EditTemplateDialog(Shell parent, Template template, boolean edit) { super(parent); setShellStyle(getShellStyle() | SWT.MAX | SWT.RESIZE); String title= edit ? TemplateMessages.getString("EditTemplateDialog.title.edit") : TemplateMessages.getString("EditTemplateDialog.title.new"); setTitle(title); fTemplate= template; ContextTypeRegistry registry= ContextTypeRegistry.getInstance(); for (Iterator iterator= registry.iterator(); iterator.hasNext(); ) fContextTypes.add(iterator.next());
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
if (fContextTypes.size() > 0) fProcessor.setContextType(ContextTypeRegistry.getInstance().getContextType((String) fContextTypes.get(0))); } /* * @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; 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(); }
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
}); createLabel(composite, TemplateMessages.getString("EditTemplateDialog.context")); fContextCombo= new Combo(composite, SWT.READ_ONLY); for (Iterator iterator= fContextTypes.iterator(); iterator.hasNext(); ) fContextCombo.add((String) iterator.next()); fContextCombo.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { String name= fContextCombo.getText(); fProcessor.setContextType(ContextTypeRegistry.getInstance().getContextType(name)); } }); createLabel(parent, TemplateMessages.getString("EditTemplateDialog.description")); fDescriptionText= createText(parent); composite= new Composite(parent, SWT.NONE); composite.setLayoutData(new GridData(GridData.FILL_VERTICAL)); layout= new GridLayout(); layout.marginWidth= 0; layout.marginHeight= 0; composite.setLayout(layout); createLabel(composite, TemplateMessages.getString("EditTemplateDialog.pattern")); fPatternEditor= createEditor(parent); Label filler= new Label(composite, SWT.NONE); filler.setLayoutData(new GridData(GridData.FILL_VERTICAL)); fInsertVariableButton= new Button(composite, SWT.NONE); fInsertVariableButton.setLayoutData(getButtonGridData(fInsertVariableButton)); fInsertVariableButton.setText(TemplateMessages.getString("EditTemplateDialog.insert.variable")); fInsertVariableButton.addSelectionListener(new SelectionListener() {
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
public void widgetSelected(SelectionEvent e) { fPatternEditor.getTextWidget().setFocus(); fPatternEditor.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS); } public void widgetDefaultSelected(SelectionEvent e) {} }); fNameText.setText(fTemplate.getName()); fDescriptionText.setText(fTemplate.getDescription()); fContextCombo.select(getIndex(fTemplate.getContextTypeName())); 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)); return text; }
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
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, fProcessor)); 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) { try { fTranslator.translate(event.getDocumentEvent().getDocument().get()); } catch (CoreException e) { JavaPlugin.log(e); } updateUndoAction(); updateButtons(); } }); viewer.addSelectionChangedListener(new ISelectionChangedListener() {
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
public void selectionChanged(SelectionChangedEvent event) { updateSelectionDependentActions(); } }); if (viewer instanceof ITextViewerExtension) { ((ITextViewerExtension) viewer).prependVerifyKeyListener(new VerifyKeyListener() { public void verifyKey(VerifyEvent event) { handleVerifyKeyPressed(event); } }); } else { 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;
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
case (int) 'z' - (int) 'a' + 1: fPatternEditor.doOperation(ITextOperationTarget.UNDO); break; } } private void handleVerifyKeyPressed(VerifyEvent event) { if (!event.doit) return; if (event.stateMask != SWT.CTRL) return; switch (event.character) { case ' ': fPatternEditor.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS); event.doit= false; break; case (int) 'z' - (int) 'a' + 1: fPatternEditor.doOperation(ITextOperationTarget.UNDO); event.doit= false; 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); action.setText(TemplateMessages.getString("EditTemplateDialog.cut"));
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
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); } private void fillContextMenu(IMenuManager menu) {
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
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 int getIndex(String context) { ContextTypeRegistry registry= ContextTypeRegistry.getInstance(); registry.getContextType(context);
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java
if (context == null) return -1; return fContextTypes.indexOf(context); } 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 (fTranslator.getErrorMessage() != null) { status.setError(fTranslator.getErrorMessage()); } updateStatus(status); } }
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
package org.eclipse.jdt.internal.ui.preferences; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferencePage; import org.eclipse.jface.resource.JFaceResources; import org.eclipse.jface.text.Document; import org.eclipse.jface.text.source.SourceViewer; import org.eclipse.jface.viewers.CheckStateChangedEvent; import org.eclipse.jface.viewers.CheckboxTableViewer; import org.eclipse.jface.viewers.ColumnWeightData;
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
import org.eclipse.jface.viewers.DoubleClickEvent; import org.eclipse.jface.viewers.ICheckStateListener; import org.eclipse.jface.viewers.IDoubleClickListener; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TableLayout; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerSorter; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.help.DialogPageContextComputer; import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.jdt.ui.JavaUI; import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration; import org.eclipse.jdt.ui.text.JavaTextTools; import org.eclipse.jdt.internal.corext.template.ContextType; import org.eclipse.jdt.internal.corext.template.ContextTypeRegistry; import org.eclipse.jdt.internal.corext.template.Template; import org.eclipse.jdt.internal.corext.template.TemplateContext; import org.eclipse.jdt.internal.corext.template.TemplateMessages; import org.eclipse.jdt.internal.corext.template.TemplateSet; import org.eclipse.jdt.internal.corext.template.Templates; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.text.template.TemplateContentProvider; import org.eclipse.jdt.internal.ui.text.template.TemplateLabelProvider; import org.eclipse.jdt.internal.ui.util.SWTUtil; public class TemplatePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
private static final String PREF_FORMAT_TEMPLATES= JavaUI.ID_PLUGIN + ".template.format"; private Templates fTemplates; private CheckboxTableViewer fTableViewer; private Button fAddButton; private Button fEditButton; private Button fImportButton; private Button fExportButton; private Button fExportAllButton; private Button fRemoveButton; private Button fEnableAllButton; private Button fDisableAllButton; private SourceViewer fPatternViewer; private Button fFormatButton; public TemplatePreferencePage() { super(); setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore()); setDescription(TemplateMessages.getString("TemplatePreferencePage.message")); fTemplates= Templates.getInstance(); } /** * @see PreferencePage#createContents(Composite) */ protected Control createContents(Composite ancestor) { Composite parent= new Composite(ancestor, SWT.NONE); GridLayout layout= new GridLayout(); layout.numColumns= 2; layout.marginHeight= 0;
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
layout.marginWidth= 0; parent.setLayout(layout); Table table= new Table(parent, SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION); GridData data= new GridData(GridData.FILL_BOTH); data.widthHint= convertWidthInCharsToPixels(60); data.heightHint= convertHeightInCharsToPixels(10); table.setLayoutData(data); table.setHeaderVisible(true); table.setLinesVisible(true); TableLayout tableLayout= new TableLayout(); table.setLayout(tableLayout); TableColumn column1= new TableColumn(table, SWT.NONE); column1.setText(TemplateMessages.getString("TemplatePreferencePage.column.name")); TableColumn column2= new TableColumn(table, SWT.NONE); column2.setText(TemplateMessages.getString("TemplatePreferencePage.column.context")); TableColumn column3= new TableColumn(table, SWT.NONE); column3.setText(TemplateMessages.getString("TemplatePreferencePage.column.description")); tableLayout.addColumnData(new ColumnWeightData(30)); tableLayout.addColumnData(new ColumnWeightData(20)); tableLayout.addColumnData(new ColumnWeightData(70)); fTableViewer= new CheckboxTableViewer(table); fTableViewer.setLabelProvider(new TemplateLabelProvider()); fTableViewer.setContentProvider(new TemplateContentProvider()); fTableViewer.setSorter(new ViewerSorter() { public int compare(Viewer viewer, Object object1, Object object2) { if ((object1 instanceof Template) && (object2 instanceof Template)) {
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
Template left= (Template) object1; Template right= (Template) object2; int result= left.getName().compareToIgnoreCase(right.getName()); if (result != 0) return result; return left.getDescription().compareToIgnoreCase(right.getDescription()); } return super.compare(viewer, object1, object2); } public boolean isSorterProperty(Object element, String property) { return true; } }); fTableViewer.addDoubleClickListener(new IDoubleClickListener() { public void doubleClick(DoubleClickEvent e) { edit(); } }); fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent e) { selectionChanged1(); } }); fTableViewer.addCheckStateListener(new ICheckStateListener() { public void checkStateChanged(CheckStateChangedEvent event) { Template template= (Template) event.getElement(); template.setEnabled(event.getChecked());
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
} }); Composite buttons= new Composite(parent, SWT.NULL); buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); layout= new GridLayout(); layout.marginHeight= 0; layout.marginWidth= 0; buttons.setLayout(layout); fAddButton= new Button(buttons, SWT.PUSH); fAddButton.setLayoutData(getButtonGridData(fAddButton)); fAddButton.setText(TemplateMessages.getString("TemplatePreferencePage.new")); fAddButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { add(); } }); fEditButton= new Button(buttons, SWT.PUSH); fEditButton.setLayoutData(getButtonGridData(fEditButton)); fEditButton.setText(TemplateMessages.getString("TemplatePreferencePage.edit")); fEditButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { edit(); } }); fRemoveButton= new Button(buttons, SWT.PUSH); fRemoveButton.setLayoutData(getButtonGridData(fRemoveButton)); fRemoveButton.setText(TemplateMessages.getString("TemplatePreferencePage.remove")); fRemoveButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) {
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
remove(); } }); createSpacer(buttons); fImportButton= new Button(buttons, SWT.PUSH); fImportButton.setLayoutData(getButtonGridData(fImportButton)); fImportButton.setText(TemplateMessages.getString("TemplatePreferencePage.import")); fImportButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { import_(); } }); fExportButton= new Button(buttons, SWT.PUSH); fExportButton.setLayoutData(getButtonGridData(fExportButton)); fExportButton.setText(TemplateMessages.getString("TemplatePreferencePage.export")); fExportButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { export(); } }); fExportAllButton= new Button(buttons, SWT.PUSH); fExportAllButton.setLayoutData(getButtonGridData(fExportAllButton)); fExportAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.export.all")); fExportAllButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { exportAll(); } }); createSpacer(buttons);
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
fEnableAllButton= new Button(buttons, SWT.PUSH); fEnableAllButton.setLayoutData(getButtonGridData(fEnableAllButton)); fEnableAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.enable.all")); fEnableAllButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { enableAll(true); } }); fDisableAllButton= new Button(buttons, SWT.PUSH); fDisableAllButton.setLayoutData(getButtonGridData(fDisableAllButton)); fDisableAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.disable.all")); fDisableAllButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { enableAll(false); } }); fPatternViewer= createViewer(parent); createSpacer(parent); fFormatButton= new Button(parent, SWT.CHECK); fFormatButton.setText(TemplateMessages.getString("TemplatePreferencePage.use.code.formatter")); fTableViewer.setInput(fTemplates); fTableViewer.setAllChecked(false); fTableViewer.setCheckedElements(getEnabledTemplates()); IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore(); fFormatButton.setSelection(prefs.getBoolean(PREF_FORMAT_TEMPLATES)); updateButtons(); WorkbenchHelp.setHelp(parent, IJavaHelpContextIds.TEMPLATE_PREFERENCE_PAGE);
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
return parent; } private Template[] getEnabledTemplates() { Template[] templates= fTemplates.getTemplates(); List list= new ArrayList(templates.length); for (int i= 0; i != templates.length; i++) if (templates[i].isEnabled()) list.add(templates[i]); return (Template[]) list.toArray(new Template[list.size()]); } private SourceViewer createViewer(Composite parent) { Label label= new Label(parent, SWT.NONE); label.setText(TemplateMessages.getString("TemplatePreferencePage.preview")); GridData data= new GridData(); data.horizontalSpan= 2; label.setLayoutData(data); SourceViewer viewer= new SourceViewer(parent, null, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools(); viewer.configure(new JavaSourceViewerConfiguration(tools, null)); viewer.setEditable(false); viewer.setDocument(new Document()); viewer.getTextWidget().setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); Font font= JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT);
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
viewer.getTextWidget().setFont(font); Control control= viewer.getControl(); data= new GridData(GridData.FILL_BOTH); data.heightHint= convertHeightInCharsToPixels(5); control.setLayoutData(data); return viewer; } public void createSpacer(Composite parent) { Label spacer= new Label(parent, SWT.NONE); GridData data= new GridData(); data.horizontalAlignment= GridData.FILL; data.verticalAlignment= GridData.BEGINNING; data.heightHint= 4; spacer.setLayoutData(data); } private static GridData getButtonGridData(Button button) { GridData data= new GridData(GridData.FILL_HORIZONTAL); data.widthHint= SWTUtil.getButtonWidthHint(button); data.heightHint= SWTUtil.getButtonHeigthHint(button); return data; } private void selectionChanged1() { IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection(); if (selection.size() == 1) {
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
Template template= (Template) selection.getFirstElement(); fPatternViewer.getTextWidget().setText(template.getPattern()); } else { fPatternViewer.getTextWidget().setText(""); } updateButtons(); } private void updateButtons() { int selectionCount= ((IStructuredSelection) fTableViewer.getSelection()).size(); int itemCount= fTableViewer.getTable().getItemCount(); fEditButton.setEnabled(selectionCount == 1); fExportButton.setEnabled(selectionCount > 0); fRemoveButton.setEnabled(selectionCount > 0 && selectionCount <= itemCount); fEnableAllButton.setEnabled(itemCount > 0); fDisableAllButton.setEnabled(itemCount > 0); } private void add() { Template template= new Template(); ContextTypeRegistry registry=ContextTypeRegistry.getInstance(); ContextType type= registry.getContextType("java"); String contextTypeName; if (type != null) contextTypeName= type.getName(); else {
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
Iterator iterator= registry.iterator(); contextTypeName= (String) iterator.next(); } template.setContext(contextTypeName); EditTemplateDialog dialog= new EditTemplateDialog(getShell(), template, false); if (dialog.open() == dialog.OK) { fTemplates.add(template); fTableViewer.refresh(); fTableViewer.setChecked(template, template.isEnabled()); fTableViewer.setSelection(new StructuredSelection(template)); } } private void edit() { IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection(); Object[] objects= selection.toArray(); if ((objects == null) || (objects.length != 1)) return; Template template= (Template) selection.getFirstElement(); edit(template); } private void edit(Template template) { Template newTemplate= new Template(template); EditTemplateDialog dialog= new EditTemplateDialog(getShell(), newTemplate, true); if (dialog.open() == dialog.OK) { if (!newTemplate.getName().equals(template.getName()) && MessageDialog.openQuestion(getShell(), TemplateMessages.getString("TemplatePreferencePage.question.create.new.title"), TemplateMessages.getString("TemplatePreferencePage.question.create.new.message")))
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
{ template= newTemplate; fTemplates.add(template); fTableViewer.refresh(); } else { template.setName(newTemplate.getName()); template.setDescription(newTemplate.getDescription()); template.setContext(newTemplate.getContextTypeName()); template.setPattern(newTemplate.getPattern()); fTableViewer.refresh(template); } fTableViewer.setChecked(template, template.isEnabled()); fTableViewer.setSelection(new StructuredSelection(template)); } } private void import_() { FileDialog dialog= new FileDialog(getShell()); dialog.setText(TemplateMessages.getString("TemplatePreferencePage.import.title")); dialog.setFilterExtensions(new String[] {TemplateMessages.getString("TemplatePreferencePage.import.extension")}); String path= dialog.open(); if (path == null) return; try { fTemplates.addFromFile(new File(path)); fTableViewer.refresh(); fTableViewer.setAllChecked(false);
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
fTableViewer.setCheckedElements(getEnabledTemplates()); } catch (CoreException e) { openReadErrorDialog(e); } } private void exportAll() { export(fTemplates); } private void export() { IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection(); Object[] templates= selection.toArray(); TemplateSet templateSet= new TemplateSet(); for (int i= 0; i != templates.length; i++) templateSet.add((Template) templates[i]); export(templateSet); } private void export(TemplateSet templateSet) { FileDialog dialog= new FileDialog(getShell(), SWT.SAVE); dialog.setText(TemplateMessages.getFormattedString("TemplatePreferencePage.export.title", new Integer(templateSet.getTemplates().length))); dialog.setFilterExtensions(new String[] {TemplateMessages.getString("TemplatePreferencePage.export.extension")}); dialog.setFileName(TemplateMessages.getString("TemplatePreferencePage.export.filename")); String path= dialog.open(); if (path == null) return;
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
File file= new File(path); if (!file.exists() || confirmOverwrite(file)) { try { templateSet.saveToFile(file); } catch (CoreException e) { JavaPlugin.log(e); openWriteErrorDialog(e); } } } private boolean confirmOverwrite(File file) { return MessageDialog.openQuestion(getShell(), TemplateMessages.getString("TemplatePreferencePage.export.exists.title"), TemplateMessages.getFormattedString("TemplatePreferencePage.export.exists.message", file.getAbsolutePath())); } private void remove() { IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection(); Iterator elements= selection.iterator(); while (elements.hasNext()) { Template template= (Template) elements.next(); fTemplates.remove(template); } fTableViewer.refresh(); } private void enableAll(boolean enable) { Template[] templates= fTemplates.getTemplates(); for (int i= 0; i != templates.length; i++) templates[i].setEnabled(enable);
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
fTableViewer.setAllChecked(enable); } /* * @see IWorkbenchPreferencePage#init(IWorkbench) */ public void init(IWorkbench workbench) {} /* * @see Control#setVisible(boolean) */ public void setVisible(boolean visible) { super.setVisible(visible); if (visible) setTitle(TemplateMessages.getString("TemplatePreferencePage.title")); } /* * @see PreferencePage#performDefaults() */ protected void performDefaults() { IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore(); fFormatButton.setSelection(prefs.getDefaultBoolean(PREF_FORMAT_TEMPLATES)); try { fTemplates.restoreDefaults(); } catch (CoreException e) { JavaPlugin.log(e); openReadErrorDialog(e); }
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
fTableViewer.refresh(); fTableViewer.setAllChecked(false); fTableViewer.setCheckedElements(getEnabledTemplates()); } /* * @see PreferencePage#performOk() */ public boolean performOk() { IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore(); prefs.setValue(PREF_FORMAT_TEMPLATES, fFormatButton.getSelection()); try { fTemplates.save(); } catch (CoreException e) { JavaPlugin.log(e); openWriteErrorDialog(e); } JavaPlugin.getDefault().savePluginPreferences(); return super.performOk(); } /* * @see PreferencePage#performCancel() */ public boolean performCancel() { try { fTemplates.reset(); } catch (CoreException e) { JavaPlugin.log(e);
17,646
Bug 17646 Comments in Java Templates don't have right syntax coloring
F1 - open Template preferences - select filecomment observe: the preview doesn't rendere the filecomment using the defined color for comments, but it does use the color for the keyword this.
verified fixed
320f4fe
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T13:58:00Z
2002-05-24T14:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
openReadErrorDialog(e); } return super.performCancel(); } /** * Initializes the default values of this page in the preference bundle. * Will be called on startup of the JavaPlugin */ public static void initDefaults(IPreferenceStore prefs) { prefs.setDefault(PREF_FORMAT_TEMPLATES, true); } public static boolean useCodeFormatter() { IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore(); return prefs.getBoolean(PREF_FORMAT_TEMPLATES); } private void openReadErrorDialog(CoreException e) { ErrorDialog.openError(getShell(), TemplateMessages.getString("TemplatePreferencePage.error.read.title"), null, e.getStatus()); } private void openWriteErrorDialog(CoreException e) { ErrorDialog.openError(getShell(), TemplateMessages.getString("TemplatePreferencePage.error.write.title"), null, e.getStatus()); } }
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
package org.eclipse.jdt.internal.ui.javaeditor; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ScrolledComposite; import org.eclipse.swt.custom.StackLayout; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; 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.FontData; import org.eclipse.swt.layout.FillLayout; 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;
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
import org.eclipse.swt.widgets.Label; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.jface.resource.JFaceResources; import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.IMemento; import org.eclipse.ui.texteditor.IDocumentProvider; import org.eclipse.ui.texteditor.ITextEditorActionConstants; import org.eclipse.jdt.core.IClassFile; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IJavaModelStatusConstants; import org.eclipse.jdt.core.IPackageFragmentRoot; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.ToolFactory; import org.eclipse.jdt.core.util.IClassFileDisassembler; import org.eclipse.jdt.core.util.IClassFileReader; import org.eclipse.jdt.internal.core.JavaModelStatus; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; /** * Java specific text editor. */ public class ClassFileEditor extends JavaEditor implements ClassFileDocumentProvider.InputChangeListener {
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
/** * A form to attach source to a class file. */ private class SourceAttachmentForm implements IPropertyChangeListener {
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
private final IClassFile fFile; private ScrolledComposite fScrolledComposite; private Color fBackgroundColor; private Color fForegroundColor; private Color fSeparatorColor; private List fBannerLabels= new ArrayList(); private List fHeaderLabels= new ArrayList(); private Font fFont; /** * Creates a source attachment form for a class file. */ public SourceAttachmentForm(IClassFile file) { fFile= file; } /** * Returns the package fragment root of this file. */ private IPackageFragmentRoot getPackageFragmentRoot(IClassFile file) { IJavaElement element= file.getParent(); while (element != null && element.getElementType() != IJavaElement.PACKAGE_FRAGMENT_ROOT) element= element.getParent();
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
return (IPackageFragmentRoot) element; } /** * Creates the control of the source attachment form. */ public Control createControl(Composite parent) { Display display= parent.getDisplay(); fBackgroundColor= display.getSystemColor(SWT.COLOR_LIST_BACKGROUND); fForegroundColor= display.getSystemColor(SWT.COLOR_LIST_FOREGROUND); fSeparatorColor= new Color(display, 152, 170, 203); JFaceResources.getFontRegistry().addListener(this); fScrolledComposite= new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL); fScrolledComposite.setAlwaysShowScrollBars(false); fScrolledComposite.setExpandHorizontal(true); fScrolledComposite.setExpandVertical(true); fScrolledComposite.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { JFaceResources.getFontRegistry().removeListener(SourceAttachmentForm.this); fScrolledComposite= null; fSeparatorColor.dispose(); fSeparatorColor= null; fBannerLabels.clear(); fHeaderLabels.clear(); if (fFont != null) { fFont.dispose(); fFont= null;
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
} } }); Composite composite= createComposite(fScrolledComposite); composite.setLayout(new GridLayout()); Label titleLabel= createTitleLabel(composite, JavaEditorMessages.getString("SourceAttachmentForm.title")); createLabel(composite, null); createLabel(composite, null); createHeadingLabel(composite, JavaEditorMessages.getString("SourceAttachmentForm.heading")); Composite separator= createCompositeSeparator(composite); GridData data= new GridData(GridData.FILL_HORIZONTAL); data.heightHint= 2; separator.setLayoutData(data); final IPackageFragmentRoot root= getPackageFragmentRoot(fFile); if (root != null) { if (!root.isArchive()) { createLabel(composite, JavaEditorMessages.getFormattedString("SourceAttachmentForm.message.noSource", fFile.getElementName())); } else { try { Button button; IPath path= root.getSourceAttachmentPath();
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
if (path == null) { createLabel(composite, JavaEditorMessages.getFormattedString("SourceAttachmentForm.message.noSourceAttachment", root.getElementName())); createLabel(composite, JavaEditorMessages.getString("SourceAttachmentForm.message.pressButtonToAttach")); createLabel(composite, null); button= createButton(composite, JavaEditorMessages.getString("SourceAttachmentForm.button.attachSource")); } else { createLabel(composite, JavaEditorMessages.getFormattedString("SourceAttachmentForm.message.noSourceInAttachment", fFile.getElementName())); createLabel(composite, JavaEditorMessages.getString("SourceAttachmentForm.message.pressButtonToChange")); createLabel(composite, null); button= createButton(composite, JavaEditorMessages.getString("SourceAttachmentForm.button.changeAttachedSource")); } button.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent event) { try { SourceAttachmentDialog dialog= new SourceAttachmentDialog(fScrolledComposite.getShell(), root); if (dialog.open() == SourceAttachmentDialog.OK) verifyInput(getEditorInput()); } catch (CoreException e) { String title= JavaEditorMessages.getString("SourceAttachmentForm.error.title"); String message= JavaEditorMessages.getString("SourceAttachmentForm.error.message"); ExceptionHandler.handle(e, fScrolledComposite.getShell(), title, message); } } public void widgetDefaultSelected(SelectionEvent e) {}
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
}); } catch (JavaModelException e) { String title= JavaEditorMessages.getString("SourceAttachmentForm.error.title"); String message= JavaEditorMessages.getString("SourceAttachmentForm.error.message"); ExceptionHandler.handle(e, fScrolledComposite.getShell(), title, message); } } } separator= createCompositeSeparator(composite); data= new GridData(GridData.FILL_HORIZONTAL); data.heightHint= 2; separator.setLayoutData(data); StyledText styledText= createCodeView(composite); data= new GridData(GridData.FILL_BOTH); styledText.setLayoutData(data); updateCodeView(styledText, fFile); fScrolledComposite.setContent(composite); fScrolledComposite.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT)); return fScrolledComposite; } /* * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent) */ public void propertyChange(PropertyChangeEvent event) {
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
for (Iterator iterator = fBannerLabels.iterator(); iterator.hasNext();) { Label label = (Label) iterator.next(); label.setFont(JFaceResources.getBannerFont()); } for (Iterator iterator = fHeaderLabels.iterator(); iterator.hasNext();) { Label label = (Label) iterator.next(); label.setFont(JFaceResources.getHeaderFont()); } Control control= fScrolledComposite.getContent(); fScrolledComposite.setMinSize(control.computeSize(SWT.DEFAULT, SWT.DEFAULT)); fScrolledComposite.setContent(control); fScrolledComposite.layout(true); fScrolledComposite.redraw(); } private Composite createComposite(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setBackground(fBackgroundColor); return composite; }
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
private Composite createCompositeSeparator(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setBackground(fSeparatorColor); return composite; } private StyledText createCodeView(Composite parent) { int styles= SWT.MULTI | SWT.FULL_SELECTION; StyledText styledText= new StyledText(parent, styles); styledText.setBackground(fBackgroundColor); styledText.setForeground(fForegroundColor); styledText.setEditable(false); setFont(styledText); return styledText; } private void setFont(StyledText styledText) { IPreferenceStore store= getPreferenceStore(); if (store != null) { FontData data= null; if (store.contains(PREFERENCE_FONT) && !store.isDefault(PREFERENCE_FONT)) data= PreferenceConverter.getFontData(store, PREFERENCE_FONT); else data= PreferenceConverter.getDefaultFontData(store, PREFERENCE_FONT); if (data != null) { Font font= new Font(styledText.getDisplay(), data); styledText.setFont(font);
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
if (fFont != null) fFont.dispose(); fFont= font; } } } private Label createLabel(Composite parent, String text) { Label label = new Label(parent, SWT.NONE); if (text != null) label.setText(text); label.setBackground(fBackgroundColor); label.setForeground(fForegroundColor); return label; } private Label createTitleLabel(Composite parent, String text) { Label label = new Label(parent, SWT.NONE); if (text != null) label.setText(text); label.setBackground(fBackgroundColor); label.setForeground(fForegroundColor); label.setFont(JFaceResources.getHeaderFont()); fHeaderLabels.add(label); return label; } private Label createHeadingLabel(Composite parent, String text) { Label label = new Label(parent, SWT.NONE); if (text != null)
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
label.setText(text); label.setBackground(fBackgroundColor); label.setForeground(fForegroundColor); label.setFont(JFaceResources.getBannerFont()); fBannerLabels.add(label); return label; } private Button createButton(Composite parent, String text) { Button button = new Button(parent, SWT.FLAT); button.setBackground(fBackgroundColor); button.setForeground(fForegroundColor); if (text != null) button.setText(text); return button; } private void updateCodeView(StyledText styledText, IClassFile classFile) { String content= null; int flags= IClassFileReader.FIELD_INFOS | IClassFileReader.METHOD_INFOS; IClassFileReader classFileReader= ToolFactory.createDefaultClassFileReader(classFile, flags); if (classFileReader != null) { IClassFileDisassembler disassembler= ToolFactory.createDefaultClassFileDisassembler(); content= disassembler.disassemble(classFileReader, "\n"); } styledText.setText(content == null ? "" : content); } };
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
private StackLayout fStackLayout; private Composite fParent; private Composite fViewerComposite; private Control fSourceAttachmentForm; /** * Default constructor. */ public ClassFileEditor() { super(); setDocumentProvider(JavaPlugin.getDefault().getClassFileDocumentProvider()); setEditorContextMenuId("#ClassFileEditorContext"); setRulerContextMenuId("#ClassFileRulerContext"); setOutlinerContextMenuId("#ClassFileOutlinerContext"); } /* * @see AbstractTextEditor#createActions() */ protected void createActions() { super.createActions(); setAction(ITextEditorActionConstants.SAVE, null); setAction(ITextEditorActionConstants.REVERT_TO_SAVED, null); /* * 1GF82PL: ITPJUI:ALL - Need to be able to add bookmark to classfile
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
* * // replace default action with class file specific ones * * setAction(ITextEditorActionConstants.BOOKMARK, new AddClassFileMarkerAction("AddBookmark.", this, IMarker.BOOKMARK, true)); * setAction(ITextEditorActionConstants.ADD_TASK, new AddClassFileMarkerAction("AddTask.", this, IMarker.TASK, false)); * setAction(ITextEditorActionConstants.RULER_MANAGE_BOOKMARKS, new ClassFileMarkerRulerAction("ManageBookmarks.", getVerticalRuler(), this, IMarker.BOOKMARK, true)); * setAction(ITextEditorActionConstants.RULER_MANAGE_TASKS, new ClassFileMarkerRulerAction("ManageTasks.", getVerticalRuler(), this, IMarker.TASK, true)); */ setAction(ITextEditorActionConstants.BOOKMARK, null); setAction(ITextEditorActionConstants.ADD_TASK, null); } /* * @see JavaEditor#getElementAt(int) */ protected IJavaElement getElementAt(int offset) { if (getEditorInput() instanceof IClassFileEditorInput) { try { IClassFileEditorInput input= (IClassFileEditorInput) getEditorInput(); return input.getClassFile().getElementAt(offset); } catch (JavaModelException x) { } } return null; } /* * @see JavaEditor#getCorrespondingElement(IJavaElement) */ protected IJavaElement getCorrespondingElement(IJavaElement element) {
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
if (getEditorInput() instanceof IClassFileEditorInput) { IClassFileEditorInput input= (IClassFileEditorInput) getEditorInput(); IJavaElement parent= element.getAncestor(IJavaElement.CLASS_FILE); if (input.getClassFile().equals(parent)) return element; } return null; } /* * @see IEditorPart#saveState(IMemento) */ public void saveState(IMemento memento) { } /* * @see JavaEditor#setOutlinePageInput(JavaOutlinePage, IEditorInput) */ protected void setOutlinePageInput(JavaOutlinePage page, IEditorInput input) { if (page != null && input instanceof IClassFileEditorInput) { IClassFileEditorInput cfi= (IClassFileEditorInput) input; page.setInput(cfi.getClassFile()); } } /* * 1GEPKT5: ITPJUI:Linux - Source in editor for external classes is editable * Removed methods isSaveOnClosedNeeded and isDirty. * Added method isEditable. */
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
/* * @see org.eclipse.ui.texteditor.AbstractTextEditor#isEditable() */ public boolean isEditable() { return false; } /** * Translates the given editor input into an <code>ExternalClassFileEditorInput</code> * if it is a file editor input representing an external class file. * * @param input the editor input to be transformed if necessary * @return the transformed editor input */ protected IEditorInput transformEditorInput(IEditorInput input) { if (input instanceof IFileEditorInput) { IFile file= ((IFileEditorInput) input).getFile(); IClassFileEditorInput classFileInput= new ExternalClassFileEditorInput(file); if (classFileInput.getClassFile() != null) input= classFileInput; } return input; } /* * @see AbstractTextEditor#doSetInput(IEditorInput) */ protected void doSetInput(IEditorInput input) throws CoreException {
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
input= transformEditorInput(input); if (!(input instanceof IClassFileEditorInput)) throw new CoreException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_RESOURCE_TYPE, JavaEditorMessages.getString("ClassFileEditor.error.invalid_input_message"))); IDocumentProvider documentProvider= getDocumentProvider(); if (documentProvider instanceof ClassFileDocumentProvider) ((ClassFileDocumentProvider) documentProvider).removeInputChangeListener(this); super.doSetInput(input); documentProvider= getDocumentProvider(); if (documentProvider instanceof ClassFileDocumentProvider) ((ClassFileDocumentProvider) documentProvider).addInputChangeListener(this); verifyInput(getEditorInput()); } /* * @see IWorkbenchPart#createPartControl(Composite) */ public void createPartControl(Composite parent) { fParent= new Composite(parent, SWT.NONE); fStackLayout= new StackLayout(); fParent.setLayout(fStackLayout); fViewerComposite= new Composite(fParent, SWT.NONE); fViewerComposite.setLayout(new FillLayout()); super.createPartControl(fViewerComposite); fStackLayout.topControl= fViewerComposite; fParent.layout(); try { verifyInput(getEditorInput()); } catch (CoreException e) { String title= JavaEditorMessages.getString("ClassFileEditor.error.title"); String message= JavaEditorMessages.getString("ClassFileEditor.error.message");
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
ExceptionHandler.handle(e, fParent.getShell(), title, message); } } /** * Returns the package fragment root corresponding to the class file. */ private static IPackageFragmentRoot getPackageFragmentRoot(IClassFile file) { IJavaElement element= file.getParent(); while (element != null && element.getElementType() != IJavaElement.PACKAGE_FRAGMENT_ROOT) element= element.getParent(); return (IPackageFragmentRoot) element; } /** * Checks if the class file input has no source attached. If so, a source attachment form is shown. */ private void verifyInput(IEditorInput input) throws CoreException { if (fParent == null || input == null) return; IClassFileEditorInput classFileEditorInput= (IClassFileEditorInput) input; IClassFile file= classFileEditorInput.getClassFile(); if (file.getSourceRange() == null) { if (fSourceAttachmentForm != null) fSourceAttachmentForm.dispose(); SourceAttachmentForm form= new SourceAttachmentForm(file); fSourceAttachmentForm= form.createControl(fParent); fStackLayout.topControl= fSourceAttachmentForm; fParent.layout();
16,938
Bug 16938 DCR: Class File Editor should scroll more naturally
20020521 (F1) (This may not be a debug PR - I wasn't sure). - put a breakpoint in a java file, right before a System.out.println statement - debug to the breakpoint - step in to the println call (I happened to go in to StringBuffer first - all that matters is that you do not have the source for the class you just stepped into) - a Class File Editor opens - click on the scrollbar's down arrow Problem: the editor only scrolls one pixel at a time. It should scroll one line at a time when you click on the arrows. - click on the scrollbar's background to scroll a page at a time Problem: the editor only scrolls about a line at a time when it should be scrolling a page at a time. Grabbing the thumb and scrolling with that works well. So the workaround, if the user wants to scroll through the Class File editor, is to always use the thumb.
verified fixed
12af165
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:09:10Z
2002-05-22T17:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
} else { if (fSourceAttachmentForm != null) { fSourceAttachmentForm.dispose(); fSourceAttachmentForm= null; fStackLayout.topControl= fViewerComposite; fParent.layout(); } } } /* * @see ClassFileDocumentProvider.InputChangeListener#inputChanged(IClassFileEditorInput) */ public void inputChanged(final IClassFileEditorInput input) { if (input != null && input.equals(getEditorInput())) { ISourceViewer viewer= getSourceViewer(); if (viewer != null) { StyledText textWidget= viewer.getTextWidget(); if (textWidget != null && !textWidget.isDisposed()) { textWidget.getDisplay().asyncExec(new Runnable() { public void run() { setInput(input); } }); } } } } }
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.actions; import java.lang.reflect.InvocationTargetException; import java.util.List; import org.eclipse.core.runtime.CoreException; import org.eclipse.swt.widgets.Shell; import org.eclipse.jface.action.Action;
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.jdt.core.Flags; import org.eclipse.jdt.core.IMember; import org.eclipse.jdt.core.IMethod; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaUIMessages; import org.eclipse.jdt.internal.corext.codemanipulation.AddMethodStubOperation; import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings; import org.eclipse.jdt.internal.corext.codemanipulation.IRequestQuery; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabels; /** * Creates method stubs in a type. * The type has to be set before usage (init) * Always forces the type to open in an editor. The result is unsaved, * so the user can decide if the changes are acceptable. */ public class AddMethodStubAction extends Action {
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
private ISelection fSelection; private IType fParentType; public AddMethodStubAction() { super(JavaUIMessages.getString("AddMethodStubAction.label")); setDescription(JavaUIMessages.getString("AddMethodStubAction.description")); setToolTipText(JavaUIMessages.getString("AddMethodStubAction.tooltip")); WorkbenchHelp.setHelp(this, IJavaHelpContextIds.ADD_METHODSTUB_ACTION); } public boolean init(IType parentType, ISelection selection) { if (canActionBeAdded(parentType, selection)) { fParentType= parentType; fSelection= selection; if (parentType != null) { try { if (parentType.isInterface()) { setText(JavaUIMessages.getFormattedString("AddMethodStubAction.detailed.implement", parentType.getElementName())); } else { setText(JavaUIMessages.getFormattedString("AddMethodStubAction.detailed.override", parentType.getElementName())); } } catch (JavaModelException e) { JavaPlugin.log(e); } } else { setText(JavaUIMessages.getString("AddMethodStubAction.label")); } return true; }
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
fParentType= null; fSelection= null; return false; } public void run() { if (!canActionBeAdded(fParentType, fSelection)) { return; } Shell shell= JavaPlugin.getActiveWorkbenchShell(); try { IEditorPart editor= EditorUtility.openInEditor(fParentType); IType usedType= (IType)EditorUtility.getWorkingCopy(fParentType); if (usedType == null) { MessageDialog.openError(shell, JavaUIMessages.getString("AddMethodStubAction.error.title"), JavaUIMessages.getString("AddMethodStubAction.error.type_removed_in_editor")); return; } CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(); List list= ((IStructuredSelection)fSelection).toList(); IMethod[] methods= (IMethod[]) list.toArray(new IMethod[list.size()]); AddMethodStubOperation op= new AddMethodStubOperation(usedType, methods, settings, createOverrideQuery(), createReplaceQuery(), false); ProgressMonitorDialog dialog= new ProgressMonitorDialog(shell); dialog.run(false, true, new WorkbenchRunnableAdapter(op)); IMethod[] res= op.getCreatedMethods(); if (res != null && res.length > 0 && editor != null) { EditorUtility.revealInEditor(editor, res[0]); }
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
} catch (InvocationTargetException e) { MessageDialog.openError(shell, JavaUIMessages.getString("AddMethodStubAction.error.title"), e.getTargetException().getMessage()); JavaPlugin.log(e.getTargetException()); } catch (CoreException e) { ErrorDialog.openError(shell, JavaUIMessages.getString("AddMethodStubAction.error.title"), null, e.getStatus()); JavaPlugin.log(e.getStatus()); } catch (InterruptedException e) { } } private IRequestQuery createOverrideQuery() { return new IRequestQuery() { public int doQuery(IMember method) { String methodName= JavaElementLabels.getElementLabel(method, JavaElementLabels.M_PARAMETER_TYPES); String declTypeName= JavaElementLabels.getElementLabel(method.getDeclaringType(), 0); String formattedMessage; try { if (Flags.isFinal(method.getFlags())) { formattedMessage= JavaUIMessages.getFormattedString("AddMethodStubAction.OverridesFinalDialog.message", new String[] { methodName, declTypeName }); } else { formattedMessage= JavaUIMessages.getFormattedString("AddMethodStubAction.OverridesPrivateDialog.message", new String[] { methodName, declTypeName }); } } catch (JavaModelException e) { JavaPlugin.log(e.getStatus()); return IRequestQuery.CANCEL; } return showQueryDialog(formattedMessage); } };
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
} private IRequestQuery createReplaceQuery() { return new IRequestQuery() { public int doQuery(IMember method) { String methodName= JavaElementLabels.getElementLabel(method, JavaElementLabels.M_PARAMETER_TYPES); String formattedMessage= JavaUIMessages.getFormattedString("AddMethodStubAction.ReplaceExistingDialog.message", methodName); return showQueryDialog(formattedMessage); } }; } private int showQueryDialog(final String message) { int[] returnCodes= {IRequestQuery.YES, IRequestQuery.NO, IRequestQuery.YES_ALL, IRequestQuery.CANCEL}; final Shell shell= JavaPlugin.getActiveWorkbenchShell(); if (shell == null) { JavaPlugin.logErrorMessage("AddMethodStubAction.showQueryDialog: No active shell found"); return IRequestQuery.CANCEL; } final int[] result= { MessageDialog.CANCEL }; shell.getDisplay().syncExec(new Runnable() { public void run() { String title= JavaUIMessages.getString("AddMethodStubAction.QueryDialog.title"); String[] options= {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.CANCEL_LABEL}; MessageDialog dialog= new MessageDialog(shell, title, null, message, MessageDialog.QUESTION, options, 0); result[0]= dialog.open(); } }); int returnVal= result[0];
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddMethodStubAction.java
return returnVal < 0 ? IRequestQuery.CANCEL : returnCodes[returnVal]; } /** * Tests if the action can run with given arguments */ public static boolean canActionBeAdded(IType parentType, ISelection selection) { if (parentType == null || parentType.getCompilationUnit() == null || !JavaModelUtil.isEditable(parentType.getCompilationUnit()) || !(selection instanceof IStructuredSelection) || selection.isEmpty()) { return false; } Object[] elems= ((IStructuredSelection)selection).toArray(); int nSelected= elems.length; if (nSelected > 0) { for (int i= 0; i < nSelected; i++) { Object elem= elems[i]; if (!(elem instanceof IMethod)) { return false; } IMethod meth= (IMethod)elem; if (meth.getDeclaringType().equals(parentType)) { return false; } } return true; } return false; } }
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.packageview; import java.io.File; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; import java.util.ResourceBundle; import org.eclipse.swt.SWT; import org.eclipse.swt.dnd.DND; import org.eclipse.swt.dnd.DropTargetEvent; import org.eclipse.swt.dnd.FileTransfer;
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java
import org.eclipse.swt.dnd.Transfer; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Shell; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.viewers.AbstractTreeViewer; import org.eclipse.core.resources.IContainer; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.ui.dialogs.IOverwriteQuery; import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider; import org.eclipse.ui.wizards.datatransfer.ImportOperation; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.IPackageFragmentRoot; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.dnd.JdtViewerDropAdapter; import org.eclipse.jdt.internal.ui.dnd.TransferDropTargetListener; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.util.SWTUtil; /** * Adapter to handle file drop from other applications. */ class FileTransferDropAdapter extends JdtViewerDropAdapter implements IOverwriteQuery, TransferDropTargetListener {
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java
FileTransferDropAdapter(AbstractTreeViewer viewer) { super(viewer, DND.FEEDBACK_SCROLL | DND.FEEDBACK_EXPAND); } public String queryOverwrite(String file) { String[] returnCodes= {YES, NO, ALL, CANCEL}; int returnVal= openDialog(getViewer().getControl(), file); return returnVal < 0 ? CANCEL : returnCodes[returnVal]; } private int openDialog(final Control control, final String file) { final int[] result= { Dialog.CANCEL }; control.getDisplay().syncExec(new Runnable() { public void run() { String title= PackagesMessages.getString("DropAdapter.question"); String msg= PackagesMessages.getFormattedString("DropAdapter.alreadyExists", file); String[] options= {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.CANCEL_LABEL}; MessageDialog dialog= new MessageDialog(control.getShell(), title, null, msg, MessageDialog.QUESTION, options, 0); result[0]= dialog.open(); }
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java
}); return result[0]; } public Transfer getTransfer() { return FileTransfer.getInstance(); } public void validateDrop(Object target, DropTargetEvent event, int operation) { event.detail= DND.DROP_NONE; boolean isPackageFragment= target instanceof IPackageFragment; boolean isJavaProject= target instanceof IJavaProject; boolean isPackageFragmentRoot= target instanceof IPackageFragmentRoot; boolean isContainer= target instanceof IContainer; if (!(isPackageFragment || isJavaProject || isPackageFragmentRoot || isContainer)) return; if (isContainer) { IContainer container= (IContainer)target; if (!container.isReadOnly()) event.detail= DND.DROP_COPY; } else { IJavaElement element= (IJavaElement)target; if (!element.isReadOnly()) event.detail= DND.DROP_COPY;
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java
} return; } public void drop(Object dropTarget, DropTargetEvent event) { int operation= event.detail; event.detail= DND.DROP_NONE; Object data= event.data; if (data == null || operation != DND.DROP_COPY) return; IContainer target= null; if (dropTarget instanceof IContainer) { target= (IContainer)dropTarget; } else { try { target= (IContainer)((IJavaElement)dropTarget).getCorrespondingResource(); } catch (JavaModelException e) { } } if (target == null) return; List files= checkFiles(SWTUtil.getShell(event.widget),(String[])data, target.getLocation()); if (files.size() > 0) { Shell shell= JavaPlugin.getActiveWorkbenchShell(); ImportOperation op= new ImportOperation(target.getFullPath(), FileSystemStructureProvider.INSTANCE, this, files); op.setCreateContainerStructure(false);
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java
ProgressMonitorDialog dialog= new ProgressMonitorDialog(shell); try { dialog.run(true, true, op); } catch (InvocationTargetException e) { String title= PackagesMessages.getString("DropAdapter.errorTitle"); String message= PackagesMessages.getString("DropAdapter.errorMessage"); ExceptionHandler.handle(e, title, message); return; } catch (InterruptedException e) { return; } IStatus status= op.getStatus(); if (! status.isOK()) { String title= PackagesMessages.getString("DropAdapter.errorTitle"); String message= PackagesMessages.getString("DropAdapter.errorMessage"); ErrorDialog.openError(shell, title, message, status, IStatus.ERROR | IStatus.WARNING); return; } event.data= files.toArray(new String[files.size()]); event.detail= DND.DROP_COPY; return;
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java
} else { event.data= null; return; } } private List checkFiles(Shell shell, String[] files, IPath target) { List result= new ArrayList(10); int lengthCompare= target.segmentCount() + 1; for (int i= 0; i < files.length; i++) { String file= files[i]; IPath path= new Path(file); String error= null; if (path.equals(target)) { error= PackagesMessages.getFormattedString("DropAdapter.errorSame", target.lastSegment()); } else if (path.isPrefixOf(target)) { error= PackagesMessages.getFormattedString("DropAdapter.errorSubfolder", path.lastSegment()); } if (error != null) { MessageDialog.openError(shell, PackagesMessages.getString("DropAdapter.errorTitle"), error); return new ArrayList(0); } if (target.isPrefixOf(path) && lengthCompare == path.segmentCount()) continue; result.add(new File(file)); } return result; } }
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
/******************************************************************************* * Copyright (c) 2000, 2002 International Business Machines Corp. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v0.5 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v05.html * * Contributors: * IBM Corporation - initial API and implementation ******************************************************************************/ package org.eclipse.jdt.ui.actions; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus;
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Shell; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.Viewer; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbenchSite; import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog; import org.eclipse.ui.dialogs.ISelectionStatusValidator; import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.jdt.core.Flags; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IField; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IMember; import org.eclipse.jdt.core.IMethod; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.Signature; import org.eclipse.jdt.ui.JavaElementImageDescriptor; import org.eclipse.jdt.ui.JavaElementLabelProvider; import org.eclipse.jdt.ui.JavaElementSorter; import org.eclipse.jdt.internal.corext.codemanipulation.AddGetterSetterOperation; import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
import org.eclipse.jdt.internal.corext.codemanipulation.GetterSetterUtil; import org.eclipse.jdt.internal.corext.codemanipulation.IRequestQuery; import org.eclipse.jdt.internal.corext.codemanipulation.NameProposer; import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.actions.ActionMessages; import org.eclipse.jdt.internal.ui.actions.SelectionConverter; import org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor; import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility; import org.eclipse.jdt.internal.ui.preferences.CodeGenerationPreferencePage; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabels; /** * Create Getter and Setter for selected fields. * Will open the parent compilation unit in the editor. * The result is unsaved, so the user can decide if the * changes are acceptable. * * <p> * This class may be instantiated; it is not intended to be subclassed. * </p> * * @since 2.0 */ public class AddGetterSetterAction extends SelectionDispatchAction {
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
private CompilationUnitEditor fEditor; private static final String dialogTitle= ActionMessages.getString("AddGetterSetterAction.error.title"); /** * Creates a new <code>AddGetterSetterAction</code>. * * @param site the site providing context information for this action */ public AddGetterSetterAction(IWorkbenchSite site) { super(site); setText(ActionMessages.getString("AddGetterSetterAction.label")); setDescription(ActionMessages.getString("AddGetterSetterAction.description")); setToolTipText(ActionMessages.getString("AddGetterSetterAction.tooltip")); WorkbenchHelp.setHelp(this, IJavaHelpContextIds.GETTERSETTER_ACTION); } /** * Creates a new <code>AddGetterSetterAction</code>. * <p> * Note: This constructor is for internal use only. Clients should not call this constructor. * </p> */
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
public AddGetterSetterAction(CompilationUnitEditor editor) { this(editor.getEditorSite()); fEditor= editor; setEnabled(checkEnabledEditor()); } /* (non-Javadoc) * Method declared on SelectionDispatchAction */ protected void selectionChanged(IStructuredSelection selection) { try { setEnabled(canEnable(selection)); } catch (JavaModelException e) { JavaPlugin.log(e); setEnabled(false); } } /* (non-Javadoc) * Method declared on SelectionDispatchAction */ protected void run(IStructuredSelection selection) { try { IField[] selectedFields= getSelectedFields(selection); if (canEnableOn(selectedFields)){ run(selectedFields[0].getDeclaringType(), selectedFields); return; }
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
Object firstElement= selection.getFirstElement(); if (firstElement instanceof IType) run((IType)firstElement, new IField[0]); else if (firstElement instanceof ICompilationUnit) run(JavaElementUtil.getMainType((ICompilationUnit)firstElement), new IField[0]); } catch (CoreException e) { JavaPlugin.log(e.getStatus()); showError(ActionMessages.getString("AddGetterSetterAction.error.actionfailed")); } } private boolean canEnable(IStructuredSelection selection) throws JavaModelException{ if (canEnableOn(getSelectedFields(selection))) return true; if ((selection.size() == 1) && (selection.getFirstElement() instanceof IType)) return canEnableOn((IType)selection.getFirstElement()); if ((selection.size() == 1) && (selection.getFirstElement() instanceof ICompilationUnit)) return canEnableOn(JavaElementUtil.getMainType((ICompilationUnit)selection.getFirstElement())); return false; } private static boolean canEnableOn(IType type) throws JavaModelException { if (type == null) return false; if (type.getFields().length == 0) return false; if (type.getCompilationUnit() == null) return false; if (JavaModelUtil.isEditable(type.getCompilationUnit()))
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
return true; return false; } private static boolean canEnableOn(IField[] fields) throws JavaModelException { return fields != null && fields.length > 0 && JavaModelUtil.isEditable(fields[0].getCompilationUnit()); } private void run(IType type, IField[] preselected) throws CoreException{ ILabelProvider lp= new AddGetterSetterLabelProvider(createNameProposer()); Map entries= createGetterSetterMapping(type); if (entries.isEmpty()){ MessageDialog.openInformation(getShell(), dialogTitle, "The type contains no fields or all fields have getters/setters already."); return; } ITreeContentProvider cp= new AddGetterSetterContentProvider(entries); CheckedTreeSelectionDialog dialog= new CheckedTreeSelectionDialog(getShell(), lp, cp); dialog.setSorter(new JavaElementSorter()); dialog.setTitle(dialogTitle); String message= ActionMessages.getFormattedString("AddGetterSetterAction.dialog.title", JavaElementUtil.createSignature(type)); dialog.setMessage(message); dialog.setValidator(createValidator()); dialog.setContainerMode(true); dialog.setSize(60, 18); dialog.setInput(type); dialog.setExpandedElements(type.getFields()); dialog.setInitialSelections(preselected); dialog.open(); Object[] result= dialog.getResult(); if (result == null)
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
return; IField[] getterFields= getGetterFields(result); IField[] setterFields= getSetterFields(result); generate(getterFields, setterFields); } private static ISelectionStatusValidator createValidator() { return new ISelectionStatusValidator(){ public IStatus validate(Object[] selection) { int count= countSelectedMethods(selection); if (count == 0) return new StatusInfo(IStatus.ERROR, ""); if (count == 1) return new StatusInfo(IStatus.INFO, ActionMessages.getString("AddGetterSetterAction.one_selected")); String message= ActionMessages.getFormattedString("AddGetterSetterAction.methods_selected", String.valueOf(count)); return new StatusInfo(IStatus.INFO, message); } }; } private static int countSelectedMethods(Object[] selection){ int count= 0; for (int i = 0; i < selection.length; i++) { if (selection[i] instanceof GetterSetterEntry) count++; } return count; } private static IField[] getGetterFields(Object[] result){
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
Collection list= new ArrayList(0); for (int i = 0; i < result.length; i++) { Object each= result[i]; if ((each instanceof GetterSetterEntry)){ GetterSetterEntry entry= (GetterSetterEntry)each; if (entry.isGetterEntry) list.add(entry.field); } } return (IField[]) list.toArray(new IField[list.size()]); } private static IField[] getSetterFields(Object[] result){ Collection list= new ArrayList(0); for (int i = 0; i < result.length; i++) { Object each= result[i]; if ((each instanceof GetterSetterEntry)){ GetterSetterEntry entry= (GetterSetterEntry)each; if (! entry.isGetterEntry) list.add(entry.field); } } return (IField[]) list.toArray(new IField[list.size()]); } private static NameProposer createNameProposer(){ return new NameProposer(getGetterSetterPrefixes(), getGetterSetterSuffixes()); } private static String[] getGetterSetterPrefixes(){
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
return CodeGenerationPreferencePage.getGetterStetterPrefixes(); } private static String[] getGetterSetterSuffixes(){ return CodeGenerationPreferencePage.getGetterStetterSuffixes(); } private void generate(IField[] getterFields, IField[] setterFields) throws CoreException{ if (getterFields.length == 0 && setterFields.length == 0) return; ICompilationUnit cu= null; if (getterFields.length != 0) cu= getterFields[0].getCompilationUnit(); else cu= setterFields[0].getCompilationUnit(); IEditorPart editor= EditorUtility.openInEditor(cu); IField[] workingCopyGetterFields= getWorkingCopyFields(getterFields); IField[] workingCopySetterFields= getWorkingCopyFields(setterFields); if (workingCopyGetterFields != null && workingCopySetterFields != null) run(workingCopyGetterFields, workingCopySetterFields, editor); } private IField[] getWorkingCopyFields(IField[] fields) throws CoreException{ if (fields.length == 0) return new IField[0]; ICompilationUnit cu= fields[0].getCompilationUnit();
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
ICompilationUnit workingCopyCU; IField[] workingCopyFields; if (cu.isWorkingCopy()) { workingCopyCU= cu; workingCopyFields= fields; } else { workingCopyCU= EditorUtility.getWorkingCopy(cu); if (workingCopyCU == null) { showError(ActionMessages.getString("AddGetterSetterAction.error.actionfailed")); return null; } workingCopyFields= new IField[fields.length]; for (int i= 0; i < fields.length; i++) { IField field= fields[i]; IField workingCopyField= (IField) JavaModelUtil.findMemberInCompilationUnit(workingCopyCU, field); if (workingCopyField == null) { showError(ActionMessages.getFormattedString("AddGetterSetterAction.error.fieldNotExisting", field.getElementName())); return null; } workingCopyFields[i]= workingCopyField; } } return workingCopyFields; } /* (non-Javadoc) * Method declared on SelectionDispatchAction */ protected void selectionChanged(ITextSelection selection) {
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
} /* (non-Javadoc) * Method declared on SelectionDispatchAction */ protected void run(ITextSelection selection) { try { IJavaElement[] elements= SelectionConverter.codeResolve(fEditor); if (elements.length == 1 && (elements[0] instanceof IField)) { IField field= (IField)elements[0]; if (! checkCu(field)) return; run(field.getDeclaringType(), new IField[] {field}); return; } IJavaElement element= SelectionConverter.getElementAtOffset(fEditor); if (element != null){ IType type= (IType)element.getAncestor(IJavaElement.TYPE); if (type != null){ if (! checkCu(type)) return; if (type.getFields().length > 0){ run(type, new IField[0]); return; } } } MessageDialog.openInformation(getShell(), dialogTitle, ActionMessages.getString("AddGetterSetterAction.not_applicable")); } catch (CoreException e) {
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
JavaPlugin.log(e.getStatus()); showError(ActionMessages.getString("AddGetterSetterAction.error.actionfailed")); } } void editorStateChanged() { setEnabled(checkEnabledEditor()); } private boolean checkEnabledEditor() { return fEditor != null && !fEditor.isEditorInputReadOnly() && SelectionConverter.canOperateOn(fEditor); } private boolean checkCu(IMember member) throws JavaModelException{ if (JavaModelUtil.isEditable(member.getCompilationUnit())) return true; MessageDialog.openInformation(getShell(), dialogTitle, ActionMessages.getFormattedString("AddGetterSetterAction.read_only", member.getElementName())); return false; } private void run(IField[] getterFields, IField[] setterFields, IEditorPart editor) { try{ AddGetterSetterOperation op= createAddGetterSetterOperation(getterFields, setterFields); new ProgressMonitorDialog(getShell()).run(false, true, new WorkbenchRunnableAdapter(op)); IMethod[] createdMethods= op.getCreatedAccessors(); if (createdMethods.length > 0) {
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
EditorUtility.revealInEditor(editor, createdMethods[0]); } } catch (InvocationTargetException e) { JavaPlugin.log(e); showError(ActionMessages.getString("AddGetterSetterAction.error.actionfailed")); } catch (InterruptedException e) { } } private AddGetterSetterOperation createAddGetterSetterOperation(IField[] getterFields, IField[] setterFields) { IRequestQuery skipSetterForFinalQuery= skipSetterForFinalQuery(); IRequestQuery skipReplaceQuery= skipReplaceQuery(); CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(); return new AddGetterSetterOperation(getterFields, setterFields, createNameProposer(), settings, skipSetterForFinalQuery, skipReplaceQuery); } private IRequestQuery skipSetterForFinalQuery() { return new IRequestQuery() { public int doQuery(IMember field) { int[] returnCodes= {IRequestQuery.YES, IRequestQuery.NO, IRequestQuery.YES_ALL, IRequestQuery.CANCEL}; String[] options= {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.CANCEL_LABEL}; String fieldName= JavaElementLabels.getElementLabel(field, 0); String formattedMessage= ActionMessages.getFormattedString("AddGetterSetterAction.SkipSetterForFinalDialog.message", fieldName); return showQueryDialog(formattedMessage, options, returnCodes); } }; } private IRequestQuery skipReplaceQuery() { return new IRequestQuery() {
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
public int doQuery(IMember method) { int[] returnCodes= {IRequestQuery.YES, IRequestQuery.NO, IRequestQuery.YES_ALL, IRequestQuery.CANCEL}; String skipLabel= ActionMessages.getString("AddGetterSetterAction.SkipExistingDialog.skip.label"); String replaceLabel= ActionMessages.getString("AddGetterSetterAction.SkipExistingDialog.replace.label"); String skipAllLabel= ActionMessages.getString("AddGetterSetterAction.SkipExistingDialog.skipAll.label"); String[] options= { skipLabel, replaceLabel, skipAllLabel, IDialogConstants.CANCEL_LABEL}; String methodName= JavaElementLabels.getElementLabel(method, JavaElementLabels.M_PARAMETER_TYPES); String formattedMessage= ActionMessages.getFormattedString("AddGetterSetterAction.SkipExistingDialog.message", methodName); return showQueryDialog(formattedMessage, options, returnCodes); } }; } private int showQueryDialog(final String message, final String[] buttonLabels, int[] returnCodes) { final Shell shell= getShell(); if (shell == null) { JavaPlugin.logErrorMessage("AddGetterSetterAction.showQueryDialog: No active shell found"); return IRequestQuery.CANCEL; } final int[] result= { MessageDialog.CANCEL }; shell.getDisplay().syncExec(new Runnable() { public void run() { String title= ActionMessages.getString("AddGetterSetterAction.QueryDialog.title"); MessageDialog dialog= new MessageDialog(shell, title, null, message, MessageDialog.QUESTION, buttonLabels, 0); result[0]= dialog.open(); } }); int returnVal= result[0]; return returnVal < 0 ? IRequestQuery.CANCEL : returnCodes[returnVal];
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
} private void showError(String message) { MessageDialog.openError(getShell(), dialogTitle, message); } /* * Returns fields in the selection or <code>null</code> if the selection is * empty or not valid. */ private IField[] getSelectedFields(IStructuredSelection selection) { List elements= selection.toList(); int nElements= elements.size(); if (nElements > 0) { IField[] res= new IField[nElements]; ICompilationUnit cu= null; for (int i= 0; i < nElements; i++) { Object curr= elements.get(i); if (curr instanceof IField) { IField fld= (IField)curr; if (i == 0) { cu= fld.getCompilationUnit(); if (cu == null) { return null; } } else if (!cu.equals(fld.getCompilationUnit())) { return null; }
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
try { if (fld.getDeclaringType().isInterface()) { return null; } } catch (JavaModelException e) { JavaPlugin.log(e); return null; } res[i]= fld; } else { return null; } } return res; } return null; } private static class GetterSetterEntry { public final IField field; public final boolean isGetterEntry; GetterSetterEntry(IField field, boolean isGetterEntry){ this.field= field; this.isGetterEntry= isGetterEntry; } } private static class AddGetterSetterLabelProvider extends JavaElementLabelProvider {
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
private final NameProposer fNameProposer; AddGetterSetterLabelProvider(NameProposer nameProposer) { fNameProposer= nameProposer; } /* * @see ILabelProvider#getText(Object) */ public String getText(Object element) { if (element instanceof GetterSetterEntry) { GetterSetterEntry entry= (GetterSetterEntry) element; try { if (entry.isGetterEntry) { return fNameProposer.proposeGetterName(entry.field) + "()"; } else { return fNameProposer.proposeSetterName(entry.field) + '(' + Signature.getSimpleName(Signature.toString(entry.field.getTypeSignature())) + ')'; } } catch (JavaModelException e) { return ""; } } return super.getText(element); } /* * @see ILabelProvider#getImage(Object) */ public Image getImage(Object element) {
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
if (element instanceof GetterSetterEntry) { int flags= 0; try { flags= ((GetterSetterEntry) element).field.getFlags(); } catch (JavaModelException e) { JavaPlugin.log(e); } ImageDescriptor desc= JavaElementImageProvider.getFieldImageDescriptor(false, Flags.AccPublic); int adornmentFlags= Flags.isStatic(flags) ? JavaElementImageDescriptor.STATIC : 0; desc= new JavaElementImageDescriptor(desc, adornmentFlags, JavaElementImageProvider.BIG_SIZE); return JavaPlugin.getImageDescriptorRegistry().get(desc); } return super.getImage(element); } } /** * @return map IField -> GetterSetterEntry[] */ private static Map createGetterSetterMapping(IType type) throws JavaModelException{ IField[] fields= type.getFields(); Map result= new HashMap(); String[] prefixes= AddGetterSetterAction.getGetterSetterPrefixes(); String[] suffixes= AddGetterSetterAction.getGetterSetterSuffixes(); for (int i= 0; i < fields.length; i++) { List l= new ArrayList(2); if (GetterSetterUtil.getGetter(fields[i], prefixes, suffixes) == null) l.add(new GetterSetterEntry(fields[i], true));
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
if (GetterSetterUtil.getSetter(fields[i], prefixes, suffixes) == null) l.add(new GetterSetterEntry(fields[i], false)); if (! l.isEmpty()) result.put(fields[i], (GetterSetterEntry[]) l.toArray(new GetterSetterEntry[l.size()])); } return result; } private static class AddGetterSetterContentProvider implements ITreeContentProvider{ private static final Object[] EMPTY= new Object[0]; private Map fGetterSetterEntries; public AddGetterSetterContentProvider(Map entries) throws JavaModelException { fGetterSetterEntries= entries; } /* * @see ITreeContentProvider#getChildren(Object) */ public Object[] getChildren(Object parentElement) { if (parentElement instanceof IField) return (Object[])fGetterSetterEntries.get(parentElement); return EMPTY; } /* * @see ITreeContentProvider#getParent(Object) */ public Object getParent(Object element) { if (element instanceof IMember) return ((IMember)element).getDeclaringType(); if (element instanceof GetterSetterEntry)
16,464
Bug 16464 Yes To All should come before No
Build 20020508 I just changed a couple of places in UI where we had a Yes/No/Yes To All/Cancel prompt. They now use Yes/Yes To All/No/Cancel. Should fix up occurrences in JDT as well. Suggest searching for refs to IDialogConstants.YES_TO_ALL_LABEL.
verified fixed
8eaf356
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:26Z
2002-05-20T18:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java
return ((GetterSetterEntry)element).field; return null; } /* * @see ITreeContentProvider#hasChildren(Object) */ public boolean hasChildren(Object element) { return getChildren(element).length > 0; } /* * @see IStructuredContentProvider#getElements(Object) */ public Object[] getElements(Object inputElement) { return fGetterSetterEntries.keySet().toArray(); } /* * @see IContentProvider#dispose() */ public void dispose() { fGetterSetterEntries.clear(); fGetterSetterEntries= null; } /* * @see IContentProvider#inputChanged(Viewer, Object, Object) */ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } } }
17,566
Bug 17566 Browsing Java src not on class path
When browsing Java src which is not on the classpath it is annoying to have millions of Quickfix light bulbs and error indicators. I suggest to disable this feature and have a special icon in the editor tab to indicate that the source file is not on the classpath and therefore behaves differently in certain operations (search, quickfix, etc.)
resolved wontfix
27cae91
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:35Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
package org.eclipse.jdt.internal.ui.javaeditor; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ import java.io.ByteArrayInputStream; import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; import java.util.List; import java.util.Map; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Status; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Rectangle;
17,566
Bug 17566 Browsing Java src not on class path
When browsing Java src which is not on the classpath it is annoying to have millions of Quickfix light bulbs and error indicators. I suggest to disable this feature and have a special icon in the editor tab to indicate that the source file is not on the classpath and therefore behaves differently in certain operations (search, quickfix, etc.)
resolved wontfix
27cae91
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:35Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Display; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.DefaultLineTracker; import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IDocumentPartitioner; import org.eclipse.jface.text.ILineTracker; import org.eclipse.jface.text.Position; import org.eclipse.jface.text.source.Annotation; import org.eclipse.jface.text.source.AnnotationModelEvent; import org.eclipse.jface.text.source.IAnnotationModel; import org.eclipse.jface.text.source.IAnnotationModelListener; import org.eclipse.jface.text.source.IAnnotationModelListenerExtension; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.ListenerList; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.editors.text.FileDocumentProvider; import org.eclipse.ui.part.FileEditorInput; import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel; import org.eclipse.ui.texteditor.MarkerAnnotation; import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel; import org.eclipse.jdt.core.IBuffer; import org.eclipse.jdt.core.IBufferFactory; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IJavaModelStatusConstants; import org.eclipse.jdt.core.IOpenable;
17,566
Bug 17566 Browsing Java src not on class path
When browsing Java src which is not on the classpath it is annoying to have millions of Quickfix light bulbs and error indicators. I suggest to disable this feature and have a special icon in the editor tab to indicate that the source file is not on the classpath and therefore behaves differently in certain operations (search, quickfix, etc.)
resolved wontfix
27cae91
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:35Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
import org.eclipse.jdt.core.IProblemRequestor; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.compiler.IProblem; import org.eclipse.jdt.ui.IWorkingCopyManager; import org.eclipse.jdt.ui.JavaUI; import org.eclipse.jdt.ui.text.JavaTextTools; import org.eclipse.jdt.internal.core.JavaModelStatus; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.JavaStatusConstants; import org.eclipse.jdt.internal.ui.JavaUIMessages; import org.eclipse.jdt.internal.ui.preferences.JavaEditorPreferencePage; import org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor; import org.eclipse.jdt.internal.ui.text.java.IProblemRequestorExtension; public class CompilationUnitDocumentProvider extends FileDocumentProvider implements IWorkingCopyManager { /** * Here for visibility issues only. */ protected class _FileSynchronizer extends FileSynchronizer { public _FileSynchronizer(IFileEditorInput fileEditorInput) { super(fileEditorInput); } }; /** * Bundle of all required informations to allow working copy management. */ protected class CompilationUnitInfo extends FileInfo {
17,566
Bug 17566 Browsing Java src not on class path
When browsing Java src which is not on the classpath it is annoying to have millions of Quickfix light bulbs and error indicators. I suggest to disable this feature and have a special icon in the editor tab to indicate that the source file is not on the classpath and therefore behaves differently in certain operations (search, quickfix, etc.)
resolved wontfix
27cae91
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:35Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
ICompilationUnit fCopy; CompilationUnitInfo(IDocument document, IAnnotationModel model, _FileSynchronizer fileSynchronizer, ICompilationUnit copy) { super(document, model, fileSynchronizer); fCopy= copy; } void setModificationStamp(long timeStamp) { fModificationStamp= timeStamp; } }; /** * Annotation representating an <code>IProblem</code>. */ static protected class ProblemAnnotation extends Annotation implements IProblemAnnotation { private List fOverlaids; private IProblem fProblem; private Image fImage; private static Image fgImage;
17,566
Bug 17566 Browsing Java src not on class path
When browsing Java src which is not on the classpath it is annoying to have millions of Quickfix light bulbs and error indicators. I suggest to disable this feature and have a special icon in the editor tab to indicate that the source file is not on the classpath and therefore behaves differently in certain operations (search, quickfix, etc.)
resolved wontfix
27cae91
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:35Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
public ProblemAnnotation(IProblem problem) { fProblem= problem; setLayer(MarkerAnnotation.PROBLEM_LAYER + 1); if (fgImage == null) fgImage= JavaPluginImages.get(JavaPluginImages.IMG_OBJS_FIXABLE_PROBLEM); if (JavaEditorPreferencePage.showTempProblems() && JavaCorrectionProcessor.hasCorrections(fProblem.getID())) fImage= fgImage; } /* * @see Annotation#paint */ public void paint(GC gc, Canvas canvas, Rectangle r) { if (fImage != null) drawImage(fImage, gc, canvas, r, SWT.CENTER, SWT.CENTER); } /* * @see IProblemAnnotation#getImage(Display) */ public Image getImage(Display display) { return fImage; } /* * @see IProblemAnnotation#getMessage() */ public String getMessage() {
17,566
Bug 17566 Browsing Java src not on class path
When browsing Java src which is not on the classpath it is annoying to have millions of Quickfix light bulbs and error indicators. I suggest to disable this feature and have a special icon in the editor tab to indicate that the source file is not on the classpath and therefore behaves differently in certain operations (search, quickfix, etc.)
resolved wontfix
27cae91
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:35Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
return fProblem.getMessage(); } /* * @see IProblemAnnotation#isTemporaryProblem() */ public boolean isTemporaryProblem() { return true; } /* * @see IProblemAnnotation#isWarning() */ public boolean isWarning() { return fProblem.isWarning(); } /* * @see IProblemAnnotation#isError() */ public boolean isError() { return fProblem.isError(); } /* * @see IProblemAnnotation#getArguments() */ public String[] getArguments() { return fProblem.getArguments(); } /* * @see IProblemAnnotation#getId() */
17,566
Bug 17566 Browsing Java src not on class path
When browsing Java src which is not on the classpath it is annoying to have millions of Quickfix light bulbs and error indicators. I suggest to disable this feature and have a special icon in the editor tab to indicate that the source file is not on the classpath and therefore behaves differently in certain operations (search, quickfix, etc.)
resolved wontfix
27cae91
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:35Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
public int getId() { return fProblem.getID(); } /* * @see IProblemAnnotation#isProblem() */ public boolean isProblem() { return true; } /* * @see IProblemAnnotation#isRelevant() */ public boolean isRelevant() { return true; } /* * @see IProblemAnnotation#hasOverlay() */ public boolean hasOverlay() { return false; } /* * @see IProblemAnnotation#addOverlaid(IProblemAnnotation) */ public void addOverlaid(IProblemAnnotation annotation) { if (fOverlaids == null) fOverlaids= new ArrayList(1);
17,566
Bug 17566 Browsing Java src not on class path
When browsing Java src which is not on the classpath it is annoying to have millions of Quickfix light bulbs and error indicators. I suggest to disable this feature and have a special icon in the editor tab to indicate that the source file is not on the classpath and therefore behaves differently in certain operations (search, quickfix, etc.)
resolved wontfix
27cae91
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:35Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
fOverlaids.add(annotation); } /* * @see IProblemAnnotation#removeOverlaid(IProblemAnnotation) */ public void removeOverlaid(IProblemAnnotation annotation) { if (fOverlaids != null) { fOverlaids.remove(annotation); if (fOverlaids.size() == 0) fOverlaids= null; } } /* * @see IProblemAnnotation#getOverlaidIterator() */ public Iterator getOverlaidIterator() { if (fOverlaids != null) return fOverlaids.iterator(); return null; } }; /** * Internal structure for mapping positions to some value. * The reason for this specific structure is that positions can * change over time. Thus a lookup is based on value and not * on hash value. */ protected static class ReverseMap {
17,566
Bug 17566 Browsing Java src not on class path
When browsing Java src which is not on the classpath it is annoying to have millions of Quickfix light bulbs and error indicators. I suggest to disable this feature and have a special icon in the editor tab to indicate that the source file is not on the classpath and therefore behaves differently in certain operations (search, quickfix, etc.)
resolved wontfix
27cae91
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:35Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
static class Entry { Position fPosition; Object fValue; }; private List fList= new ArrayList(2); private int fAnchor= 0; public ReverseMap() { } public Object get(Position position) { Entry entry; int length= fList.size(); for (int i= fAnchor; i < length; i++) { entry= (Entry) fList.get(i); if (entry.fPosition.equals(position)) { fAnchor= i; return entry.fValue; } } for (int i= 0; i < fAnchor; i++) { entry= (Entry) fList.get(i);
17,566
Bug 17566 Browsing Java src not on class path
When browsing Java src which is not on the classpath it is annoying to have millions of Quickfix light bulbs and error indicators. I suggest to disable this feature and have a special icon in the editor tab to indicate that the source file is not on the classpath and therefore behaves differently in certain operations (search, quickfix, etc.)
resolved wontfix
27cae91
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:35Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
if (entry.fPosition.equals(position)) { fAnchor= i; return entry.fValue; } } return null; } private int getIndex(Position position) { Entry entry; int length= fList.size(); for (int i= 0; i < length; i++) { entry= (Entry) fList.get(i); if (entry.fPosition.equals(position)) return i; } return -1; } public void put(Position position, Object value) { int index= getIndex(position); if (index == -1) { Entry entry= new Entry(); entry.fPosition= position; entry.fValue= value; fList.add(entry); } else { Entry entry= (Entry) fList.get(index); entry.fValue= value;
17,566
Bug 17566 Browsing Java src not on class path
When browsing Java src which is not on the classpath it is annoying to have millions of Quickfix light bulbs and error indicators. I suggest to disable this feature and have a special icon in the editor tab to indicate that the source file is not on the classpath and therefore behaves differently in certain operations (search, quickfix, etc.)
resolved wontfix
27cae91
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:35Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
} } public void remove(Position position) { int index= getIndex(position); if (index > -1) fList.remove(index); } public void clear() { fList.clear(); } }; /** * Annotation model dealing with java marker annotations and temporary problems. * Also acts as problem requestor for its compilation unit. Initialiy inactive. Must explicitly be * activated. */ protected class CompilationUnitAnnotationModel extends ResourceMarkerAnnotationModel implements IProblemRequestor, IProblemRequestorExtension { private List fCollectedProblems; private List fGeneratedAnnotations; private IProgressMonitor fProgressMonitor; private boolean fIsActive= false; private ReverseMap fReverseMap= new ReverseMap(); private List fPreviouslyShadowed= null; private List fCurrentlyShadowed= new ArrayList();
17,566
Bug 17566 Browsing Java src not on class path
When browsing Java src which is not on the classpath it is annoying to have millions of Quickfix light bulbs and error indicators. I suggest to disable this feature and have a special icon in the editor tab to indicate that the source file is not on the classpath and therefore behaves differently in certain operations (search, quickfix, etc.)
resolved wontfix
27cae91
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:35Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
public CompilationUnitAnnotationModel(IResource resource) { super(resource); } protected MarkerAnnotation createMarkerAnnotation(IMarker marker) { return new JavaMarkerAnnotation(marker); } protected Position createPositionFromProblem(IProblem problem) { int start= problem.getSourceStart(); if (start < 0) return null; int length= problem.getSourceEnd() - problem.getSourceStart() + 1; if (length < 0) return null; return new Position(start, length); } /* * @see IProblemRequestor#beginReporting() */ public void beginReporting() { } /* * @see IProblemRequestor#acceptProblem(IProblem) */
17,566
Bug 17566 Browsing Java src not on class path
When browsing Java src which is not on the classpath it is annoying to have millions of Quickfix light bulbs and error indicators. I suggest to disable this feature and have a special icon in the editor tab to indicate that the source file is not on the classpath and therefore behaves differently in certain operations (search, quickfix, etc.)
resolved wontfix
27cae91
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:35Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
public void acceptProblem(IProblem problem) { if (isActive()) fCollectedProblems.add(problem); } /* * @see IProblemRequestor#endReporting() */ public void endReporting() { if (!isActive()) return; if (fProgressMonitor != null && fProgressMonitor.isCanceled()) return; boolean isCanceled= false; boolean temporaryProblemsChanged= false; fPreviouslyShadowed= fCurrentlyShadowed; fCurrentlyShadowed= new ArrayList(); synchronized (fAnnotations) { if (fGeneratedAnnotations.size() > 0) { temporaryProblemsChanged= true; removeAnnotations(fGeneratedAnnotations, false, true); fGeneratedAnnotations.clear(); } if (fCollectedProblems.size() > 0) {
17,566
Bug 17566 Browsing Java src not on class path
When browsing Java src which is not on the classpath it is annoying to have millions of Quickfix light bulbs and error indicators. I suggest to disable this feature and have a special icon in the editor tab to indicate that the source file is not on the classpath and therefore behaves differently in certain operations (search, quickfix, etc.)
resolved wontfix
27cae91
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-30T14:10:35Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
Iterator e= fCollectedProblems.iterator(); while (e.hasNext()) { IProblem problem= (IProblem) e.next(); if (fProgressMonitor != null && fProgressMonitor.isCanceled()) { isCanceled= true; break; } Position position= createPositionFromProblem(problem); if (position != null) { ProblemAnnotation annotation= new ProblemAnnotation(problem); overlayMarkers(position, annotation); fGeneratedAnnotations.add(annotation); addAnnotation(annotation, position, false); temporaryProblemsChanged= true; } } fCollectedProblems.clear(); } removeMarkerOverlays(isCanceled); fPreviouslyShadowed.clear(); fPreviouslyShadowed= null; }