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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18,015
|
Bug 18015 NPE in structured selection if file opened from repo
|
F1 1. repository view - open a java file 2. use structured selection java.lang.NullPointerException at org.eclipse.jdt.internal.ui.javaeditor.structureselection.StructureSelectionActi on.getNewSelectionRange(StructureSelectionAction.java:68) at org.eclipse.jdt.internal.ui.javaeditor.structureselection.StructureSelectionActi on.run(StructureSelectionAction.java:53) at org.eclipse.ui.texteditor.RetargetTextEditorAction.run (RetargetTextEditorAction.java:127) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:75) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:825) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1527) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1289) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1085) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1068) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:739) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:432) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)
|
verified fixed
|
f8bcbf5
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T13:33:19Z
| 2002-05-28T10:00:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/structureselection/StructureSelectionAction.java
|
public static final String ENCLOSING= "SelectEnclosingElement";
public static final String HISTORY= "RestoreLastSelection";
private CompilationUnitEditor fEditor;
private SelectionHistory fSelectionHistory;
protected StructureSelectionAction(String text, CompilationUnitEditor editor, SelectionHistory history) {
super(text);
Assert.isNotNull(editor);
Assert.isNotNull(history);
fEditor= editor;
fSelectionHistory= history;
}
/*
* This constructor is for testing purpose only.
*/
protected StructureSelectionAction() {
super("");
}
/* (non-JavaDoc)
* Method declared in IAction.
*/
public final void run() {
ITextSelection selection= getTextSelection();
ISourceRange newRange= getNewSelectionRange(createSourceRange(selection), getCompilationUnit());
if (selection.getOffset() == newRange.getOffset() && selection.getLength() == newRange.getLength())
return;
fSelectionHistory.remember(new SourceRange(selection.getOffset(), selection.getLength()));
try {
|
18,015
|
Bug 18015 NPE in structured selection if file opened from repo
|
F1 1. repository view - open a java file 2. use structured selection java.lang.NullPointerException at org.eclipse.jdt.internal.ui.javaeditor.structureselection.StructureSelectionActi on.getNewSelectionRange(StructureSelectionAction.java:68) at org.eclipse.jdt.internal.ui.javaeditor.structureselection.StructureSelectionActi on.run(StructureSelectionAction.java:53) at org.eclipse.ui.texteditor.RetargetTextEditorAction.run (RetargetTextEditorAction.java:127) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:75) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:825) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1527) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1289) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1085) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1068) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:739) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:432) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)
|
verified fixed
|
f8bcbf5
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T13:33:19Z
| 2002-05-28T10:00:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/structureselection/StructureSelectionAction.java
|
fSelectionHistory.ignoreSelectionChanges();
fEditor.selectAndReveal(newRange.getOffset(), newRange.getLength());
} finally {
fSelectionHistory.listenToSelectionChanges();
}
}
public final ISourceRange getNewSelectionRange(ISourceRange oldSourceRange, ICompilationUnit cu){
try{
if (! cu.isStructureKnown())
return oldSourceRange;
CompilationUnit root= AST.parseCompilationUnit(cu, false);
Selection selection= Selection.createFromStartLength(oldSourceRange.getOffset(), oldSourceRange.getLength());
StructureSelectionAnalyzer selAnalyzer= new StructureSelectionAnalyzer(selection, true);
root.accept(selAnalyzer);
return internalGetNewSelectionRange(oldSourceRange, cu, selAnalyzer);
} catch (JavaModelException e){
JavaPlugin.log(e);
return new SourceRange(oldSourceRange.getOffset(), oldSourceRange.getLength());
}
}
/**
* This is the default implementation - it goes up one level in the AST.
* Subclasses may implement different behavior and/or use this implementation as a fallback for cases they do not handle..
*/
abstract ISourceRange internalGetNewSelectionRange(ISourceRange oldSourceRange, ICompilationUnit cu, StructureSelectionAnalyzer selAnalyzer) throws JavaModelException;
protected final ICompilationUnit getCompilationUnit() {
return JavaPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(fEditor.getEditorInput());
|
18,015
|
Bug 18015 NPE in structured selection if file opened from repo
|
F1 1. repository view - open a java file 2. use structured selection java.lang.NullPointerException at org.eclipse.jdt.internal.ui.javaeditor.structureselection.StructureSelectionActi on.getNewSelectionRange(StructureSelectionAction.java:68) at org.eclipse.jdt.internal.ui.javaeditor.structureselection.StructureSelectionActi on.run(StructureSelectionAction.java:53) at org.eclipse.ui.texteditor.RetargetTextEditorAction.run (RetargetTextEditorAction.java:127) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:75) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:825) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1527) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1289) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1085) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1068) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:739) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:432) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)
|
verified fixed
|
f8bcbf5
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T13:33:19Z
| 2002-05-28T10:00:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/structureselection/StructureSelectionAction.java
|
}
protected final ITextSelection getTextSelection() {
return (ITextSelection)fEditor.getSelectionProvider().getSelection();
}
protected static ISourceRange getLastCoveringNodeRange(ISourceRange oldSourceRange, ICompilationUnit cu, StructureSelectionAnalyzer selAnalyzer) throws JavaModelException {
if (selAnalyzer.getLastCoveringNode() == null)
return oldSourceRange;
else
return getSelectedNodeSourceRange(cu, selAnalyzer.getLastCoveringNode());
}
protected static ISourceRange getSelectedNodeSourceRange(ICompilationUnit cu, ASTNode nodeToSelect) throws JavaModelException {
int offset= nodeToSelect.getStartPosition();
int end= Math.min(cu.getSourceRange().getLength(), nodeToSelect.getStartPosition() + nodeToSelect.getLength() - 1);
return createSourceRange(offset, end);
}
private static ISourceRange createSourceRange(ITextSelection ts){
if (ts.getLength() == 0)
return new SourceRange(ts.getOffset(), 1);
else
return new SourceRange(ts.getOffset(), ts.getLength());
}
|
18,015
|
Bug 18015 NPE in structured selection if file opened from repo
|
F1 1. repository view - open a java file 2. use structured selection java.lang.NullPointerException at org.eclipse.jdt.internal.ui.javaeditor.structureselection.StructureSelectionActi on.getNewSelectionRange(StructureSelectionAction.java:68) at org.eclipse.jdt.internal.ui.javaeditor.structureselection.StructureSelectionActi on.run(StructureSelectionAction.java:53) at org.eclipse.ui.texteditor.RetargetTextEditorAction.run (RetargetTextEditorAction.java:127) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:75) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:825) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1527) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1289) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1085) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1068) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:739) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:432) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)
|
verified fixed
|
f8bcbf5
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T13:33:19Z
| 2002-05-28T10:00:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/structureselection/StructureSelectionAction.java
|
static ISourceRange createSourceRange(int offset, int end){
int length= end - offset + 1;
if (length == 0)
length= 1;
return new SourceRange(Math.max(0, offset), length);
}
static ASTNode[] getChildNodes(ASTNode node){
if (node instanceof Block)
return convertToNodeArray(((Block)node).statements());
if (node instanceof TypeDeclaration)
return convertToNodeArray(((TypeDeclaration)node).bodyDeclarations());
if (node instanceof CompilationUnit)
return convertToNodeArray(((CompilationUnit)node).types());
return null;
}
private static ASTNode[] convertToNodeArray(Collection statements){
return (ASTNode[]) statements.toArray(new ASTNode[statements.size()]);
}
static int findIndex(Object[] array, Object o){
for (int i= 0; i < array.length; i++) {
Object object= array[i];
if (object == o)
return i;
}
return -1;
}
}
|
16,455
|
Bug 16455 Open type in hierarchy perspective. [type hierarchy]
|
I use open type dialog a lot to open the type in a hierarchy perpective but I can't find the preference to open the type in a hierarchy perpective anymore. I saw the button "Hierarchy" in the open type dialog but takes me 4 tabs to get there instead of pressing enter. (Not acceptable). Please can you point me to the new preference if it exists. Or can you give a way to make the Hierarchy button the default button. For example: If I press it once, it becames the active next time the dialog is opened.
|
resolved wontfix
|
e8a411e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T14:44:58Z
| 2002-05-20T15:53:20Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/OpenTypeAction.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.actions;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.core.search.SearchEngine;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.dialogs.OpenTypeSelectionDialog;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
import org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil;
public class OpenTypeAction extends Action implements IWorkbenchWindowActionDelegate {
|
16,455
|
Bug 16455 Open type in hierarchy perspective. [type hierarchy]
|
I use open type dialog a lot to open the type in a hierarchy perpective but I can't find the preference to open the type in a hierarchy perpective anymore. I saw the button "Hierarchy" in the open type dialog but takes me 4 tabs to get there instead of pressing enter. (Not acceptable). Please can you point me to the new preference if it exists. Or can you give a way to make the Hierarchy button the default button. For example: If I press it once, it becames the active next time the dialog is opened.
|
resolved wontfix
|
e8a411e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T14:44:58Z
| 2002-05-20T15:53:20Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/OpenTypeAction.java
|
public OpenTypeAction() {
super();
setText(JavaUIMessages.getString("OpenTypeAction.label"));
setDescription(JavaUIMessages.getString("OpenTypeAction.description"));
setToolTipText(JavaUIMessages.getString("OpenTypeAction.tooltip"));
setImageDescriptor(JavaPluginImages.DESC_TOOL_OPENTYPE);
}
public void run() {
Shell parent= JavaPlugin.getActiveWorkbenchShell();
OpenTypeSelectionDialog dialog= new OpenTypeSelectionDialog(parent, new ProgressMonitorDialog(parent),
IJavaSearchConstants.TYPE, SearchEngine.createWorkspaceScope());
dialog.setMatchEmptyString(true);
dialog.setTitle(JavaUIMessages.getString("OpenTypeAction.dialogTitle"));
dialog.setMessage(JavaUIMessages.getString("OpenTypeAction.dialogMessage"));
int result= dialog.open();
if (result != OpenTypeSelectionDialog.IN_HIERARCHY && result != IDialogConstants.OK_ID)
return;
Object[] types= dialog.getResult();
if (types != null && types.length > 0) {
IType type= (IType)types[0];
if (result == OpenTypeSelectionDialog.IN_HIERARCHY) {
|
16,455
|
Bug 16455 Open type in hierarchy perspective. [type hierarchy]
|
I use open type dialog a lot to open the type in a hierarchy perpective but I can't find the preference to open the type in a hierarchy perpective anymore. I saw the button "Hierarchy" in the open type dialog but takes me 4 tabs to get there instead of pressing enter. (Not acceptable). Please can you point me to the new preference if it exists. Or can you give a way to make the Hierarchy button the default button. For example: If I press it once, it becames the active next time the dialog is opened.
|
resolved wontfix
|
e8a411e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T14:44:58Z
| 2002-05-20T15:53:20Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/OpenTypeAction.java
|
OpenTypeHierarchyUtil.open(new IType[] { type }, JavaPlugin.getActiveWorkbenchWindow());
} else {
try {
IEditorPart part= EditorUtility.openInEditor(type, true);
EditorUtility.revealInEditor(part, type);
} catch (CoreException x) {
String title= JavaUIMessages.getString("OpenTypeAction.errorTitle");
String message= JavaUIMessages.getString("OpenTypeAction.errorMessage");
ExceptionHandler.handle(x, title, message);
}
}
}
}
public void run(IAction action) {
run();
}
public void dispose() {
}
public void init(IWorkbenchWindow window) {
}
public void selectionChanged(IAction action, ISelection selection) {
}
}
|
16,455
|
Bug 16455 Open type in hierarchy perspective. [type hierarchy]
|
I use open type dialog a lot to open the type in a hierarchy perpective but I can't find the preference to open the type in a hierarchy perpective anymore. I saw the button "Hierarchy" in the open type dialog but takes me 4 tabs to get there instead of pressing enter. (Not acceptable). Please can you point me to the new preference if it exists. Or can you give a way to make the Hierarchy button the default button. For example: If I press it once, it becames the active next time the dialog is opened.
|
resolved wontfix
|
e8a411e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T14:44:58Z
| 2002-05-20T15:53:20Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/OpenTypeSelectionDialog.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.dialogs;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
/**
* A dialog to select a type from a list of types. The selected type will be
* opened in the editor.
*/
public class OpenTypeSelectionDialog extends TypeSelectionDialog {
|
16,455
|
Bug 16455 Open type in hierarchy perspective. [type hierarchy]
|
I use open type dialog a lot to open the type in a hierarchy perpective but I can't find the preference to open the type in a hierarchy perpective anymore. I saw the button "Hierarchy" in the open type dialog but takes me 4 tabs to get there instead of pressing enter. (Not acceptable). Please can you point me to the new preference if it exists. Or can you give a way to make the Hierarchy button the default button. For example: If I press it once, it becames the active next time the dialog is opened.
|
resolved wontfix
|
e8a411e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T14:44:58Z
| 2002-05-20T15:53:20Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/OpenTypeSelectionDialog.java
|
public static final int IN_HIERARCHY= IDialogConstants.CLIENT_ID + 1;
/**
* Constructs an instance of <code>OpenTypeSelectionDialog</code>.
* @param parent the parent shell.
* @param context the context.
* @param elementKinds <code>IJavaSearchConstants.CLASS</code>, <code>IJavaSearchConstants.INTERFACE</code>
* or <code>IJavaSearchConstants.TYPE</code>
* @param scope the java search scope.
*/
public OpenTypeSelectionDialog(Shell parent, IRunnableContext context, int elementKinds,
IJavaSearchScope scope)
|
16,455
|
Bug 16455 Open type in hierarchy perspective. [type hierarchy]
|
I use open type dialog a lot to open the type in a hierarchy perpective but I can't find the preference to open the type in a hierarchy perpective anymore. I saw the button "Hierarchy" in the open type dialog but takes me 4 tabs to get there instead of pressing enter. (Not acceptable). Please can you point me to the new preference if it exists. Or can you give a way to make the Hierarchy button the default button. For example: If I press it once, it becames the active next time the dialog is opened.
|
resolved wontfix
|
e8a411e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T14:44:58Z
| 2002-05-20T15:53:20Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/OpenTypeSelectionDialog.java
|
{
super(parent, context, elementKinds, scope);
}
/**
* @see Windows#configureShell(Shell)
*/
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
WorkbenchHelp.setHelp(newShell, IJavaHelpContextIds.OPEN_TYPE_DIALOG);
}
/*
* @see Dialog#createButtonsForButtonBar(Composite)
*/
protected void createButtonsForButtonBar(Composite parent) {
createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
createButton(parent, IN_HIERARCHY, JavaUIMessages.getString("OpenTypeSelectionDialog.hierarchy.label"), false);
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}
protected void buttonPressed(int buttonId) {
super.buttonPressed(buttonId);
if (buttonId == IN_HIERARCHY) {
setReturnCode(buttonId);
computeResult();
close();
}
}
}
|
17,910
|
Bug 17910 OpenRefactoringWIzardAction: is API but has protected method that us internal classes
|
F1 Opt to remove the class and use an internal helper class instead.
|
verified fixed
|
38fd169
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T15:25:26Z
| 2002-05-27T11:46:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ModifyParametersAction.java
|
package org.eclipse.jdt.ui.actions;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.corext.refactoring.base.Refactoring;
import org.eclipse.jdt.internal.corext.refactoring.structure.ModifyParametersRefactoring;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
import org.eclipse.jdt.internal.ui.refactoring.ModifyParametersWizard;
import org.eclipse.jdt.internal.ui.refactoring.RefactoringMessages;
import org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard;
public class ModifyParametersAction extends OpenRefactoringWizardAction {
|
17,910
|
Bug 17910 OpenRefactoringWIzardAction: is API but has protected method that us internal classes
|
F1 Opt to remove the class and use an internal helper class instead.
|
verified fixed
|
38fd169
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T15:25:26Z
| 2002-05-27T11:46:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ModifyParametersAction.java
|
private static final String TITLE= RefactoringMessages.getString("RefactoringGroup.modify_Parameters_label");
private static final String UNAVAILABLE= RefactoringMessages.getString("ModifyParametersAction.unavailable");
public ModifyParametersAction(CompilationUnitEditor editor) {
super(TITLE, UNAVAILABLE, editor, IMethod.class, false);
}
public ModifyParametersAction(IWorkbenchSite site) {
super(TITLE, UNAVAILABLE, site, IMethod.class, false);
}
protected Refactoring createNewRefactoringInstance(Object obj){
return new ModifyParametersRefactoring((IMethod)obj);
}
protected boolean canActivateRefactoring(Refactoring refactoring) throws JavaModelException{
return ((ModifyParametersRefactoring)refactoring).checkPreactivation().isOK();
}
protected RefactoringWizard createWizard(Refactoring ref){
String title= RefactoringMessages.getString("RefactoringGroup.modify_method_parameters");
String helpId= IJavaHelpContextIds.RENAME_PARAMS_ERROR_WIZARD_PAGE;
return new ModifyParametersWizard((ModifyParametersRefactoring)ref, title, helpId);
}
}
|
17,910
|
Bug 17910 OpenRefactoringWIzardAction: is API but has protected method that us internal classes
|
F1 Opt to remove the class and use an internal helper class instead.
|
verified fixed
|
38fd169
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T15:25:26Z
| 2002-05-27T11:46:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenRefactoringWizardAction.java
|
package org.eclipse.jdt.ui.actions;
import java.util.Iterator;
import org.eclipse.swt.widgets.Display;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.corext.refactoring.Assert;
import org.eclipse.jdt.internal.corext.refactoring.base.Refactoring;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.SelectionConverter;
import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
import org.eclipse.jdt.internal.ui.refactoring.RefactoringMessages;
import org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard;
import org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
public abstract class OpenRefactoringWizardAction extends SelectionDispatchAction {
private Class fActivationType;
private Refactoring fRefactoring;
private CompilationUnitEditor fEditor;
private boolean fCanActivateOnMultiSelection;
private String fUnavailableMessage;
protected OpenRefactoringWizardAction(String label, String unavailableString, IWorkbenchSite site, Class activatedOnType, boolean canActivateOnMultiSelection) {
|
17,910
|
Bug 17910 OpenRefactoringWIzardAction: is API but has protected method that us internal classes
|
F1 Opt to remove the class and use an internal helper class instead.
|
verified fixed
|
38fd169
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T15:25:26Z
| 2002-05-27T11:46:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenRefactoringWizardAction.java
|
super(site);
Assert.isNotNull(unavailableString);
Assert.isNotNull(activatedOnType);
setText(label);
fActivationType= activatedOnType;
fCanActivateOnMultiSelection= canActivateOnMultiSelection;
fUnavailableMessage= unavailableString;
}
protected OpenRefactoringWizardAction(String label, String unavailableString, CompilationUnitEditor editor, Class activatedOnType, boolean canActivateOnMultiSelection) {
this(label, unavailableString, editor.getEditorSite(), activatedOnType, canActivateOnMultiSelection);
fEditor= editor;
}
/*
* @see SelectionDispatchAction#selectionChanged(IStructuredSelection)
*/
protected void selectionChanged(IStructuredSelection selection) {
setEnabled(canEnable(selection));
}
protected void selectionChanged(ITextSelection selection) {
setEnabled(checkEnabled(selection));
}
private boolean checkEnabled(ITextSelection selection) {
if (fEditor == null)
return false;
return SelectionConverter.getInputAsCompilationUnit(fEditor) != null;
}
|
17,910
|
Bug 17910 OpenRefactoringWIzardAction: is API but has protected method that us internal classes
|
F1 Opt to remove the class and use an internal helper class instead.
|
verified fixed
|
38fd169
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T15:25:26Z
| 2002-05-27T11:46:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenRefactoringWizardAction.java
|
/*
* @see SelectionDispatchAction#run(IStructuredSelection)
*/
protected void run(IStructuredSelection selection) {
startRefactoring();
}
protected void run(ITextSelection selection) {
if (! canRun(selection)){
MessageDialog.openInformation(getShell(), RefactoringMessages.getString("OpenRefactoringWizardAction.unavailable"), fUnavailableMessage);
fRefactoring= null;
return;
}
startRefactoring();
}
/**
* Creates a new instance of <code>Refactoring</code>.
* @param obj is guaranteed to be of the accepted type (passed in the constructor)
* However, if <code>fCanOperateOnMultiSelection</code> is set to <code>true</code>,
* then obj is <code>Object[]</code> and contains elements of the accepted type (passed in the constructor)
*/
protected abstract Refactoring createNewRefactoringInstance(Object obj) throws JavaModelException;
protected abstract RefactoringWizard createWizard(Refactoring refactoring);
protected abstract boolean canActivateRefactoring(Refactoring refactoring) throws JavaModelException;
private boolean canEnable(IStructuredSelection selection){
if (selection.isEmpty())
return false;
|
17,910
|
Bug 17910 OpenRefactoringWIzardAction: is API but has protected method that us internal classes
|
F1 Opt to remove the class and use an internal helper class instead.
|
verified fixed
|
38fd169
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T15:25:26Z
| 2002-05-27T11:46:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenRefactoringWizardAction.java
|
if (selection.size() > 1 && ! fCanActivateOnMultiSelection)
return false;
if (selection.size() == 1 && ! fCanActivateOnMultiSelection)
return fActivationType.isInstance(selection.getFirstElement()) && shouldAcceptElement(selection.getFirstElement());
for (Iterator iter= selection.iterator(); iter.hasNext(); ) {
if (!fActivationType.isInstance(iter.next()))
return false;
}
return shouldAcceptElement(selection.toArray());
}
private boolean canRun(ITextSelection selection){
IJavaElement[] elements= resolveElements();
if (elements.length != 1)
return false;
if (fCanActivateOnMultiSelection)
return fActivationType.isInstance(elements[0]) && shouldAcceptElement(elements);
else
return fActivationType.isInstance(elements[0]) && shouldAcceptElement(elements[0]);
}
/**
* @param obj is guaranteed to be of the accepted type (passed in the constructor)
* However, if <code>canOperateOnMultiSelection</code> resturns <code>true</code>,
* then obj is <code>Object[]</code> and contains elements of the accepted type (passed in the constructor)
* @see OpenWizardAction#shouldAcceptElement
*/
private final boolean shouldAcceptElement(Object obj) {
try{
|
17,910
|
Bug 17910 OpenRefactoringWIzardAction: is API but has protected method that us internal classes
|
F1 Opt to remove the class and use an internal helper class instead.
|
verified fixed
|
38fd169
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T15:25:26Z
| 2002-05-27T11:46:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenRefactoringWizardAction.java
|
fRefactoring= createNewRefactoringInstance(obj);
return canActivateRefactoring(fRefactoring);
} catch (JavaModelException e){
JavaPlugin.log(e);
return false;
}
}
private IJavaElement[] resolveElements() {
return SelectionConverter.codeResolveHandled(fEditor, getShell(), RefactoringMessages.getString("OpenRefactoringWizardAction.refactoring"));
}
private void startRefactoring() {
Assert.isNotNull(fRefactoring);
try{
Object newElementToProcess= new RefactoringStarter().activate(fRefactoring, createWizard(fRefactoring), RefactoringMessages.getString("OpenRefactoringWizardAction.refactoring"), true);
if (newElementToProcess == null)
return;
IStructuredSelection mockSelection= new StructuredSelection(newElementToProcess);
selectionChanged(mockSelection);
if (isEnabled())
run(mockSelection);
else
MessageDialog.openInformation(JavaPlugin.getActiveWorkbenchShell(), "Refactoring", "Operation not possible.");
} catch (JavaModelException e){
ExceptionHandler.handle(e, RefactoringMessages.getString("OpenRefactoringWizardAction.refactoring"), RefactoringMessages.getString("OpenRefactoringWizardAction.exception"));
}
}
}
|
17,910
|
Bug 17910 OpenRefactoringWIzardAction: is API but has protected method that us internal classes
|
F1 Opt to remove the class and use an internal helper class instead.
|
verified fixed
|
38fd169
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T15:25:26Z
| 2002-05-27T11:46:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/PullUpAction.java
|
package org.eclipse.jdt.ui.actions;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.corext.refactoring.base.Refactoring;
import org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoring;
import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
import org.eclipse.jdt.internal.ui.refactoring.PullUpWizard;
import org.eclipse.jdt.internal.ui.refactoring.RefactoringMessages;
import org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard;
public class PullUpAction extends OpenRefactoringWizardAction {
|
17,910
|
Bug 17910 OpenRefactoringWIzardAction: is API but has protected method that us internal classes
|
F1 Opt to remove the class and use an internal helper class instead.
|
verified fixed
|
38fd169
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T15:25:26Z
| 2002-05-27T11:46:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/PullUpAction.java
|
private static final String TITLE= RefactoringMessages.getString("RefactoringGroup.pull_Up_label");
private static final String UNAVAILABLE= RefactoringMessages.getString("PullUpAction.unavailable");
public PullUpAction(CompilationUnitEditor editor) {
super(TITLE, UNAVAILABLE, editor, IMember.class, true);
}
public PullUpAction(IWorkbenchSite site) {
super(TITLE, UNAVAILABLE, site, IMember.class, true);
}
protected Refactoring createNewRefactoringInstance(Object obj){
Set memberSet= new HashSet();
memberSet.addAll(Arrays.asList((Object[])obj));
IMember[] members= (IMember[]) memberSet.toArray(new IMember[memberSet.size()]);
return new PullUpRefactoring(members, JavaPreferencesSettings.getCodeGenerationSettings());
}
protected boolean canActivateRefactoring(Refactoring refactoring) throws JavaModelException{
return ((PullUpRefactoring)refactoring).checkPreactivation().isOK();
}
protected RefactoringWizard createWizard(Refactoring ref){
String title= RefactoringMessages.getString("RefactoringGroup.pull_up");
String helpId= "HELPID";
return new PullUpWizard((PullUpRefactoring)ref, title, helpId);
}
}
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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;
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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 {
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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;
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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(80);
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)) {
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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());
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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) {
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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);
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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);
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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);
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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) {
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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 {
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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")))
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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);
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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;
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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);
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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);
}
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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);
|
16,847
|
Bug 16847 Japanese: Template page buttons cut off
|
In the Java->Template page in Japanese the text is cut off on the last 4 buttons. STEPS 1) Install build 20020521 with the 20020515 fragments 2) Open Preferences->Java->Templates
|
resolved fixed
|
af58435
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:44:10Z
| 2002-05-22T15:06:40Z
|
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());
}
}
|
17,345
|
Bug 17345 add "org" to "Organize Imports"
|
Preferences>>Java>>Organize Imports I'd like to see the entry "org" added to the existing entries "java, javax, com". The package prefix "org" is so common ... why not add it to the existing ones ... eclipse itself has mostly this prefix.
|
closed fixed
|
0f0f22c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:55:08Z
| 2002-05-23T16:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizePreferencePage.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.preferences;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.StringTokenizer;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
|
17,345
|
Bug 17345 add "org" to "Organize Imports"
|
Preferences>>Java>>Organize Imports I'd like to see the entry "org" added to the existing entries "java, javax, com". The package prefix "org" is so common ... why not add it to the existing ones ... eclipse itself has mostly this prefix.
|
closed fixed
|
0f0f22c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:55:08Z
| 2002-05-23T16:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizePreferencePage.java
|
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField;
/*
* The page for setting the organize import settings
*/
public class ImportOrganizePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
|
17,345
|
Bug 17345 add "org" to "Organize Imports"
|
Preferences>>Java>>Organize Imports I'd like to see the entry "org" added to the existing entries "java, javax, com". The package prefix "org" is so common ... why not add it to the existing ones ... eclipse itself has mostly this prefix.
|
closed fixed
|
0f0f22c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:55:08Z
| 2002-05-23T16:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizePreferencePage.java
|
public static final String PREF_IMPORTORDER= JavaUI.ID_PLUGIN + ".importorder";
public static final String PREF_ONDEMANDTHRESHOLD= JavaUI.ID_PLUGIN + ".ondemandthreshold";
public static final String PREF_IGNORELOWERCASE= JavaUI.ID_PLUGIN + ".ignorelowercasenames";
private static final String PREF_LASTLOADPATH= JavaUI.ID_PLUGIN + ".importorder.loadpath";
private static final String PREF_LASTSAVEPATH= JavaUI.ID_PLUGIN + ".importorder.savepath";
public static String[] getImportOrderPreference() {
IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();
String str= prefs.getString(PREF_IMPORTORDER);
if (str != null) {
return unpackOrderList(str);
}
return new String[0];
}
private static String[] unpackOrderList(String str) {
StringTokenizer tok= new StringTokenizer(str, ";");
int nTokens= tok.countTokens();
String[] res= new String[nTokens];
for (int i= 0; i < nTokens; i++) {
res[i]= tok.nextToken();
}
return res;
}
private static String packOrderList(List orderList) {
StringBuffer buf= new StringBuffer();
for (int i= 0; i < orderList.size(); i++) {
buf.append((String) orderList.get(i));
buf.append(';');
|
17,345
|
Bug 17345 add "org" to "Organize Imports"
|
Preferences>>Java>>Organize Imports I'd like to see the entry "org" added to the existing entries "java, javax, com". The package prefix "org" is so common ... why not add it to the existing ones ... eclipse itself has mostly this prefix.
|
closed fixed
|
0f0f22c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:55:08Z
| 2002-05-23T16:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizePreferencePage.java
|
}
return buf.toString();
}
public static int getImportNumberThreshold() {
IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();
int threshold= prefs.getInt(PREF_ONDEMANDTHRESHOLD);
if (threshold < 0) {
threshold= Integer.MAX_VALUE;
}
return threshold;
}
public static boolean doIgnoreLowerCaseNames() {
IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();
return prefs.getBoolean(PREF_IGNORELOWERCASE);
}
/**
* 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_IMPORTORDER, "java;javax;com");
prefs.setDefault(PREF_ONDEMANDTHRESHOLD, 99);
}
private static class ImportOrganizeLabelProvider extends LabelProvider {
|
17,345
|
Bug 17345 add "org" to "Organize Imports"
|
Preferences>>Java>>Organize Imports I'd like to see the entry "org" added to the existing entries "java, javax, com". The package prefix "org" is so common ... why not add it to the existing ones ... eclipse itself has mostly this prefix.
|
closed fixed
|
0f0f22c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:55:08Z
| 2002-05-23T16:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizePreferencePage.java
|
private static final Image PCK_ICON= JavaPluginImages.get(JavaPluginImages.IMG_OBJS_PACKAGE);
public Image getImage(Object element) {
return PCK_ICON;
}
}
private class ImportOrganizeAdapter implements IListAdapter, IDialogFieldListener {
public void customButtonPressed(DialogField field, int index) {
doButtonPressed(index);
}
public void selectionChanged(DialogField field) {
doSelectionChanged();
}
public void dialogFieldChanged(DialogField field) {
if (field == fThresholdField) {
doThresholdChanged();
}
|
17,345
|
Bug 17345 add "org" to "Organize Imports"
|
Preferences>>Java>>Organize Imports I'd like to see the entry "org" added to the existing entries "java, javax, com". The package prefix "org" is so common ... why not add it to the existing ones ... eclipse itself has mostly this prefix.
|
closed fixed
|
0f0f22c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:55:08Z
| 2002-05-23T16:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizePreferencePage.java
|
}
}
private ListDialogField fOrderListField;
private StringDialogField fThresholdField;
private SelectionButtonDialogField fIgnoreLowerCaseTypesField;
public ImportOrganizePreferencePage() {
super();
setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore());
setDescription(JavaUIMessages.getString("ImportOrganizePreferencePage.description"));
String[] buttonLabels= new String[] {
JavaUIMessages.getString("ImportOrganizePreferencePage.order.add.button"),
JavaUIMessages.getString("ImportOrganizePreferencePage.order.edit.button"),
null,
JavaUIMessages.getString("ImportOrganizePreferencePage.order.up.button"),
JavaUIMessages.getString("ImportOrganizePreferencePage.order.down.button"),
null,
JavaUIMessages.getString("ImportOrganizePreferencePage.order.remove.button"),
null,
JavaUIMessages.getString("ImportOrganizePreferencePage.order.load.button"),
JavaUIMessages.getString("ImportOrganizePreferencePage.order.save.button")
};
ImportOrganizeAdapter adapter= new ImportOrganizeAdapter();
fOrderListField= new ListDialogField(adapter, buttonLabels, new ImportOrganizeLabelProvider());
fOrderListField.setDialogFieldListener(adapter);
fOrderListField.setLabelText(JavaUIMessages.getString("ImportOrganizePreferencePage.order.label"));
fOrderListField.setUpButtonIndex(3);
|
17,345
|
Bug 17345 add "org" to "Organize Imports"
|
Preferences>>Java>>Organize Imports I'd like to see the entry "org" added to the existing entries "java, javax, com". The package prefix "org" is so common ... why not add it to the existing ones ... eclipse itself has mostly this prefix.
|
closed fixed
|
0f0f22c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:55:08Z
| 2002-05-23T16:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizePreferencePage.java
|
fOrderListField.setDownButtonIndex(4);
fOrderListField.setRemoveButtonIndex(6);
fOrderListField.enableButton(1, false);
fThresholdField= new StringDialogField();
fThresholdField.setDialogFieldListener(adapter);
fThresholdField.setLabelText(JavaUIMessages.getString("ImportOrganizePreferencePage.threshold.label"));
fIgnoreLowerCaseTypesField= new SelectionButtonDialogField(SWT.CHECK);
fIgnoreLowerCaseTypesField.setLabelText(JavaUIMessages.getString("ImportOrganizePreferencePage.ignoreLowerCase.label"));
}
/**
* @see PreferencePage#createControl(Composite)
*/
public void createControl(Composite parent) {
super.createControl(parent);
WorkbenchHelp.setHelp(getControl(), IJavaHelpContextIds.ORGANIZE_IMPORTS_PREFERENCE_PAGE);
}
protected Control createContents(Composite parent) {
initialize(getImportOrderPreference(), getImportNumberThreshold(), doIgnoreLowerCaseNames());
Composite composite= new Composite(parent, SWT.NONE);
GridLayout layout= new GridLayout();
layout.numColumns= 2;
layout.marginWidth= 0;
|
17,345
|
Bug 17345 add "org" to "Organize Imports"
|
Preferences>>Java>>Organize Imports I'd like to see the entry "org" added to the existing entries "java, javax, com". The package prefix "org" is so common ... why not add it to the existing ones ... eclipse itself has mostly this prefix.
|
closed fixed
|
0f0f22c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:55:08Z
| 2002-05-23T16:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizePreferencePage.java
|
layout.marginHeight= 0;
composite.setLayout(layout);
fOrderListField.doFillIntoGrid(composite, 3);
LayoutUtil.setHorizontalSpan(fOrderListField.getLabelControl(null), 2);
LayoutUtil.setHorizontalGrabbing(fOrderListField.getListControl(null));
fThresholdField.doFillIntoGrid(composite, 2);
((GridData) fThresholdField.getTextControl(null).getLayoutData()).grabExcessHorizontalSpace= false;
fIgnoreLowerCaseTypesField.doFillIntoGrid(composite, 2);
return composite;
}
private void initialize(String[] importOrder, int threshold, boolean ignoreLowerCase) {
fOrderListField.removeAllElements();
for (int i= 0; i < importOrder.length; i++) {
fOrderListField.addElement(importOrder[i]);
}
fThresholdField.setText(String.valueOf(threshold));
fIgnoreLowerCaseTypesField.setSelection(ignoreLowerCase);
}
private void doThresholdChanged() {
StatusInfo status= new StatusInfo();
String thresholdString= fThresholdField.getText();
try {
int threshold= Integer.parseInt(thresholdString);
|
17,345
|
Bug 17345 add "org" to "Organize Imports"
|
Preferences>>Java>>Organize Imports I'd like to see the entry "org" added to the existing entries "java, javax, com". The package prefix "org" is so common ... why not add it to the existing ones ... eclipse itself has mostly this prefix.
|
closed fixed
|
0f0f22c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:55:08Z
| 2002-05-23T16:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizePreferencePage.java
|
if (threshold < 0) {
status.setError(JavaUIMessages.getString("ImportOrganizePreferencePage.error.invalidthreshold"));
}
} catch (NumberFormatException e) {
status.setError(JavaUIMessages.getString("ImportOrganizePreferencePage.error.invalidthreshold"));
}
updateStatus(status);
}
private void doButtonPressed(int index) {
if (index == 0) {
List existing= fOrderListField.getElements();
ImportOrganizeInputDialog dialog= new ImportOrganizeInputDialog(getShell(), existing);
if (dialog.open() == dialog.OK) {
fOrderListField.addElement(dialog.getResult());
}
} else if (index == 1) {
List selected= fOrderListField.getSelectedElements();
if (selected.isEmpty()) {
return;
}
String editedEntry= (String) selected.get(0);
List existing= fOrderListField.getElements();
existing.remove(editedEntry);
ImportOrganizeInputDialog dialog= new ImportOrganizeInputDialog(getShell(), existing);
dialog.setInitialString(editedEntry);
if (dialog.open() == dialog.OK) {
fOrderListField.replaceElement(editedEntry, dialog.getResult());
|
17,345
|
Bug 17345 add "org" to "Organize Imports"
|
Preferences>>Java>>Organize Imports I'd like to see the entry "org" added to the existing entries "java, javax, com". The package prefix "org" is so common ... why not add it to the existing ones ... eclipse itself has mostly this prefix.
|
closed fixed
|
0f0f22c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:55:08Z
| 2002-05-23T16:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizePreferencePage.java
|
}
} else if (index == 8) {
List order= loadImportOrder();
if (order != null) {
fOrderListField.setElements(order);
}
} else if (index == 9) {
saveImportOrder(fOrderListField.getElements());
}
}
private void doSelectionChanged() {
List selected= fOrderListField.getSelectedElements();
fOrderListField.enableButton(1, selected.size() == 1);
}
/**
* The import order file is a property file with keys
* "0", "1" ... last entry.
* values must be valid package names
*/
private List loadFromProperties(Properties properties) {
ArrayList res= new ArrayList();
int nEntries= properties.size();
for (int i= 0 ; i < nEntries; i++) {
String curr= properties.getProperty(String.valueOf(i));
if (curr != null) {
if (JavaConventions.validatePackageName(curr).isOK()) {
res.add(curr);
|
17,345
|
Bug 17345 add "org" to "Organize Imports"
|
Preferences>>Java>>Organize Imports I'd like to see the entry "org" added to the existing entries "java, javax, com". The package prefix "org" is so common ... why not add it to the existing ones ... eclipse itself has mostly this prefix.
|
closed fixed
|
0f0f22c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:55:08Z
| 2002-05-23T16:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizePreferencePage.java
|
} else {
return null;
}
} else {
return res;
}
}
return res;
}
private List loadImportOrder() {
FileDialog dialog= new FileDialog(getShell(), SWT.OPEN);
dialog.setText(JavaUIMessages.getString("ImportOrganizePreferencePage.loadDialog.title")); )
dialog.setFilterExtensions(new String[] {"*.importorder", "*.*"});
String lastPath= getPreferenceStore().getString(PREF_LASTLOADPATH);
if (lastPath != null) {
dialog.setFilterPath(lastPath);
}
String fileName= dialog.open();
if (fileName != null) {
getPreferenceStore().putValue(PREF_LASTLOADPATH, dialog.getFilterPath());
Properties properties= new Properties();
FileInputStream fis= null;
try {
fis= new FileInputStream(fileName);
properties.load(fis);
List res= loadFromProperties(properties);
if (res != null) {
return res;
|
17,345
|
Bug 17345 add "org" to "Organize Imports"
|
Preferences>>Java>>Organize Imports I'd like to see the entry "org" added to the existing entries "java, javax, com". The package prefix "org" is so common ... why not add it to the existing ones ... eclipse itself has mostly this prefix.
|
closed fixed
|
0f0f22c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:55:08Z
| 2002-05-23T16:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizePreferencePage.java
|
}
} catch (IOException e) {
JavaPlugin.log(e);
} finally {
if (fis != null) {
try { fis.close(); } catch (IOException e) {}
}
}
String title= JavaUIMessages.getString("ImportOrganizePreferencePage.loadDialog.error.title");
String message= JavaUIMessages.getString("ImportOrganizePreferencePage.loadDialog.error.message");
MessageDialog.openError(getShell(), title, message);
}
return null;
}
private void saveImportOrder(List elements) {
FileDialog dialog= new FileDialog(getShell(), SWT.SAVE);
dialog.setText(JavaUIMessages.getString("ImportOrganizePreferencePage.saveDialog.title")); )
dialog.setFilterExtensions(new String[] {"*.importorder", "*.*"});
dialog.setFileName("example.importorder");
String lastPath= getPreferenceStore().getString(PREF_LASTSAVEPATH);
if (lastPath != null) {
dialog.setFilterPath(lastPath);
}
String fileName= dialog.open();
if (fileName != null) {
getPreferenceStore().putValue(PREF_LASTSAVEPATH, dialog.getFilterPath());
Properties properties= new Properties();
for (int i= 0; i < elements.size(); i++) {
|
17,345
|
Bug 17345 add "org" to "Organize Imports"
|
Preferences>>Java>>Organize Imports I'd like to see the entry "org" added to the existing entries "java, javax, com". The package prefix "org" is so common ... why not add it to the existing ones ... eclipse itself has mostly this prefix.
|
closed fixed
|
0f0f22c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:55:08Z
| 2002-05-23T16:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizePreferencePage.java
|
properties.setProperty(String.valueOf(i), (String) elements.get(i));
}
FileOutputStream fos= null;
try {
fos= new FileOutputStream(fileName);
properties.store(fos, "Organize Import Order");
} catch (IOException e) {
JavaPlugin.log(e);
String title= JavaUIMessages.getString("ImportOrganizePreferencePage.saveDialog.error.title");
String message= JavaUIMessages.getString("ImportOrganizePreferencePage.saveDialog.error.message");
MessageDialog.openError(getShell(), title, message);
} finally {
if (fos != null) {
try { fos.close(); } catch (IOException e) {}
}
}
}
}
public void init(IWorkbench workbench) {
}
private void updateStatus(IStatus status) {
setValid(!status.matches(IStatus.ERROR));
StatusUtil.applyToStatusLine(this, status);
}
/**
* @see PreferencePage#performDefaults()
*/
protected void performDefaults() {
|
17,345
|
Bug 17345 add "org" to "Organize Imports"
|
Preferences>>Java>>Organize Imports I'd like to see the entry "org" added to the existing entries "java, javax, com". The package prefix "org" is so common ... why not add it to the existing ones ... eclipse itself has mostly this prefix.
|
closed fixed
|
0f0f22c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T16:55:08Z
| 2002-05-23T16:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizePreferencePage.java
|
String[] order;
IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();
String str= prefs.getDefaultString(PREF_IMPORTORDER);
if (str != null) {
order= unpackOrderList(str);
} else {
order= new String[0];
}
int threshold= prefs.getDefaultInt(PREF_ONDEMANDTHRESHOLD);
if (threshold < 0) {
threshold= Integer.MAX_VALUE;
}
boolean ignoreLowerCase= prefs.getDefaultBoolean(PREF_IGNORELOWERCASE);
initialize(order, threshold, ignoreLowerCase);
super.performDefaults();
}
/**
* @see IPreferencePage#performOk()
*/
public boolean performOk() {
IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore();
prefs.setValue(PREF_IMPORTORDER, packOrderList(fOrderListField.getElements()));
prefs.setValue(PREF_ONDEMANDTHRESHOLD, fThresholdField.getText());
prefs.setValue(PREF_IGNORELOWERCASE, fIgnoreLowerCaseTypesField.isSelected());
JavaPlugin.getDefault().savePluginPreferences();
return true;
}
}
|
17,311
|
Bug 17311 Javadoc properties page prevents keyboard navigation
|
Build 20020521 The Javadoc properties page for a project sets the focus to the javadoc location as soon as it is selected. As a result if you are using the keyboard to move through the list entries you have to tab out everytime you hit it. STEPS 1) Open the properties on a java project 2) Use the keyboard to move through the list of pages 3) When you hit the javadoc page the cursor is taken and you have to tab out
|
verified fixed
|
f5f6d4e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:15:12Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavadocConfigurationPropertyPage.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.preferences;
import java.net.URL;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.dialogs.PropertyPage;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.corext.javadoc.JavaDocLocations;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
/**
* Property page used to set the project's Javadoc location for sources
*/
public class JavadocConfigurationPropertyPage extends PropertyPage implements IStatusChangeListener {
|
17,311
|
Bug 17311 Javadoc properties page prevents keyboard navigation
|
Build 20020521 The Javadoc properties page for a project sets the focus to the javadoc location as soon as it is selected. As a result if you are using the keyboard to move through the list entries you have to tab out everytime you hit it. STEPS 1) Open the properties on a java project 2) Use the keyboard to move through the list of pages 3) When you hit the javadoc page the cursor is taken and you have to tab out
|
verified fixed
|
f5f6d4e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:15:12Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavadocConfigurationPropertyPage.java
|
private JavadocConfigurationBlock fJavadocConfigurationBlock;
public JavadocConfigurationPropertyPage() {
}
/**
* @see IDialogPage#createControl(Composite)
*/
public void createControl(Composite parent) {
IJavaElement elem= getJavaElement();
if (elem instanceof IPackageFragmentRoot)
setDescription(JavaUIMessages.getString("JavadocConfigurationPropertyPage.IsPackageFragmentRoot.description"));
else if (elem instanceof IJavaProject)
setDescription(JavaUIMessages.getString("JavadocConfigurationPropertyPage.IsJavaProject.description"));
else
setDescription(JavaUIMessages.getString("JavadocConfigurationPropertyPage.IsIncorrectElement.description"));
super.createControl(parent);
}
/*
* @see PreferencePage#createContents(Composite)
|
17,311
|
Bug 17311 Javadoc properties page prevents keyboard navigation
|
Build 20020521 The Javadoc properties page for a project sets the focus to the javadoc location as soon as it is selected. As a result if you are using the keyboard to move through the list entries you have to tab out everytime you hit it. STEPS 1) Open the properties on a java project 2) Use the keyboard to move through the list of pages 3) When you hit the javadoc page the cursor is taken and you have to tab out
|
verified fixed
|
f5f6d4e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:15:12Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavadocConfigurationPropertyPage.java
|
*/
protected Control createContents(Composite parent) {
IJavaElement elem= getJavaElement();
fJavadocConfigurationBlock= new JavadocConfigurationBlock(elem, getShell(), this);
Control control= fJavadocConfigurationBlock.createContents(parent);
return control;
}
private IJavaElement getJavaElement() {
IAdaptable adaptable= getElement();
IJavaElement elem= (IJavaElement) adaptable.getAdapter(IJavaElement.class);
if (elem == null) {
IResource resource= (IResource) adaptable.getAdapter(IResource.class);
try {
if (resource instanceof IFile) {
IProject proj= resource.getProject();
if (proj.hasNature(JavaCore.NATURE_ID)) {
IJavaProject jproject= JavaCore.create(proj);
IPackageFragmentRoot root= jproject.findPackageFragmentRoot(resource.getFullPath());
if (root != null && root.isArchive()) {
elem= root;
}
}
}
} catch (CoreException e) {
JavaPlugin.log(e);
}
}
return elem;
}
|
17,311
|
Bug 17311 Javadoc properties page prevents keyboard navigation
|
Build 20020521 The Javadoc properties page for a project sets the focus to the javadoc location as soon as it is selected. As a result if you are using the keyboard to move through the list entries you have to tab out everytime you hit it. STEPS 1) Open the properties on a java project 2) Use the keyboard to move through the list of pages 3) When you hit the javadoc page the cursor is taken and you have to tab out
|
verified fixed
|
f5f6d4e
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:15:12Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavadocConfigurationPropertyPage.java
|
/*
* @see PreferencePage#performDefaults()
*/
protected void performDefaults() {
fJavadocConfigurationBlock.performDefaults();
super.performDefaults();
}
/**
* @see IPreferencePage#performOk()
*/
public boolean performOk() {
return fJavadocConfigurationBlock.performOk();
}
/* (non-Javadoc)
* @see IDialogPage#setVisible(boolean)
*/
public void setVisible(boolean visible) {
if (visible) {
fJavadocConfigurationBlock.setFocus();
}
super.setVisible(visible);
}
/**
* @see IStatusChangeListener#statusChanged(IStatus)
*/
public void statusChanged(IStatus status) {
setValid(!status.matches(IStatus.ERROR));
StatusUtil.applyToStatusLine(this, status);
}
}
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.preferences;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Hashtable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Text;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.core.ICodeFormatter;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.ToolFactory;
import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration;
import org.eclipse.jdt.ui.text.JavaTextTools;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
import org.eclipse.jdt.internal.ui.util.TabFolderLayout;
/*
* The page for setting code formatter options
*/
public class CodeFormatterPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
private static final String PREF_NEWLINE_OPENING_BRACES= JavaCore.FORMATTER_NEWLINE_OPENING_BRACE;
private static final String PREF_NEWLINE_CONTROL_STATEMENT= JavaCore.FORMATTER_NEWLINE_CONTROL;
private static final String PREF_NEWLINE_CLEAR_ALL= JavaCore.FORMATTER_CLEAR_BLANK_LINES;
private static final String PREF_NEWLINE_ELSE_IF= JavaCore.FORMATTER_NEWLINE_ELSE_IF;
private static final String PREF_NEWLINE_EMPTY_BLOCK= JavaCore.FORMATTER_NEWLINE_EMPTY_BLOCK;
private static final String PREF_LINE_SPLIT= JavaCore.FORMATTER_LINE_SPLIT;
private static final String PREF_STYLE_COMPACT_ASSIGNEMENT= JavaCore.FORMATTER_COMPACT_ASSIGNMENT;
private static final String PREF_TAB_CHAR= JavaCore.FORMATTER_TAB_CHAR;
private static final String PREF_TAB_SIZE= JavaCore.FORMATTER_TAB_SIZE;
private static final String INSERT= JavaCore.INSERT;
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
private static final String DO_NOT_INSERT= JavaCore.DO_NOT_INSERT;
private static final String COMPACT= JavaCore.COMPACT;
private static final String NORMAL= JavaCore.NORMAL;
private static final String TAB= JavaCore.TAB;
private static final String SPACE= JavaCore.SPACE;
private static final String CLEAR_ALL= JavaCore.CLEAR_ALL;
private static final String PRESERVE_ONE= JavaCore.PRESERVE_ONE;
private static String[] getAllKeys() {
return new String[] {
PREF_NEWLINE_OPENING_BRACES, PREF_NEWLINE_CONTROL_STATEMENT, PREF_NEWLINE_CLEAR_ALL,
PREF_NEWLINE_ELSE_IF, PREF_NEWLINE_EMPTY_BLOCK, PREF_LINE_SPLIT,
PREF_STYLE_COMPACT_ASSIGNEMENT, PREF_TAB_CHAR, PREF_TAB_SIZE
};
}
/**
* Gets the currently configured tab size
*/
public static int getTabSize() {
String string= (String) JavaCore.getOptions().get(PREF_TAB_SIZE);
return getPositiveIntValue(string, 4);
}
/**
* Gets the current compating assignement configuration
*/
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
public static boolean isCompactingAssignment() {
return COMPACT.equals(JavaCore.getOptions().get(PREF_STYLE_COMPACT_ASSIGNEMENT));
}
/**
* Gets the current compating assignement configuration
*/
public static boolean useSpaces() {
return SPACE.equals(JavaCore.getOptions().get(PREF_TAB_CHAR));
}
private static int getPositiveIntValue(String string, int dflt) {
try {
int i= Integer.parseInt(string);
if (i >= 0) {
return i;
}
} catch (NumberFormatException e) {
}
return dflt;
}
/**
* Initializes the current options (read from preference store)
*/
public static void initDefaults(IPreferenceStore store) {
}
private static class ControlData {
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
private String fKey;
private String[] fValues;
public ControlData(String key, String[] values) {
fKey= key;
fValues= values;
}
public String getKey() {
return fKey;
}
public String getValue(boolean selection) {
int index= selection ? 0 : 1;
return fValues[index];
}
public String getValue(int index) {
return fValues[index];
}
public int getSelection(String value) {
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
for (int i= 0; i < fValues.length; i++) {
if (value.equals(fValues[i])) {
return i;
}
}
throw new IllegalArgumentException();
}
}
private Hashtable fWorkingValues;
private ArrayList fCheckBoxes;
private ArrayList fTextBoxes;
private SelectionListener fButtonSelectionListener;
private ModifyListener fTextModifyListener;
private String fPreviewText;
private IDocument fPreviewDocument;
private Text fTabSizeTextBox;
private SourceViewer fSourceViewer;
public CodeFormatterPreferencePage() {
setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore());
setDescription(JavaUIMessages.getString("CodeFormatterPreferencePage.description"));
fWorkingValues= JavaCore.getOptions();
fCheckBoxes= new ArrayList();
fTextBoxes= new ArrayList();
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
fButtonSelectionListener= new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {}
public void widgetSelected(SelectionEvent e) {
if (!e.widget.isDisposed()) {
controlChanged((Button) e.widget);
}
}
};
fTextModifyListener= new ModifyListener() {
public void modifyText(ModifyEvent e) {
if (!e.widget.isDisposed()) {
textChanged((Text) e.widget);
}
}
};
fPreviewDocument= new Document();
fPreviewText= loadPreviewFile("CodeFormatterPreviewCode.txt");
}
/*
* @see IWorkbenchPreferencePage#init()
*/
public void init(IWorkbench workbench) {
}
/*
* @see PreferencePage#createControl(Composite)
*/
public void createControl(Composite parent) {
super.createControl(parent);
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
WorkbenchHelp.setHelp(getControl(), IJavaHelpContextIds.CODEFORMATTER_PREFERENCE_PAGE);
}
/*
* @see PreferencePage#createContents(Composite)
*/
protected Control createContents(Composite parent) {
GridLayout layout= new GridLayout();
layout.marginHeight= 0;
layout.marginWidth= 0;
Composite composite= new Composite(parent, SWT.NONE);
composite.setLayout(layout);
TabFolder folder= new TabFolder(composite, SWT.NONE);
folder.setLayout(new TabFolderLayout());
folder.setLayoutData(new GridData(GridData.FILL_BOTH));
String[] insertNotInsert= new String[] { INSERT, DO_NOT_INSERT };
layout= new GridLayout();
layout.numColumns= 2;
Composite newlineComposite= new Composite(folder, SWT.NULL);
newlineComposite.setLayout(layout);
String label= JavaUIMessages.getString("CodeFormatterPreferencePage.newline_opening_braces.label");
addCheckBox(newlineComposite, label, PREF_NEWLINE_OPENING_BRACES, insertNotInsert);
label= JavaUIMessages.getString("CodeFormatterPreferencePage.newline_control_statement.label");
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
addCheckBox(newlineComposite, label, PREF_NEWLINE_CONTROL_STATEMENT, insertNotInsert);
label= JavaUIMessages.getString("CodeFormatterPreferencePage.newline_clear_lines");
addCheckBox(newlineComposite, label, PREF_NEWLINE_CLEAR_ALL, new String[] { CLEAR_ALL, PRESERVE_ONE } );
label= JavaUIMessages.getString("CodeFormatterPreferencePage.newline_else_if.label");
addCheckBox(newlineComposite, label, PREF_NEWLINE_ELSE_IF, insertNotInsert);
label= JavaUIMessages.getString("CodeFormatterPreferencePage.newline_empty_block.label");
addCheckBox(newlineComposite, label, PREF_NEWLINE_EMPTY_BLOCK, insertNotInsert);
layout= new GridLayout();
layout.numColumns= 2;
Composite lineSplittingComposite= new Composite(folder, SWT.NULL);
lineSplittingComposite.setLayout(layout);
label= JavaUIMessages.getString("CodeFormatterPreferencePage.split_line.label");
addTextField(lineSplittingComposite, label, PREF_LINE_SPLIT);
layout= new GridLayout();
layout.numColumns= 2;
Composite styleComposite= new Composite(folder, SWT.NULL);
styleComposite.setLayout(layout);
label= JavaUIMessages.getString("CodeFormatterPreferencePage.style_compact_assignement.label");
addCheckBox(styleComposite, label, PREF_STYLE_COMPACT_ASSIGNEMENT, new String[] { COMPACT, NORMAL } );
label= JavaUIMessages.getString("CodeFormatterPreferencePage.tab_char.label");
addCheckBox(styleComposite, label, PREF_TAB_CHAR, new String[] { TAB, SPACE } );
label= JavaUIMessages.getString("CodeFormatterPreferencePage.tab_size.label");
fTabSizeTextBox= addTextField(styleComposite, label, PREF_TAB_SIZE);
TabItem item= new TabItem(folder, SWT.NONE);
item.setText(JavaUIMessages.getString("CodeFormatterPreferencePage.tab.newline.tabtitle"));
item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_IMPDECL));
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
item.setControl(newlineComposite);
item= new TabItem(folder, SWT.NONE);
item.setText(JavaUIMessages.getString("CodeFormatterPreferencePage.tab.linesplit.tabtitle"));
item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_CFILE));
item.setControl(lineSplittingComposite);
item= new TabItem(folder, SWT.NONE);
item.setText(JavaUIMessages.getString("CodeFormatterPreferencePage.tab.style.tabtitle"));
item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_SEARCH_REF));
item.setControl(styleComposite);
fSourceViewer= createPreview(parent);
updatePreview();
return composite;
}
private SourceViewer createPreview(Composite parent) {
SourceViewer previewViewer= new SourceViewer(parent, null, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
previewViewer.configure(new JavaSourceViewerConfiguration(tools, null));
previewViewer.getTextWidget().setFont(JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT));
previewViewer.getTextWidget().setTabs(getPositiveIntValue((String) fWorkingValues.get(PREF_TAB_SIZE), 0));
previewViewer.setEditable(false);
previewViewer.setDocument(fPreviewDocument);
Control control= previewViewer.getControl();
GridData gdata= new GridData(GridData.FILL_BOTH);
gdata.widthHint= convertWidthInCharsToPixels(80);
gdata.heightHint= convertHeightInCharsToPixels(15);
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
control.setLayoutData(gdata);
return previewViewer;
}
private Button addCheckBox(Composite parent, String label, String key, String[] values) {
ControlData data= new ControlData(key, values);
GridData gd= new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan= 2;
Button checkBox= new Button(parent, SWT.CHECK);
checkBox.setText(label);
checkBox.setData(data);
checkBox.setLayoutData(gd);
String currValue= (String)fWorkingValues.get(key);
checkBox.setSelection(data.getSelection(currValue) == 0);
checkBox.addSelectionListener(fButtonSelectionListener);
fCheckBoxes.add(checkBox);
return checkBox;
}
private Text addTextField(Composite parent, String label, String key) {
Label labelControl= new Label(parent, SWT.NONE);
labelControl.setText(label);
labelControl.setLayoutData(new GridData());
Text textBox= new Text(parent, SWT.BORDER | SWT.SINGLE);
textBox.setData(key);
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
textBox.setLayoutData(new GridData());
String currValue= (String)fWorkingValues.get(key);
textBox.setText(String.valueOf(getPositiveIntValue(currValue, 1)));
textBox.setTextLimit(3);
textBox.addModifyListener(fTextModifyListener);
GridData gd= new GridData();
gd.widthHint= convertWidthInCharsToPixels(5);
textBox.setLayoutData(gd);
fTextBoxes.add(textBox);
return textBox;
}
private void controlChanged(Button button) {
ControlData data= (ControlData) button.getData();
boolean selection= button.getSelection();
String newValue= data.getValue(selection);
fWorkingValues.put(data.getKey(), newValue);
updatePreview();
if (PREF_TAB_CHAR.equals(data.getKey())) {
updateStatus(new StatusInfo());
if (selection) {
fTabSizeTextBox.setText((String)fWorkingValues.get(PREF_TAB_SIZE));
}
}
}
private void textChanged(Text textControl) {
String key= (String) textControl.getData();
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
String number= textControl.getText();
IStatus status= validatePositiveNumber(number);
if (!status.matches(IStatus.ERROR)) {
fWorkingValues.put(key, number);
}
if (PREF_TAB_SIZE.equals(key)) {
fSourceViewer.getTextWidget().setTabs(getPositiveIntValue(number, 0));
}
updateStatus(status);
updatePreview();
}
/*
* @see IPreferencePage#performOk()
*/
public boolean performOk() {
String[] allKeys= getAllKeys();
Hashtable actualOptions= JavaCore.getOptions();
for (int i= 0; i < allKeys.length; i++) {
String key= allKeys[i];
String val= (String) fWorkingValues.get(key);
actualOptions.put(key, val);
}
JavaCore.setOptions(actualOptions);
JavaPlugin.getDefault().savePluginPreferences();
return super.performOk();
}
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
/*
* @see PreferencePage#performDefaults()
*/
protected void performDefaults() {
fWorkingValues= JavaCore.getDefaultOptions();
updateControls();
super.performDefaults();
}
private String loadPreviewFile(String filename) {
String separator= System.getProperty("line.separator");
StringBuffer btxt= new StringBuffer(512);
BufferedReader rin= null;
try {
rin= new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(filename)));
String line;
while ((line= rin.readLine()) != null) {
btxt.append(line);
btxt.append(separator);
}
} catch (IOException io) {
JavaPlugin.log(io);
} finally {
if (rin != null) {
try { rin.close(); } catch (IOException e) {}
}
}
return btxt.toString();
}
private void updatePreview() {
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
ICodeFormatter formatter= ToolFactory.createDefaultCodeFormatter(fWorkingValues);
fPreviewDocument.set(formatter.format(fPreviewText, 0, null, "\n"));
}
private void updateControls() {
for (int i= fCheckBoxes.size() - 1; i >= 0; i--) {
Button curr= (Button) fCheckBoxes.get(i);
ControlData data= (ControlData) curr.getData();
String currValue= (String) fWorkingValues.get(data.getKey());
curr.setSelection(data.getSelection(currValue) == 0);
}
for (int i= fTextBoxes.size() - 1; i >= 0; i--) {
Text curr= (Text) fTextBoxes.get(i);
String key= (String) curr.getData();
String currValue= (String) fWorkingValues.get(key);
curr.setText(currValue);
}
}
private IStatus validatePositiveNumber(String number) {
StatusInfo status= new StatusInfo();
if (number.length() == 0) {
status.setError(JavaUIMessages.getString("CodeFormatterPreferencePage.empty_input"));
} else {
try {
int value= Integer.parseInt(number);
if (value < 0) {
status.setError(JavaUIMessages.getFormattedString("CodeFormatterPreferencePage.invalid_input", number));
|
17,295
|
Bug 17295 Formating pref page: remove the icons in the tabs
|
The icons add minimal value and we should remove them.
|
resolved fixed
|
e872c61
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-28T17:18:05Z
| 2002-05-23T13:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeFormatterPreferencePage.java
|
}
} catch (NumberFormatException e) {
status.setError(JavaUIMessages.getFormattedString("CodeFormatterPreferencePage.invalid_input", number));
}
}
return status;
}
private void updateStatus(IStatus status) {
if (!status.matches(IStatus.ERROR)) {
for (int i= 0; i < fTextBoxes.size(); i++) {
Text curr= (Text) fTextBoxes.get(i);
if (!(curr == fTabSizeTextBox && usesTabs())) {
IStatus currStatus= validatePositiveNumber(curr.getText());
status= StatusUtil.getMoreSevere(currStatus, status);
}
}
}
setValid(!status.matches(IStatus.ERROR));
StatusUtil.applyToStatusLine(this, status);
}
private boolean usesTabs() {
return TAB.equals(fWorkingValues.get(PREF_TAB_CHAR));
}
}
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.preferences;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Hashtable;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
import org.eclipse.jdt.internal.ui.util.TabFolderLayout;
/*
* The page for setting the compiler options.
*/
public class CompilerPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
private static final String PREF_LOCAL_VARIABLE_ATTR= JavaCore.COMPILER_LOCAL_VARIABLE_ATTR;
private static final String PREF_LINE_NUMBER_ATTR= JavaCore.COMPILER_LINE_NUMBER_ATTR;
private static final String PREF_SOURCE_FILE_ATTR= JavaCore.COMPILER_SOURCE_FILE_ATTR;
private static final String PREF_CODEGEN_UNUSED_LOCAL= JavaCore.COMPILER_CODEGEN_UNUSED_LOCAL;
private static final String PREF_CODEGEN_TARGET_PLATFORM= JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM;
private static final String PREF_PB_UNREACHABLE_CODE= JavaCore.COMPILER_PB_UNREACHABLE_CODE;
private static final String PREF_PB_INVALID_IMPORT= JavaCore.COMPILER_PB_INVALID_IMPORT;
private static final String PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD= JavaCore.COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD;
private static final String PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME= JavaCore.COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME;
private static final String PREF_PB_DEPRECATION= JavaCore.COMPILER_PB_DEPRECATION;
private static final String PREF_PB_HIDDEN_CATCH_BLOCK= JavaCore.COMPILER_PB_HIDDEN_CATCH_BLOCK;
private static final String PREF_PB_UNUSED_LOCAL= JavaCore.COMPILER_PB_UNUSED_LOCAL;
private static final String PREF_PB_UNUSED_PARAMETER= JavaCore.COMPILER_PB_UNUSED_PARAMETER;
private static final String PREF_PB_SYNTHETIC_ACCESS_EMULATION= JavaCore.COMPILER_PB_SYNTHETIC_ACCESS_EMULATION;
private static final String PREF_PB_NON_EXTERNALIZED_STRINGS= JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL;
private static final String PREF_PB_ASSERT_AS_IDENTIFIER= JavaCore.COMPILER_PB_ASSERT_IDENTIFIER;
private static final String PREF_PB_MAX_PER_UNIT= JavaCore.COMPILER_PB_MAX_PER_UNIT;
private static final String PREF_SOURCE_COMPATIBILITY= JavaCore.COMPILER_SOURCE;
private static final String PREF_COMPLIANCE= JavaCore.COMPILER_COMPLIANCE;
private static final String INTR_DEFAULT_COMPLIANCE= "internal.default.compliance";
private static final String GENERATE= JavaCore.GENERATE;
private static final String DO_NOT_GENERATE= JavaCore.DO_NOT_GENERATE;
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
private static final String PRESERVE= JavaCore.PRESERVE;
private static final String OPTIMIZE_OUT= JavaCore.OPTIMIZE_OUT;
private static final String VERSION_1_1= JavaCore.VERSION_1_1;
private static final String VERSION_1_2= JavaCore.VERSION_1_2;
private static final String VERSION_1_3= JavaCore.VERSION_1_3;
private static final String VERSION_1_4= JavaCore.VERSION_1_4;
private static final String ERROR= JavaCore.ERROR;
private static final String WARNING= JavaCore.WARNING;
private static final String IGNORE= JavaCore.IGNORE;
private static final String DEFAULT= "default";
private static final String USER= "user";
private static String[] getAllKeys() {
return new String[] {
PREF_LOCAL_VARIABLE_ATTR, PREF_LINE_NUMBER_ATTR, PREF_SOURCE_FILE_ATTR, PREF_CODEGEN_UNUSED_LOCAL,
PREF_CODEGEN_TARGET_PLATFORM, PREF_PB_UNREACHABLE_CODE, PREF_PB_INVALID_IMPORT, PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD,
PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME, PREF_PB_DEPRECATION, PREF_PB_HIDDEN_CATCH_BLOCK, PREF_PB_UNUSED_LOCAL,
PREF_PB_UNUSED_PARAMETER, PREF_PB_SYNTHETIC_ACCESS_EMULATION, PREF_PB_NON_EXTERNALIZED_STRINGS,
PREF_PB_ASSERT_AS_IDENTIFIER, PREF_SOURCE_COMPATIBILITY, PREF_COMPLIANCE, PREF_PB_MAX_PER_UNIT
};
}
/**
* Initializes the current options (read from preference store)
*/
public static void initDefaults(IPreferenceStore store) {
}
private static class ControlData {
private String fKey;
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
private String[] fValues;
public ControlData(String key, String[] values) {
fKey= key;
fValues= values;
}
public String getKey() {
return fKey;
}
public String getValue(boolean selection) {
int index= selection ? 0 : 1;
return fValues[index];
}
public String getValue(int index) {
return fValues[index];
}
public int getSelection(String value) {
for (int i= 0; i < fValues.length; i++) {
if (value.equals(fValues[i])) {
return i;
}
}
throw new IllegalArgumentException();
}
}
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
private Hashtable fWorkingValues;
private ArrayList fCheckBoxes;
private ArrayList fComboBoxes;
private ArrayList fTextBoxes;
private SelectionListener fSelectionListener;
private ModifyListener fTextModifyListener;
private ArrayList fComplianceControls;
public CompilerPreferencePage() {
setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore());
setDescription(JavaUIMessages.getString("CompilerPreferencePage.description"));
fWorkingValues= JavaCore.getOptions();
fWorkingValues.put(INTR_DEFAULT_COMPLIANCE, getCurrentCompliance());
fCheckBoxes= new ArrayList();
fComboBoxes= new ArrayList();
fTextBoxes= new ArrayList(2);
fComplianceControls= new ArrayList();
fSelectionListener= new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {}
public void widgetSelected(SelectionEvent e) {
controlChanged(e.widget);
}
};
fTextModifyListener= new ModifyListener() {
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
public void modifyText(ModifyEvent e) {
textChanged((Text) e.widget);
}
};
}
/**
* @see IWorkbenchPreferencePage#init()
*/
public void init(IWorkbench workbench) {
}
/**
* @see PreferencePage#createControl(Composite)
*/
public void createControl(Composite parent) {
super.createControl(parent);
WorkbenchHelp.setHelp(getControl(), IJavaHelpContextIds.COMPILER_PREFERENCE_PAGE);
}
/**
* @see PreferencePage#createContents(Composite)
*/
protected Control createContents(Composite parent) {
TabFolder folder= new TabFolder(parent, SWT.NONE);
folder.setLayout(new TabFolderLayout());
folder.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite warningsComposite= createWarningsTabContent(folder);
Composite codeGenComposite= createCodeGenTabContent(folder);
Composite complianceComposite= createComplianceTabContent(folder);
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
TabItem item= new TabItem(folder, SWT.NONE);
item.setText(JavaUIMessages.getString("CompilerPreferencePage.warnings.tabtitle"));
final Image errorWarningImage= JavaPluginImages.DESC_VIEW_ERRORWARNING_TAB.createImage();
item.setImage(errorWarningImage);
item.setControl(warningsComposite);
item= new TabItem(folder, SWT.NONE);
item.setText(JavaUIMessages.getString("CompilerPreferencePage.generation.tabtitle"));
final Image generationImage= JavaPluginImages.DESC_VIEW_CLASSFILEGENERATION_TAB.createImage();
item.setImage(generationImage);
item.setControl(codeGenComposite);
item= new TabItem(folder, SWT.NONE);
item.setText(JavaUIMessages.getString("CompilerPreferencePage.compliance.tabtitle"));
final Image jdkcomplianceImage= JavaPluginImages.DESC_VIEW_JDKCOMPLIANCE_TAB.createImage();
item.setImage(jdkcomplianceImage);
item.setControl(complianceComposite);
validateSettings(null, null);
folder.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
errorWarningImage.dispose();
generationImage.dispose();
jdkcomplianceImage.dispose();
}
});
return folder;
}
private Composite createWarningsTabContent(Composite folder) {
String[] errorWarningIgnore= new String[] { ERROR, WARNING, IGNORE };
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
String[] errorWarningIgnoreLabels= new String[] {
JavaUIMessages.getString("CompilerPreferencePage.error"),
JavaUIMessages.getString("CompilerPreferencePage.warning"),
JavaUIMessages.getString("CompilerPreferencePage.ignore")
};
GridLayout layout= new GridLayout();
layout.numColumns= 2;
Composite warningsComposite= new Composite(folder, SWT.NULL);
warningsComposite.setLayout(layout);
Label description= new Label(warningsComposite, SWT.WRAP);
description.setText(JavaUIMessages.getString("CompilerPreferencePage.warnings.description"));
GridData gd= new GridData();
gd.horizontalSpan= 2;
gd.widthHint= convertWidthInCharsToPixels(60);
description.setLayoutData(gd);
String label= JavaUIMessages.getString("CompilerPreferencePage.pb_unreachable_code.label");
addComboBox(warningsComposite, label, PREF_PB_UNREACHABLE_CODE, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_invalid_import.label");
addComboBox(warningsComposite, label, PREF_PB_INVALID_IMPORT, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_overriding_pkg_dflt.label");
addComboBox(warningsComposite, label, PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_method_naming.label");
addComboBox(warningsComposite, label, PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_deprecation.label");
addComboBox(warningsComposite, label, PREF_PB_DEPRECATION, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_hidden_catchblock.label");
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
addComboBox(warningsComposite, label, PREF_PB_HIDDEN_CATCH_BLOCK, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_unused_local.label");
addComboBox(warningsComposite, label, PREF_PB_UNUSED_LOCAL, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_unused_parameter.label");
addComboBox(warningsComposite, label, PREF_PB_UNUSED_PARAMETER, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_synth_access_emul.label");
addComboBox(warningsComposite, label, PREF_PB_SYNTHETIC_ACCESS_EMULATION, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_non_externalized_strings.label");
addComboBox(warningsComposite, label, PREF_PB_NON_EXTERNALIZED_STRINGS, errorWarningIgnore, errorWarningIgnoreLabels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.pb_max_per_unit.label");
addTextField(warningsComposite, label, PREF_PB_MAX_PER_UNIT);
return warningsComposite;
}
private Composite createCodeGenTabContent(Composite folder) {
String[] generateValues= new String[] { GENERATE, DO_NOT_GENERATE };
GridLayout layout= new GridLayout();
layout.numColumns= 2;
Composite codeGenComposite= new Composite(folder, SWT.NULL);
codeGenComposite.setLayout(layout);
String label= JavaUIMessages.getString("CompilerPreferencePage.variable_attr.label");
addCheckBox(codeGenComposite, label, PREF_LOCAL_VARIABLE_ATTR, generateValues, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.line_number_attr.label");
addCheckBox(codeGenComposite, label, PREF_LINE_NUMBER_ATTR, generateValues, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.source_file_attr.label");
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
addCheckBox(codeGenComposite, label, PREF_SOURCE_FILE_ATTR, generateValues, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.codegen_unused_local.label");
addCheckBox(codeGenComposite, label, PREF_CODEGEN_UNUSED_LOCAL, new String[] { PRESERVE, OPTIMIZE_OUT }, 0);
return codeGenComposite;
}
private Composite createComplianceTabContent(Composite folder) {
GridLayout layout= new GridLayout();
layout.numColumns= 2;
Composite complianceComposite= new Composite(folder, SWT.NULL);
complianceComposite.setLayout(layout);
String[] values34= new String[] { VERSION_1_3, VERSION_1_4 };
String[] values34Labels= new String[] {
JavaUIMessages.getString("CompilerPreferencePage.version13"),
JavaUIMessages.getString("CompilerPreferencePage.version14")
};
String label= JavaUIMessages.getString("CompilerPreferencePage.compiler_compliance.label");
addComboBox(complianceComposite, label, PREF_COMPLIANCE, values34, values34Labels, 0);
label= JavaUIMessages.getString("CompilerPreferencePage.default_settings.label");
addCheckBox(complianceComposite, label, INTR_DEFAULT_COMPLIANCE, new String[] { DEFAULT, USER }, 0);
int indent= convertWidthInCharsToPixels(2);
Control[] otherChildren= complianceComposite.getChildren();
String[] values14= new String[] { VERSION_1_1, VERSION_1_2, VERSION_1_3, VERSION_1_4 };
String[] values14Labels= new String[] {
JavaUIMessages.getString("CompilerPreferencePage.version11"),
JavaUIMessages.getString("CompilerPreferencePage.version12"),
JavaUIMessages.getString("CompilerPreferencePage.version13"),
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
JavaUIMessages.getString("CompilerPreferencePage.version14")
};
label= JavaUIMessages.getString("CompilerPreferencePage.codegen_targetplatform.label");
addComboBox(complianceComposite, label, PREF_CODEGEN_TARGET_PLATFORM, values14, values14Labels, indent);
label= JavaUIMessages.getString("CompilerPreferencePage.source_compatibility.label");
addComboBox(complianceComposite, label, PREF_SOURCE_COMPATIBILITY, values34, values34Labels, indent);
String[] errorWarningIgnore= new String[] { ERROR, WARNING, IGNORE };
String[] errorWarningIgnoreLabels= new String[] {
JavaUIMessages.getString("CompilerPreferencePage.error"),
JavaUIMessages.getString("CompilerPreferencePage.warning"),
JavaUIMessages.getString("CompilerPreferencePage.ignore")
};
label= JavaUIMessages.getString("CompilerPreferencePage.pb_assert_as_identifier.label");
addComboBox(complianceComposite, label, PREF_PB_ASSERT_AS_IDENTIFIER, errorWarningIgnore, errorWarningIgnoreLabels, indent);
Control[] allChildren= complianceComposite.getChildren();
fComplianceControls.addAll(Arrays.asList(allChildren));
fComplianceControls.removeAll(Arrays.asList(otherChildren));
return complianceComposite;
}
private void addCheckBox(Composite parent, String label, String key, String[] values, int indent) {
ControlData data= new ControlData(key, values);
GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan= 2;
gd.horizontalIndent= indent;
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
Button checkBox= new Button(parent, SWT.CHECK);
checkBox.setText(label);
checkBox.setData(data);
checkBox.setLayoutData(gd);
checkBox.addSelectionListener(fSelectionListener);
String currValue= (String)fWorkingValues.get(key);
checkBox.setSelection(data.getSelection(currValue) == 0);
fCheckBoxes.add(checkBox);
}
private void addComboBox(Composite parent, String label, String key, String[] values, String[] valueLabels, int indent) {
ControlData data= new ControlData(key, values);
GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
gd.horizontalIndent= indent;
Label labelControl= new Label(parent, SWT.LEFT | SWT.WRAP);
labelControl.setText(label);
labelControl.setLayoutData(gd);
Combo comboBox= new Combo(parent, SWT.READ_ONLY);
comboBox.setItems(valueLabels);
comboBox.setData(data);
comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
comboBox.addSelectionListener(fSelectionListener);
String currValue= (String)fWorkingValues.get(key);
comboBox.select(data.getSelection(currValue));
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
fComboBoxes.add(comboBox);
}
private Text addTextField(Composite parent, String label, String key) {
Label labelControl= new Label(parent, SWT.NONE);
labelControl.setText(label);
labelControl.setLayoutData(new GridData());
Text textBox= new Text(parent, SWT.BORDER | SWT.SINGLE | SWT.RIGHT);
textBox.setData(key);
textBox.setLayoutData(new GridData());
String currValue= (String) fWorkingValues.get(key);
textBox.setText(currValue);
textBox.setTextLimit(6);
textBox.addModifyListener(fTextModifyListener);
GridData gd= new GridData();
gd.widthHint= convertWidthInCharsToPixels(8);
textBox.setLayoutData(gd);
fTextBoxes.add(textBox);
return textBox;
}
private void controlChanged(Widget widget) {
ControlData data= (ControlData) widget.getData();
String newValue= null;
if (widget instanceof Button) {
newValue= data.getValue(((Button)widget).getSelection());
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
} else if (widget instanceof Combo) {
newValue= data.getValue(((Combo)widget).getSelectionIndex());
} else {
return;
}
fWorkingValues.put(data.getKey(), newValue);
validateSettings(data.getKey(), newValue);
}
private void textChanged(Text textControl) {
String key= (String) textControl.getData();
String number= textControl.getText();
fWorkingValues.put(key, number);
validateSettings(key, number);
}
private boolean checkValue(String key, String value) {
return value.equals(fWorkingValues.get(key));
}
/* (non-javadoc)
* Update fields and validate.
* @param changedKey Key that changed, or null, if all changed.
*/
private void validateSettings(String changedKey, String newValue) {
if (changedKey != null) {
if (INTR_DEFAULT_COMPLIANCE.equals(changedKey)) {
updateComplianceEnableState();
if (DEFAULT.equals(newValue)) {
updateComplianceDefaultSettings();
}
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
} else if (PREF_COMPLIANCE.equals(changedKey)) {
if (checkValue(INTR_DEFAULT_COMPLIANCE, DEFAULT)) {
updateComplianceDefaultSettings();
}
} else if (!PREF_SOURCE_COMPATIBILITY.equals(changedKey) &&
!PREF_CODEGEN_TARGET_PLATFORM.equals(changedKey) &&
!PREF_PB_ASSERT_AS_IDENTIFIER.equals(changedKey) &&
!PREF_PB_MAX_PER_UNIT.equals(changedKey)) {
return;
}
} else {
updateComplianceEnableState();
}
updateStatus(getValidation());
}
private IStatus getValidation() {
StatusInfo status= new StatusInfo();
if (checkValue(PREF_COMPLIANCE, VERSION_1_3)) {
if (checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_4)) {
status.setError(JavaUIMessages.getString("CompilerPreferencePage.cpl13src14.error"));
return status;
} else if (checkValue(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_4)) {
status.setError(JavaUIMessages.getString("CompilerPreferencePage.cpl13trg14.error"));
return status;
}
}
if (checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_4)) {
if (!checkValue(PREF_PB_ASSERT_AS_IDENTIFIER, ERROR)) {
status.setError(JavaUIMessages.getString("CompilerPreferencePage.src14asrterr.error"));
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
return status;
}
}
if (checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_4)) {
if (!checkValue(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_4)) {
status.setError(JavaUIMessages.getString("CompilerPreferencePage.src14tgt14.error"));
return status;
}
}
String maxNumberProblems= (String) fWorkingValues.get(PREF_PB_MAX_PER_UNIT);
return validatePositiveNumber(maxNumberProblems);
}
private IStatus validatePositiveNumber(String number) {
StatusInfo status= new StatusInfo();
if (number.length() == 0) {
status.setError(JavaUIMessages.getString("CompilerPreferencePage.empty_input"));
} else {
try {
int value= Integer.parseInt(number);
if (value <= 0) {
status.setError(JavaUIMessages.getFormattedString("CompilerPreferencePage.invalid_input", number));
}
} catch (NumberFormatException e) {
status.setError(JavaUIMessages.getFormattedString("CompilerPreferencePage.invalid_input", number));
}
}
return status;
}
/*
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
* Update the compliance controls' enable state
*/
private void updateComplianceEnableState() {
boolean enabled= checkValue(INTR_DEFAULT_COMPLIANCE, USER);
for (int i= fComplianceControls.size() - 1; i >= 0; i--) {
Control curr= (Control) fComplianceControls.get(i);
curr.setEnabled(enabled);
}
}
/*
* Set the default compliance values derived from the chosen level
*/
private void updateComplianceDefaultSettings() {
Object complianceLevel= fWorkingValues.get(PREF_COMPLIANCE);
if (VERSION_1_3.equals(complianceLevel)) {
fWorkingValues.put(PREF_PB_ASSERT_AS_IDENTIFIER, IGNORE);
fWorkingValues.put(PREF_SOURCE_COMPATIBILITY, VERSION_1_3);
fWorkingValues.put(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_1);
} else if (VERSION_1_4.equals(complianceLevel)) {
fWorkingValues.put(PREF_PB_ASSERT_AS_IDENTIFIER, ERROR);
fWorkingValues.put(PREF_SOURCE_COMPATIBILITY, VERSION_1_4);
fWorkingValues.put(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_4);
}
updateControls();
}
/*
* Evaluate if the current compliance setting correspond to a default setting
*/
private String getCurrentCompliance() {
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
Object complianceLevel= fWorkingValues.get(PREF_COMPLIANCE);
if ((VERSION_1_3.equals(complianceLevel)
&& checkValue(PREF_PB_ASSERT_AS_IDENTIFIER, IGNORE)
&& checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_3)
&& checkValue(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_1))
|| (VERSION_1_4.equals(complianceLevel)
&& checkValue(PREF_PB_ASSERT_AS_IDENTIFIER, ERROR)
&& checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_4)
&& checkValue(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_4))) {
return DEFAULT;
}
return USER;
}
/*
* @see IPreferencePage#performOk()
*/
public boolean performOk() {
String[] allKeys= getAllKeys();
Hashtable actualOptions= JavaCore.getOptions();
boolean hasChanges= false;
for (int i= 0; i < allKeys.length; i++) {
String key= allKeys[i];
String val= (String) fWorkingValues.get(key);
String oldVal= (String) actualOptions.get(key);
hasChanges= hasChanges | !val.equals(oldVal);
actualOptions.put(key, val);
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
}
if (hasChanges) {
String title= JavaUIMessages.getString("CompilerPreferencePage.needsbuild.title");
String message= JavaUIMessages.getString("CompilerPreferencePage.needsbuild.message");
MessageDialog dialog= new MessageDialog(getShell(), title, null, message, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 2);
int res= dialog.open();
if (res != 0 && res != 1) {
JavaPlugin.getDefault().savePluginPreferences();
return false;
}
JavaCore.setOptions(actualOptions);
if (res == 0) {
doFullBuild();
}
}
JavaPlugin.getDefault().savePluginPreferences();
return super.performOk();
}
public static boolean openQuestion(Shell parent, String title, String message) {
MessageDialog dialog= new MessageDialog(parent, title, null, message, MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 2);
return dialog.open() == 0;
}
private void doFullBuild() {
ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell());
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
try {
dialog.run(true, true, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
JavaPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
} catch (CoreException e) {
throw new InvocationTargetException(e);
}
}
});
} catch (InterruptedException e) {
} catch (InvocationTargetException e) {
String title= JavaUIMessages.getString("CompilerPreferencePage.builderror.title");
String message= JavaUIMessages.getString("CompilerPreferencePage.builderror.message");
ExceptionHandler.handle(e, getShell(), title, message);
}
}
/*
* @see PreferencePage#performDefaults()
*/
protected void performDefaults() {
fWorkingValues= JavaCore.getDefaultOptions();
fWorkingValues.put(INTR_DEFAULT_COMPLIANCE, getCurrentCompliance());
updateControls();
validateSettings(null, null);
super.performDefaults();
}
|
18,082
|
Bug 18082 compiler pref page is the only one with icons
|
the icons are pretty but i think we should remove them for consistency
|
resolved fixed
|
bb27a7f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T07:57:23Z
| 2002-05-28T18:20:00Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
|
private void updateControls() {
for (int i= fCheckBoxes.size() - 1; i >= 0; i--) {
Button curr= (Button) fCheckBoxes.get(i);
ControlData data= (ControlData) curr.getData();
String currValue= (String) fWorkingValues.get(data.getKey());
curr.setSelection(data.getSelection(currValue) == 0);
}
for (int i= fComboBoxes.size() - 1; i >= 0; i--) {
Combo curr= (Combo) fComboBoxes.get(i);
ControlData data= (ControlData) curr.getData();
String currValue= (String) fWorkingValues.get(data.getKey());
curr.select(data.getSelection(currValue));
}
for (int i= fTextBoxes.size() - 1; i >= 0; i--) {
Text curr= (Text) fTextBoxes.get(i);
String key= (String) curr.getData();
String currValue= (String) fWorkingValues.get(key);
curr.setText(currValue);
}
}
private void updateStatus(IStatus status) {
setValid(!status.matches(IStatus.ERROR));
StatusUtil.applyToStatusLine(this, status);
}
}
|
16,843
|
Bug 16843 Not present exception closing java editor that is outside classpath
|
Build 20020521 1. Create java project 'Proj' with source folder 'src' 2. Create folder 'p' directly under 'Proj' (i.e. outside build path) 3. Create file 'X.java' under 'Proj/p' 4. Open X.java in java editor 5. Close it Observe: You get the following message printed to the log: !ENTRY org.eclipse.jdt.ui 4 1 May 22, 2002 17:14:39.936 !MESSAGE Child not present !SUBENTRY 1 org.eclipse.jdt.core 4 969 May 22, 2002 17:14:39.936 !MESSAGE p does not exist.
|
verified fixed
|
2ae271f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T08:29:08Z
| 2002-05-22T15:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingContentProvider.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.browsing;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IResource;
import org.eclipse.swt.widgets.Control;
|
16,843
|
Bug 16843 Not present exception closing java editor that is outside classpath
|
Build 20020521 1. Create java project 'Proj' with source folder 'src' 2. Create folder 'p' directly under 'Proj' (i.e. outside build path) 3. Create file 'X.java' under 'Proj/p' 4. Open X.java in java editor 5. Close it Observe: You get the following message printed to the log: !ENTRY org.eclipse.jdt.ui 4 1 May 22, 2002 17:14:39.936 !MESSAGE Child not present !SUBENTRY 1 org.eclipse.jdt.core 4 969 May 22, 2002 17:14:39.936 !MESSAGE p does not exist.
|
verified fixed
|
2ae271f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T08:29:08Z
| 2002-05-22T15:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingContentProvider.java
|
import org.eclipse.swt.widgets.Display;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.IBasicPropertyConstants;
import org.eclipse.jface.viewers.ListViewer;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jdt.core.ElementChangedEvent;
import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IElementChangedListener;
import org.eclipse.jdt.core.IImportContainer;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaElementDelta;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IPackageDeclaration;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.IParent;
import org.eclipse.jdt.core.ISourceReference;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.IWorkingCopy;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.StandardJavaElementContentProvider;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.preferences.JavaBasePreferencePage;
class JavaBrowsingContentProvider extends StandardJavaElementContentProvider implements IElementChangedListener {
|
16,843
|
Bug 16843 Not present exception closing java editor that is outside classpath
|
Build 20020521 1. Create java project 'Proj' with source folder 'src' 2. Create folder 'p' directly under 'Proj' (i.e. outside build path) 3. Create file 'X.java' under 'Proj/p' 4. Open X.java in java editor 5. Close it Observe: You get the following message printed to the log: !ENTRY org.eclipse.jdt.ui 4 1 May 22, 2002 17:14:39.936 !MESSAGE Child not present !SUBENTRY 1 org.eclipse.jdt.core 4 969 May 22, 2002 17:14:39.936 !MESSAGE p does not exist.
|
verified fixed
|
2ae271f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T08:29:08Z
| 2002-05-22T15:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingContentProvider.java
|
private StructuredViewer fViewer;
private Object fInput;
private JavaBrowsingPart fBrowsingPart;
public JavaBrowsingContentProvider(boolean provideMembers, JavaBrowsingPart browsingPart) {
super(provideMembers, reconcileJavaViews());
fBrowsingPart= browsingPart;
fViewer= fBrowsingPart.getViewer();
JavaCore.addElementChangedListener(this);
}
private static boolean reconcileJavaViews() {
return JavaBasePreferencePage.reconcileJavaViews();
}
public Object[] getChildren(Object element) {
if (!exists(element))
return NO_CHILDREN;
try {
|
16,843
|
Bug 16843 Not present exception closing java editor that is outside classpath
|
Build 20020521 1. Create java project 'Proj' with source folder 'src' 2. Create folder 'p' directly under 'Proj' (i.e. outside build path) 3. Create file 'X.java' under 'Proj/p' 4. Open X.java in java editor 5. Close it Observe: You get the following message printed to the log: !ENTRY org.eclipse.jdt.ui 4 1 May 22, 2002 17:14:39.936 !MESSAGE Child not present !SUBENTRY 1 org.eclipse.jdt.core 4 969 May 22, 2002 17:14:39.936 !MESSAGE p does not exist.
|
verified fixed
|
2ae271f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T08:29:08Z
| 2002-05-22T15:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingContentProvider.java
|
if (element instanceof Collection) {
Collection elements= (Collection)element;
if (elements.isEmpty())
return NO_CHILDREN;
Object[] result= new Object[0];
Iterator iter= ((Collection)element).iterator();
while (iter.hasNext()) {
Object[] children= getChildren(iter.next());
if (children != NO_CHILDREN)
result= concatenate(result, children);
}
return result;
}
if (element instanceof IPackageFragment)
return getPackageContents((IPackageFragment)element);
if (fProvideMembers && element instanceof IType)
return getChildren((IType)element);
if (fProvideMembers && element instanceof ISourceReference && element instanceof IParent)
return removeImportAndPackageDeclarations(super.getChildren(element));
if (element instanceof IJavaProject)
return getPackageFragmentRoots((IJavaProject)element);
return super.getChildren(element);
} catch (JavaModelException e) {
return NO_CHILDREN;
}
}
private Object[] getPackageContents(IPackageFragment fragment) throws JavaModelException {
ISourceReference[] sourceRefs;
if (fragment.getKind() == IPackageFragmentRoot.K_SOURCE) {
sourceRefs= fragment.getCompilationUnits();
|
16,843
|
Bug 16843 Not present exception closing java editor that is outside classpath
|
Build 20020521 1. Create java project 'Proj' with source folder 'src' 2. Create folder 'p' directly under 'Proj' (i.e. outside build path) 3. Create file 'X.java' under 'Proj/p' 4. Open X.java in java editor 5. Close it Observe: You get the following message printed to the log: !ENTRY org.eclipse.jdt.ui 4 1 May 22, 2002 17:14:39.936 !MESSAGE Child not present !SUBENTRY 1 org.eclipse.jdt.core 4 969 May 22, 2002 17:14:39.936 !MESSAGE p does not exist.
|
verified fixed
|
2ae271f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T08:29:08Z
| 2002-05-22T15:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingContentProvider.java
|
if (getProvideWorkingCopy()) {
for (int i= 0; i < sourceRefs.length; i++) {
IWorkingCopy wc= EditorUtility.getWorkingCopy((ICompilationUnit)sourceRefs[i]);
if (wc != null)
sourceRefs[i]= (ICompilationUnit)wc;
}
}
}
else {
IClassFile[] classFiles= fragment.getClassFiles();
List topLevelClassFile= new ArrayList();
for (int i= 0; i < classFiles.length; i++) {
IType type= classFiles[i].getType();
if (type != null && type.getDeclaringType() == null)
topLevelClassFile.add(classFiles[i]);
}
sourceRefs= (ISourceReference[])topLevelClassFile.toArray(new ISourceReference[topLevelClassFile.size()]);
}
Object[] result= new Object[0];
for (int i= 0; i < sourceRefs.length; i++)
result= concatenate(result, removeImportAndPackageDeclarations(getChildren(sourceRefs[i])));
return concatenate(result, fragment.getNonJavaResources());
}
private Object[] removeImportAndPackageDeclarations(Object[] members) {
ArrayList tempResult= new ArrayList(members.length);
for (int i= 0; i < members.length; i++)
if (!(members[i] instanceof IImportContainer) && !(members[i] instanceof IPackageDeclaration))
tempResult.add(members[i]);
return tempResult.toArray();
}
|
16,843
|
Bug 16843 Not present exception closing java editor that is outside classpath
|
Build 20020521 1. Create java project 'Proj' with source folder 'src' 2. Create folder 'p' directly under 'Proj' (i.e. outside build path) 3. Create file 'X.java' under 'Proj/p' 4. Open X.java in java editor 5. Close it Observe: You get the following message printed to the log: !ENTRY org.eclipse.jdt.ui 4 1 May 22, 2002 17:14:39.936 !MESSAGE Child not present !SUBENTRY 1 org.eclipse.jdt.core 4 969 May 22, 2002 17:14:39.936 !MESSAGE p does not exist.
|
verified fixed
|
2ae271f
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2002-05-29T08:29:08Z
| 2002-05-22T15:06:40Z
|
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingContentProvider.java
|
private Object[] getChildren(IType type) throws JavaModelException{
IParent parent;
if (type.isBinary())
parent= type.getClassFile();
else {
parent= type.getCompilationUnit();
if (getProvideWorkingCopy()) {
IWorkingCopy wc= EditorUtility.getWorkingCopy((ICompilationUnit)parent);
if (wc != null) {
parent= (IParent)wc;
IMember wcType= EditorUtility.getWorkingCopy(type);
if (wcType != null)
type= (IType)wcType;
}
}
}
if (type.getDeclaringType() != null)
return type.getChildren();
IJavaElement[] members= parent.getChildren();
ArrayList tempResult= new ArrayList(members.length);
for (int i= 0; i < members.length; i++)
if ((members[i] instanceof IImportContainer))
tempResult.add(members[i]);
tempResult.addAll(Arrays.asList(type.getChildren()));
return tempResult.toArray();
}
private Object[] getPackageFragmentRoots(IJavaProject project) throws JavaModelException {
if (!project.getProject().isOpen())
return NO_CHILDREN;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.