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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
private VariableSelectionBlock fVariableSelectionBlock;
public VariableSelectionDialog(Shell parent, List existingPaths) {
super(parent);
setTitle(NewWizardMessages.getString("LibrariesWorkbookPage.VariableSelectionDialog.title"));
String initVar= fDialogSettings.get(IUIConstants.DIALOGSTORE_LASTVARIABLE);
fVariableSelectionBlock= new VariableSelectionBlock(this, existingPaths, null, initVar, false);
}
/*
* @see Windows#configureShell
*/
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
WorkbenchHelp.setHelp(newShell, new Object[] { IJavaHelpContextIds.VARIABLE_SELECTION_DIALOG });
}
/*
* @see StatusDialog#createDialogArea()
*/
protected Control createDialogArea(Composite parent) {
Composite composite= (Composite)super.createDialogArea(parent);
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
Label message= new Label(composite, SWT.WRAP);
message.setText(NewWizardMessages.getString("LibrariesWorkbookPage.VariableSelectionDialog.message"));
message.setLayoutData(new GridData());
Control inner= fVariableSelectionBlock.createControl(composite);
inner.setLayoutData(new GridData(GridData.FILL_BOTH));
return composite;
}
/*
* @see Dialog#okPressed()
*/
protected void okPressed() {
fDialogSettings.put(IUIConstants.DIALOGSTORE_LASTVARIABLE, getVariable().segment(0));
super.okPressed();
}
/*
* @see IStatusChangeListener#statusChanged()
*/
public void statusChanged(IStatus status) {
updateStatus(status);
}
public IPath getVariable() {
return fVariableSelectionBlock.getVariablePath();
}
}
private class SourceAttachmentDialog extends StatusDialog implements IStatusChangeListener {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
private SourceAttachmentBlock fSourceAttachmentBlock;
public SourceAttachmentDialog(Shell parent, IClasspathEntry entry) {
super(parent);
setTitle(NewWizardMessages.getFormattedString("LibrariesWorkbookPage.SourceAttachmentDialog.title", entry.getPath().toString()));
fSourceAttachmentBlock= new SourceAttachmentBlock(fWorkspaceRoot, this, entry);
}
/*
* @see Windows#configureShell
*/
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
WorkbenchHelp.setHelp(newShell, new Object[] { IJavaHelpContextIds.SOURCE_ATTACHMENT_DIALOG });
}
protected Control createDialogArea(Composite parent) {
Composite composite= (Composite)super.createDialogArea(parent);
Control inner= fSourceAttachmentBlock.createControl(composite);
inner.setLayoutData(new GridData(GridData.FILL_BOTH));
return composite;
}
public void statusChanged(IStatus status) {
updateStatus(status);
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
|
public IPath getSourceAttachmentPath() {
return fSourceAttachmentBlock.getSourceAttachmentPath();
}
public IPath getSourceAttachmentRootPath() {
return fSourceAttachmentBlock.getSourceAttachmentRootPath();
}
}
/*
* @see BuildPathBasePage#getSelection
*/
public List getSelection() {
return fLibrariesList.getSelectedElements();
}
/*
* @see BuildPathBasePage#setSelection
*/
public void setSelection(List selElements) {
for (int i= selElements.size()-1; i >= 0; i--) {
CPListElement curr= (CPListElement) selElements.get(i);
int kind= curr.getEntryKind();
if (kind != IClasspathEntry.CPE_LIBRARY && kind != IClasspathEntry.CPE_VARIABLE) {
selElements.remove(i);
}
}
fLibrariesList.selectElements(new StructuredSelection(selElements));
}
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ProjectsWorkbookPage.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.wizards.buildpaths;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaModel;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.util.SWTUtil;
import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.CheckedListDialogField;
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.LayoutUtil;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField;
public class ProjectsWorkbookPage extends BuildPathBasePage {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ProjectsWorkbookPage.java
|
private ListDialogField fClassPathList;
private IJavaProject fCurrJProject;
private CheckedListDialogField fProjectsList;
public ProjectsWorkbookPage(ListDialogField classPathList) {
fClassPathList= classPathList;
ProjectsListListener listener= new ProjectsListListener();
String[] buttonLabels= new String[] {
NewWizardMessages.getString("ProjectsWorkbookPage.projects.checkall.button"),
NewWizardMessages.getString("ProjectsWorkbookPage.projects.uncheckall.button")
};
fProjectsList= new CheckedListDialogField(null, buttonLabels, new CPListLabelProvider());
fProjectsList.setDialogFieldListener(listener);
fProjectsList.setLabelText(NewWizardMessages.getString("ProjectsWorkbookPage.projects.label"));
fProjectsList.setCheckAllButtonIndex(0);
fProjectsList.setUncheckAllButtonIndex(1);
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ProjectsWorkbookPage.java
|
public void init(IJavaProject jproject) {
updateProjectsList(jproject);
}
private void updateProjectsList(IJavaProject currJProject) {
try {
IJavaModel jmodel= currJProject.getJavaModel();
IJavaProject[] jprojects= jmodel.getJavaProjects();
List projects= new ArrayList(jprojects.length);
List existingProjects= new ArrayList(jprojects.length);
existingProjects.add(currJProject.getProject());
final List checkedProjects= new ArrayList(jprojects.length);
List cpelements= fClassPathList.getElements();
for (int i= cpelements.size() - 1 ; i >= 0; i--) {
CPListElement cpelem= (CPListElement)cpelements.get(i);
if (cpelem.getEntryKind() == IClasspathEntry.CPE_PROJECT) {
existingProjects.add(cpelem.getResource());
projects.add(cpelem);
checkedProjects.add(cpelem);
}
}
for (int i= 0; i < jprojects.length; i++) {
IProject proj= jprojects[i].getProject();
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ProjectsWorkbookPage.java
|
if (!existingProjects.contains(proj)) {
projects.add(new CPListElement(IClasspathEntry.CPE_PROJECT, proj.getFullPath(), proj));
}
}
fProjectsList.setElements(projects);
fProjectsList.setCheckedElements(checkedProjects);
} catch (JavaModelException e) {
fProjectsList.setElements(new ArrayList(5));
}
fCurrJProject= currJProject;
}
public Control getControl(Composite parent) {
Composite composite= new Composite(parent, SWT.NONE);
LayoutUtil.doDefaultLayout(composite, new DialogField[] { fProjectsList }, true, 0, 0, SWT.DEFAULT, SWT.DEFAULT);
int buttonBarWidth= SWTUtil.convertWidthInCharsToPixels(24, composite);
fProjectsList.setButtonsMinWidth(buttonBarWidth);
fProjectsList.getTableViewer().setSorter(new CPListElementSorter());
return composite;
}
private class ProjectsListListener implements IDialogFieldListener {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ProjectsWorkbookPage.java
|
public void dialogFieldChanged(DialogField field) {
if (fCurrJProject != null) {
updateClasspathList();
}
}
}
private void updateClasspathList() {
List projelements= fProjectsList.getCheckedElements();
boolean remove= false;
List cpelements= fClassPathList.getElements();
for (int i= cpelements.size() -1; i >= 0 ; i--) {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ProjectsWorkbookPage.java
|
CPListElement cpe= (CPListElement)cpelements.get(i);
if (cpe.getEntryKind() == IClasspathEntry.CPE_PROJECT) {
if (!projelements.remove(cpe)) {
cpelements.remove(i);
remove= true;
}
}
}
for (int i= 0; i < projelements.size(); i++) {
cpelements.add(projelements.get(i));
}
if (remove || (projelements.size() > 0)) {
fClassPathList.setElements(cpelements);
}
}
/*
* @see BuildPathBasePage#getSelection
*/
public List getSelection() {
return fProjectsList.getSelectedElements();
}
/*
* @see BuildPathBasePage#setSelection
*/
public void setSelection(List selElements) {
filterSelection(selElements, IClasspathEntry.CPE_PROJECT);
fProjectsList.selectElements(new StructuredSelection(selElements));
}
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceContainerWorkbookPage.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.wizards.buildpaths;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.jdt.core.IClasspathEntry;
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceContainerWorkbookPage.java
|
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.jdt.internal.ui.dialogs.ISelectionValidator;
import org.eclipse.jdt.internal.ui.util.SWTUtil;
import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
import org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator;
import org.eclipse.jdt.internal.ui.wizards.TypedViewerFilter;
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.ListDialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField;
import org.eclipse.jdt.internal.ui.wizards.swt.MGridData;
import org.eclipse.jdt.internal.ui.wizards.swt.MGridLayout;
public class SourceContainerWorkbookPage extends BuildPathBasePage {
private ListDialogField fClassPathList;
private IJavaProject fCurrJProject;
private IPath fProjPath;
private Control fSWTControl;
private IWorkspaceRoot fWorkspaceRoot;
private SelectionButtonDialogField fProjectRadioButton;
private SelectionButtonDialogField fFolderRadioButton;
private ListDialogField fFoldersList;
private CPListElement fProjectCPEntry;
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceContainerWorkbookPage.java
|
private StringDialogField fOutputLocationField;
private boolean fIsProjSelected;
public SourceContainerWorkbookPage(IWorkspaceRoot root, ListDialogField classPathList, StringDialogField outputLocationField, boolean isNewProject) {
fWorkspaceRoot= root;
fClassPathList= classPathList;
fProjectCPEntry= null;
fOutputLocationField= outputLocationField;
fSWTControl= null;
SourceContainerAdapter adapter= new SourceContainerAdapter();
fProjectRadioButton= new SelectionButtonDialogField(SWT.RADIO);
fProjectRadioButton.setDialogFieldListener(adapter);
fProjectRadioButton.setLabelText(NewWizardMessages.getString("SourceContainerWorkbookPage.rb1.label"));
fFolderRadioButton= new SelectionButtonDialogField(SWT.RADIO);
fFolderRadioButton.setDialogFieldListener(adapter);
fFolderRadioButton.setLabelText(NewWizardMessages.getString("SourceContainerWorkbookPage.rb2.label"));
String[] buttonLabels;
int removeIndex;
if (isNewProject) {
buttonLabels= new String[] {
NewWizardMessages.getString("SourceContainerWorkbookPage.folders.addnew.button"),
null,
NewWizardMessages.getString("SourceContainerWorkbookPage.folders.remove.button")
};
removeIndex= 2;
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceContainerWorkbookPage.java
|
} else {
buttonLabels= new String[] {
NewWizardMessages.getString("SourceContainerWorkbookPage.folders.addnew.button"),
NewWizardMessages.getString("SourceContainerWorkbookPage.folders.addnew.addexisting.button"),
null,
NewWizardMessages.getString("SourceContainerWorkbookPage.folders.remove.button")
};
removeIndex= 3;
}
fFoldersList= new ListDialogField(adapter, buttonLabels, new CPListLabelProvider());
fFoldersList.setDialogFieldListener(adapter);
fFoldersList.setLabelText(NewWizardMessages.getString("SourceContainerWorkbookPage.folders.label"));
fFoldersList.setRemoveButtonIndex(removeIndex);
fFolderRadioButton.attachDialogField(fFoldersList);
}
public void init(IJavaProject jproject) {
fCurrJProject= jproject;
fProjPath= fCurrJProject.getProject().getFullPath();
updateFoldersList();
}
private void updateFoldersList() {
fIsProjSelected= false;
List srcelements= new ArrayList(fClassPathList.getSize());
List cpelements= fClassPathList.getElements();
for (int i= 0; i < cpelements.size(); i++) {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceContainerWorkbookPage.java
|
CPListElement cpe= (CPListElement)cpelements.get(i);
if (cpe.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
if (fProjPath.equals(cpe.getPath())) {
srcelements.clear();
fProjectCPEntry= cpe;
fIsProjSelected= true;
break;
} else {
srcelements.add(cpe);
}
}
}
fFoldersList.setElements(srcelements);
fFolderRadioButton.setSelection(!fIsProjSelected);
fProjectRadioButton.setSelection(fIsProjSelected);
}
public Control getControl(Composite parent) {
Composite composite= new Composite(parent, SWT.NONE);
MGridLayout layout= new MGridLayout();
layout.minimumWidth= SWTUtil.convertWidthInCharsToPixels(80, composite);
layout.numColumns= 2;
composite.setLayout(layout);
fProjectRadioButton.doFillIntoGrid(composite, 2);
fFolderRadioButton.doFillIntoGrid(composite, 2);
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceContainerWorkbookPage.java
|
Control control= fFoldersList.getListControl(composite);
MGridData gd= new MGridData(MGridData.FILL_BOTH);
gd.horizontalIndent= SWTUtil.convertWidthInCharsToPixels(2, composite);
gd.widthHint= SWTUtil.convertWidthInCharsToPixels(75, composite);
gd.heightHint= SWTUtil.convertWidthInCharsToPixels(15, composite);
control.setLayoutData(gd);
control= fFoldersList.getButtonBox(composite);
gd= new MGridData(gd.VERTICAL_ALIGN_FILL + gd.HORIZONTAL_ALIGN_FILL);
control.setLayoutData(gd);
int buttonBarWidth= SWTUtil.convertWidthInCharsToPixels(24, composite);
fFoldersList.setButtonsMinWidth(buttonBarWidth);
fFoldersList.getTableViewer().setSorter(new CPListElementSorter());
fSWTControl= composite;
return composite;
}
private Shell getShell() {
if (fSWTControl != null) {
return fSWTControl.getShell();
}
return JavaPlugin.getActiveWorkbenchShell();
}
private class SourceContainerAdapter implements IListAdapter, IDialogFieldListener {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceContainerWorkbookPage.java
|
public void customButtonPressed(DialogField field, int index) {
sourcePageCustomButtonPressed(field, index);
}
public void selectionChanged(DialogField field) {}
public void dialogFieldChanged(DialogField field) {
sourcePageDialogFieldChanged(field);
}
}
private void sourcePageCustomButtonPressed(DialogField field, int index) {
if (field == fFoldersList) {
List elementsToAdd= new ArrayList(10);
switch (index) {
case 0:
CPListElement srcentry= createNewSourceContainer();
if (srcentry != null) {
elementsToAdd.add(srcentry);
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceContainerWorkbookPage.java
|
}
break;
case 1:
CPListElement[] srcentries= chooseSourceContainers();
if (srcentries != null) {
for (int i= 0; i < srcentries.length; i++) {
elementsToAdd.add(srcentries[i]);
}
}
break;
}
if (!elementsToAdd.isEmpty()) {
fFoldersList.addElements(elementsToAdd);
fFoldersList.postSetSelection(new StructuredSelection(elementsToAdd));
if (fFoldersList.getSize() == elementsToAdd.size()) {
askForChangingBuildPathDialog();
}
}
}
}
private void sourcePageDialogFieldChanged(DialogField field) {
if (fCurrJProject == null) {
return;
}
if (field == fFolderRadioButton) {
if (fFolderRadioButton.isSelected()) {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceContainerWorkbookPage.java
|
fIsProjSelected= false;
updateClasspathList();
if (fFoldersList.getSize() > 0) {
askForChangingBuildPathDialog();
}
}
} else if (field == fProjectRadioButton) {
if (fProjectRadioButton.isSelected()) {
fIsProjSelected= true;
updateClasspathList();
}
} else if (field == fFoldersList) {
updateClasspathList();
}
}
private void updateClasspathList() {
List cpelements= fClassPathList.getElements();
List srcelements;
if (fIsProjSelected) {
srcelements= new ArrayList(1);
if (fProjectCPEntry == null) {
fProjectCPEntry= newCPSourceElement(fCurrJProject.getProject());
}
srcelements.add(fProjectCPEntry);
} else {
srcelements= fFoldersList.getElements();
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceContainerWorkbookPage.java
|
}
boolean changeDone= false;
for (int i= cpelements.size() - 1; i >= 0 ; i--) {
CPListElement cpe= (CPListElement)cpelements.get(i);
if (cpe.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
if (!srcelements.remove(cpe)) {
cpelements.remove(i);
changeDone= true;
}
}
}
for (int i= 0; i < srcelements.size(); i++) {
cpelements.add(srcelements.get(i));
}
if (changeDone || (srcelements.size() > 0)) {
fClassPathList.setElements(cpelements);
}
}
private CPListElement createNewSourceContainer() {
IProject proj= fCurrJProject.getProject();
String title= NewWizardMessages.getString("SourceContainerWorkbookPage.NewSourceFolderDialog.title");
NewContainerDialog dialog= new NewContainerDialog(getShell(), title, proj, getExistingContainers());
dialog.setMessage(NewWizardMessages.getFormattedString("SourceContainerWorkbookPage.NewSourceFolderDialog.description", fProjPath.toString()));
if (dialog.open() == dialog.OK) {
IFolder folder= dialog.getFolder();
return newCPSourceElement(folder);
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceContainerWorkbookPage.java
|
}
return null;
}
/**
* Asks to change the output folder to 'proj/bin' when no source folders were existing
*/
private void askForChangingBuildPathDialog() {
IPath outputFolder= new Path(fOutputLocationField.getText());
if (outputFolder.segmentCount() == 1) {
IPath newPath= outputFolder.append("bin");
String title= NewWizardMessages.getString("SourceContainerWorkbookPage.ChangeOutputLocationDialog.title");
String message= NewWizardMessages.getFormattedString("SourceContainerWorkbookPage.ChangeOutputLocationDialog.message", newPath);
if (MessageDialog.openQuestion(getShell(), title, message)) {
fOutputLocationField.setText(newPath.toString());
}
}
}
private CPListElement[] chooseSourceContainers() {
Class[] acceptedClasses= new Class[] { IFolder.class };
ISelectionValidator validator= new TypedElementSelectionValidator(acceptedClasses, true);
acceptedClasses= new Class[] { IFolder.class };
ViewerFilter filter= new TypedViewerFilter(acceptedClasses, getExistingContainers());
ILabelProvider lp= new WorkbenchLabelProvider();
ITreeContentProvider cp= new WorkbenchContentProvider();
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceContainerWorkbookPage.java
|
ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(getShell(), lp, cp);
dialog.setValidator(validator);
dialog.setTitle(NewWizardMessages.getString("SourceContainerWorkbookPage.ExistingSourceFolderDialog.title"));
dialog.setMessage(NewWizardMessages.getString("SourceContainerWorkbookPage.ExistingSourceFolderDialog.description"));
dialog.addFilter(filter);
dialog.setInput(fCurrJProject.getProject());
if (dialog.open() == dialog.OK) {
Object[] elements= dialog.getResult();
CPListElement[] res= new CPListElement[elements.length];
for (int i= 0; i < res.length; i++) {
IResource elem= (IResource)elements[i];
res[i]= newCPSourceElement(elem);
}
return res;
}
return null;
}
private IContainer[] getExistingContainers() {
List res= new ArrayList();
List cplist= fFoldersList.getElements();
for (int i= 0; i < cplist.size(); i++) {
CPListElement elem= (CPListElement)cplist.get(i);
IResource resource= elem.getResource();
if (resource instanceof IContainer) {
res.add(resource);
}
}
return (IContainer[]) res.toArray(new IContainer[res.size()]);
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceContainerWorkbookPage.java
|
private CPListElement newCPSourceElement(IResource res) {
Assert.isNotNull(res);
return new CPListElement(IClasspathEntry.CPE_SOURCE, res.getFullPath(), res);
}
/*
* @see BuildPathBasePage#getSelection
*/
public List getSelection() {
if (fIsProjSelected) {
ArrayList list= new ArrayList(1);
list.add(fProjectCPEntry);
return list;
} else {
return fFoldersList.getSelectedElements();
}
}
/*
* @see BuildPathBasePage#setSelection
*/
public void setSelection(List selElements) {
if (!fIsProjSelected) {
filterSelection(selElements, IClasspathEntry.CPE_SOURCE);
fFoldersList.selectElements(new StructuredSelection(selElements));
}
}
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.wizards.buildpaths;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
import java.util.List;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
import org.eclipse.jdt.internal.ui.util.SWTUtil;
import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
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;
public class VariableBlock {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
private ListDialogField fVariablesList;
private StatusInfo fSelectionStatus;
private IStatusChangeListener fContext;
private boolean fUseAsSelectionDialog;
private boolean fRemovingSelection= false;
private String fSelectedVariable;
private Control fControl;
/**
* Constructor for VariableBlock
*/
public VariableBlock(IStatusChangeListener context, boolean useAsSelectionDialog, String initSelection) {
fContext= context;
fUseAsSelectionDialog= useAsSelectionDialog;
fSelectionStatus= new StatusInfo();
String[] buttonLabels= new String[] {
NewWizardMessages.getString("VariableBlock.vars.add.button"),
NewWizardMessages.getString("VariableBlock.vars.edit.button"),
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
null,
NewWizardMessages.getString("VariableBlock.vars.remove.button")
};
VariablesAdapter adapter= new VariablesAdapter();
CPVariableElementLabelProvider labelProvider= new CPVariableElementLabelProvider(useAsSelectionDialog);
fVariablesList= new ListDialogField(adapter, buttonLabels, labelProvider);
fVariablesList.setDialogFieldListener(adapter);
fVariablesList.setLabelText(NewWizardMessages.getString("VariableBlock.vars.label"));
fVariablesList.setRemoveButtonIndex(3);
fVariablesList.enableButton(1, false);
CPVariableElement initSelectedElement= null;
String[] reservedName= getReservedVariableNames();
ArrayList reserved= new ArrayList(reservedName.length);
addAll(reservedName, reserved);
String[] entries= JavaCore.getClasspathVariableNames();
ArrayList elements= new ArrayList(entries.length);
for (int i= 0; i < entries.length; i++) {
String name= entries[i];
CPVariableElement elem;
IPath entryPath= JavaCore.getClasspathVariable(name);
elem= new CPVariableElement(name, entryPath, reserved.contains(name));
elements.add(elem);
if (name.equals(initSelection)) {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
initSelectedElement= elem;
}
}
fVariablesList.setElements(elements);
ISelection sel;
if (initSelectedElement != null) {
sel= new StructuredSelection(initSelectedElement);
} else if (entries.length > 0) {
sel= new StructuredSelection(fVariablesList.getElement(0));
} else {
sel= StructuredSelection.EMPTY;
}
fVariablesList.selectElements(sel);
}
private String[] getReservedVariableNames() {
return new String[] {
JavaRuntime.JRELIB_VARIABLE,
JavaRuntime.JRESRC_VARIABLE,
JavaRuntime.JRESRCROOT_VARIABLE,
};
}
public Control createContents(Composite parent) {
Composite composite= new Composite(parent, SWT.NONE);
int minimalWidth= SWTUtil.convertWidthInCharsToPixels(80, composite);
int minimalHeight= SWTUtil.convertHeightInCharsToPixels(20, composite);
LayoutUtil.doDefaultLayout(composite, new DialogField[] { fVariablesList }, true, minimalWidth, minimalHeight, 0, 0);
fVariablesList.getTableViewer().setSorter(new ViewerSorter() {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
public int compare(Viewer viewer, Object e1, Object e2) {
if (e1 instanceof CPVariableElement && e2 instanceof CPVariableElement) {
return ((CPVariableElement)e1).getName().compareTo(((CPVariableElement)e2).getName());
}
return super.compare(viewer, e1, e2);
}
});
fControl= composite;
return composite;
}
public void addDoubleClickListener(IDoubleClickListener listener) {
fVariablesList.getTableViewer().addDoubleClickListener(listener);
}
private Shell getShell() {
if (fControl != null) {
return fControl.getShell();
}
return JavaPlugin.getActiveWorkbenchShell();
}
public String getSelectedVariable() {
return fSelectedVariable;
}
private class VariablesAdapter implements IDialogFieldListener, IListAdapter {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
public void customButtonPressed(DialogField field, int index) {
switch (index) {
case 0:
editEntries(null);
break;
case 1:
List selected= fVariablesList.getSelectedElements();
editEntries((CPVariableElement)selected.get(0));
break;
}
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
public void selectionChanged(DialogField field) {
doSelectionChanged(field);
}
public void dialogFieldChanged(DialogField field) {
}
}
private boolean containsReserved(List selected) {
for (int i= selected.size()-1; i >= 0; i--) {
if (((CPVariableElement)selected.get(i)).isReserved()) {
return true;
}
}
return false;
}
private static void addAll(Object[] objs, Collection dest) {
for (int i= 0; i < objs.length; i++) {
dest.add(objs[i]);
}
}
private void doSelectionChanged(DialogField field) {
List selected= fVariablesList.getSelectedElements();
boolean isSingleSelected= selected.size() == 1;
boolean containsReserved= containsReserved(selected);
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
fVariablesList.enableButton(1, isSingleSelected && !containsReserved);
fVariablesList.enableButton(3, !containsReserved);
fSelectedVariable= null;
if (fUseAsSelectionDialog) {
if (isSingleSelected) {
fSelectionStatus.setOK();
fSelectedVariable= ((CPVariableElement)selected.get(0)).getName();
} else {
fSelectionStatus.setError("");
}
fContext.statusChanged(fSelectionStatus);
}
}
private void editEntries(CPVariableElement entry) {
List existingEntries= fVariablesList.getElements();
VariableCreationDialog dialog= new VariableCreationDialog(getShell(), entry, existingEntries);
if (dialog.open() != dialog.OK) {
return;
}
CPVariableElement newEntry= dialog.getClasspathElement();
if (entry == null) {
fVariablesList.addElement(newEntry);
entry= newEntry;
} else {
entry.setName(newEntry.getName());
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
entry.setPath(newEntry.getPath());
fVariablesList.refresh();
}
fVariablesList.selectElements(new StructuredSelection(entry));
}
public void performDefaults() {
fVariablesList.removeAllElements();
String[] reservedName= getReservedVariableNames();
for (int i= 0; i < reservedName.length; i++) {
CPVariableElement elem= new CPVariableElement(reservedName[i], null, true);
elem.setReserved(true);
fVariablesList.addElement(elem);
}
}
public boolean performOk() {
List toRemove= new ArrayList();
toRemove.addAll(Arrays.asList(JavaCore.getClasspathVariableNames()));
List elements= fVariablesList.getElements();
for (int i= elements.size()-1; i >= 0; i--) {
CPVariableElement curr= (CPVariableElement) elements.get(i);
if (curr.isReserved()) {
elements.remove(curr);
} else {
IPath path= curr.getPath();
IPath prevPath= JavaCore.getClasspathVariable(curr.getName());
if (prevPath != null && prevPath.equals(path)) {
elements.remove(curr);
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
}
toRemove.remove(curr.getName());
}
int steps= elements.size() + toRemove.size();
if (steps > 0) {
IRunnableWithProgress runnable= new VariableBlockRunnable(toRemove, elements);
ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell());
try {
dialog.run(true, true, runnable);
} catch (InvocationTargetException e) {
ExceptionHandler.handle(e, getShell(), NewWizardMessages.getString("VariableBlock.operation_errror.title"), NewWizardMessages.getString("VariableBlock.operation_errror.message"));
return false;
} catch (InterruptedException e) {
return true;
}
}
return true;
}
private class VariableBlockRunnable implements IRunnableWithProgress {
private List fToRemove;
private List fToChange;
public VariableBlockRunnable(List toRemove, List toChange) {
fToRemove= toRemove;
fToChange= toChange;
}
/*
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
|
* @see IRunnableWithProgress#run(IProgressMonitor)
*/
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
int steps= fToChange.size() + fToRemove.size();
monitor.beginTask(NewWizardMessages.getString("VariableBlock.operation_desc"), steps);
try {
for (int i= 0; i < fToChange.size(); i++) {
CPVariableElement curr= (CPVariableElement) fToChange.get(i);
SubProgressMonitor subMonitor= new SubProgressMonitor(monitor, 1);
JavaCore.setClasspathVariable(curr.getName(), curr.getPath(), subMonitor);
if (monitor.isCanceled()) {
return;
}
}
for (int i= 0; i < fToRemove.size(); i++) {
SubProgressMonitor subMonitor= new SubProgressMonitor(monitor, 1);
JavaCore.removeClasspathVariable((String) fToRemove.get(i), subMonitor);
if (monitor.isCanceled()) {
return;
}
}
} catch (JavaModelException e) {
throw new InvocationTargetException(e);
} finally {
monitor.done();
}
}
}
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.wizards.buildpaths;
import java.util.List;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jdt.core.JavaCore;
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
import org.eclipse.jdt.internal.ui.util.SWTUtil;
import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
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.IStringButtonAdapter;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
import org.eclipse.jdt.internal.ui.wizards.swt.MGridData;
import org.eclipse.jdt.internal.ui.wizards.swt.MGridLayout;
public class VariableSelectionBlock {
private List fExistingPaths;
private StringButtonDialogField fVariableField;
private StringButtonDialogField fExtensionField;
private CLabel fFullPath;
private IStatus fVariableStatus;
private IStatus fExistsStatus;
private IStatus fExtensionStatus;
private String fVariable;
private IStatusChangeListener fContext;
private boolean fIsEmptyAllowed;
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
private String fLastVariableSelection;
/**
* Constructor for VariableSelectionBlock
*/
public VariableSelectionBlock(IStatusChangeListener context, List existingPaths, IPath varPath, String lastVarSelection, boolean emptyAllowed) {
fContext= context;
fExistingPaths= existingPaths;
fIsEmptyAllowed= emptyAllowed;
fLastVariableSelection= lastVarSelection;
fVariableStatus= new StatusInfo();
fExistsStatus= new StatusInfo();
VariableSelectionAdapter adapter= new VariableSelectionAdapter();
fVariableField= new StringButtonDialogField(adapter);
fVariableField.setDialogFieldListener(adapter);
fVariableField.setLabelText(NewWizardMessages.getString("VariableSelectionBlock.variable.label"));
fVariableField.setButtonLabel(NewWizardMessages.getString("VariableSelectionBlock.variable.button"));
fExtensionField= new StringButtonDialogField(adapter);
fExtensionField.setDialogFieldListener(adapter);
fExtensionField.setLabelText(NewWizardMessages.getString("VariableSelectionBlock.extension.label"));
fExtensionField.setButtonLabel(NewWizardMessages.getString("VariableSelectionBlock.extension.button"));
if (varPath != null) {
fVariableField.setText(varPath.segment(0));
fExtensionField.setText(varPath.removeFirstSegments(1).toString());
} else {
fVariableField.setText("");
fExtensionField.setText("");
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
}
updateFullTextField();
}
public IPath getVariablePath() {
if (fVariable != null) {
return new Path(fVariable).append(fExtensionField.getText());
}
return null;
}
public IPath getResolvedPath() {
if (fVariable != null) {
IPath entryPath= JavaCore.getClasspathVariable(fVariable);
if (entryPath != null) {
return entryPath.append(fExtensionField.getText());
}
}
return null;
}
public void setFocus(Display display) {
fVariableField.postSetFocusOnDialogField(display);
}
public Control createControl(Composite parent) {
int nColumns= 3;
Composite inner= new Composite(parent, SWT.NONE);
MGridLayout layout= new MGridLayout();
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
layout.minimumWidth= SWTUtil.convertWidthInCharsToPixels(80, parent);
layout.marginHeight= 0;
layout.marginWidth= 0;
layout.numColumns= nColumns;
inner.setLayout(layout);
int fieldWidthHint= SWTUtil.convertWidthInCharsToPixels(50, parent);
fVariableField.doFillIntoGrid(inner, nColumns);
LayoutUtil.setWidthHint(fVariableField.getTextControl(null), fieldWidthHint);
fExtensionField.doFillIntoGrid(inner, nColumns);
LayoutUtil.setWidthHint(fExtensionField.getTextControl(null), fieldWidthHint);
Label label= new Label(inner, SWT.LEFT);
label.setLayoutData(new MGridData());
label.setText(NewWizardMessages.getString("VariableSelectionBlock.fullpath.label"));
fFullPath= new CLabel(inner, SWT.NONE);
fFullPath.setLayoutData(new MGridData(MGridData.HORIZONTAL_ALIGN_FILL));
DialogField.createEmptySpace(inner, nColumns - 2);
updateFullTextField();
setFocus(parent.getDisplay());
return inner;
}
private class VariableSelectionAdapter implements IDialogFieldListener, IStringButtonAdapter {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
public void dialogFieldChanged(DialogField field) {
doFieldUpdated(field);
}
public void changeControlPressed(DialogField field) {
doChangeControlPressed(field);
}
}
private void doChangeControlPressed(DialogField field) {
if (field == fVariableField) {
String variable= chooseVariable();
if (variable != null) {
fVariableField.setText(variable);
}
} else if (field == fExtensionField) {
IPath filePath= chooseExtJar();
if (filePath != null) {
fExtensionField.setText(filePath.toString());
}
}
}
private void doFieldUpdated(DialogField field) {
if (field == fVariableField) {
fVariableStatus= variableUpdated();
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
} else if (field == fExtensionField) {
fExtensionStatus= extensionUpdated();
}
fExistsStatus= getExistsStatus();
updateFullTextField();
fContext.statusChanged(StatusUtil.getMostSevere(new IStatus[] { fVariableStatus, fExtensionStatus, fExistsStatus }));
}
private IStatus variableUpdated() {
fVariable= null;
StatusInfo status= new StatusInfo();
String name= fVariableField.getText();
if (name.length() == 0) {
if (!fIsEmptyAllowed) {
status.setError(NewWizardMessages.getString("VariableSelectionBlock.error.entername"));
} else {
fVariable= "";
}
} else if (JavaCore.getClasspathVariable(name) == null) {
status.setError(NewWizardMessages.getString("VariableSelectionBlock.error.namenotexists"));
} else {
fVariable= name;
}
fExtensionField.enableButton(fVariable != null);
return status;
}
private IStatus extensionUpdated() {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
StatusInfo status= new StatusInfo();
String extension= fExtensionField.getText();
if (extension.length() > 0 && !Path.ROOT.isValidPath(extension)) {
status.setError(NewWizardMessages.getString("VariableSelectionBlock.error.invalidextension"));
}
return status;
}
private IStatus getExistsStatus() {
StatusInfo status= new StatusInfo();
IPath path= getResolvedPath();
if (path != null) {
if (findPath(path)) {
status.setError(NewWizardMessages.getString("VariableSelectionBlock.error.pathexists"));
} else if (!path.toFile().isFile()) {
status.setWarning(NewWizardMessages.getString("VariableSelectionBlock.warning.pathnotexists"));
}
} else {
status.setWarning(NewWizardMessages.getString("VariableSelectionBlock.warning.pathnotexists"));
}
return status;
}
private boolean findPath(IPath path) {
for (int i= fExistingPaths.size() -1; i >=0; i--) {
IPath curr= (IPath) fExistingPaths.get(i);
if (curr.equals(path)) {
return true;
}
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
return false;
}
private void updateFullTextField() {
if (fFullPath != null && !fFullPath.isDisposed()) {
IPath resolvedPath= getResolvedPath();
if (resolvedPath != null) {
fFullPath.setText(resolvedPath.toOSString());
} else {
fFullPath.setText("");
}
}
}
private Shell getShell() {
if (fFullPath != null) {
return fFullPath.getShell();
}
return JavaPlugin.getActiveWorkbenchShell();
}
private IPath chooseExtJar() {
String lastUsedPath= "";
IPath entryPath= getResolvedPath();
if (entryPath != null) {
if (ArchiveFileFilter.isArchivePath(entryPath)) {
lastUsedPath= entryPath.removeLastSegments(1).toOSString();
} else {
lastUsedPath= entryPath.toOSString();
}
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableSelectionBlock.java
|
FileDialog dialog= new FileDialog(getShell(), SWT.SINGLE);
dialog.setFilterExtensions(new String[] {"*.jar;*.zip"});
dialog.setFilterPath(lastUsedPath);
dialog.setText(NewWizardMessages.getString("VariableSelectionBlock.ExtJarDialog.title"));
String res= dialog.open();
if (res == null) {
return null;
}
IPath resPath= new Path(res).makeAbsolute();
IPath varPath= JavaCore.getClasspathVariable(fVariable);
if (!varPath.isPrefixOf(resPath)) {
return new Path(resPath.lastSegment());
} else {
return resPath.removeFirstSegments(varPath.segmentCount()).setDevice(null);
}
}
private String chooseVariable() {
String selecteVariable= (fVariable != null) ? fVariable : fLastVariableSelection;
ChooseVariableDialog dialog= new ChooseVariableDialog(getShell(), selecteVariable);
if (dialog.open() == dialog.OK) {
return dialog.getSelectedVariable();
}
return null;
}
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.wizards.dialogfields;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
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.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jdt.internal.ui.util.SWTUtil;
import org.eclipse.jdt.internal.ui.wizards.swt.MGridData;
import org.eclipse.jdt.internal.ui.wizards.swt.MGridLayout;
/**
* A list with a button bar.
* Typical buttons are 'Add', 'Remove', 'Up' and 'Down'.
* List model is independend of widget creation.
* DialogFields controls are: Label, List and Composite containing buttons.
*/
public class ListDialogField extends DialogField {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
protected TableViewer fTable;
protected ILabelProvider fLabelProvider;
protected ListViewerAdapter fListViewerAdapter;
protected List fElements;
protected String[] fButtonLabels;
private Button[] fButtonControls;
private boolean[] fButtonsEnabled;
private int fRemoveButtonIndex;
private int fUpButtonIndex;
private int fDownButtonIndex;
private Label fLastSeparator;
private Table fTableControl;
private Composite fButtonsControl;
private ISelection fSelectionWhenEnabled;
private TableColumn fTableColumn;
private IListAdapter fListAdapter;
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
private Object fParentElement;
/**
* Creates the <code>ListDialogField</code>.
* @param adapter A listener for button invocation, selection changes.
* @param buttonLabels The labels of all buttons: <code>null</code> is a valid array entry and
* marks a separator.
* @param lprovider The label provider to render the table entries
*/
public ListDialogField(IListAdapter adapter, String[] buttonLabels, ILabelProvider lprovider) {
super();
fListAdapter= adapter;
fLabelProvider= lprovider;
fListViewerAdapter= new ListViewerAdapter();
fParentElement= this;
fElements= new ArrayList(10);
fButtonLabels= buttonLabels;
if (fButtonLabels != null) {
int nButtons= fButtonLabels.length;
fButtonsEnabled= new boolean[nButtons];
for (int i= 0; i < nButtons; i++) {
fButtonsEnabled[i]= true;
}
}
fTable= null;
fTableControl= null;
fButtonsControl= null;
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
fRemoveButtonIndex= -1;
fUpButtonIndex= -1;
fDownButtonIndex= -1;
}
/**
* Sets the index of the 'remove' button in the button label array passed in the constructor.
* The behaviour of the button marked as the 'remove' button will then be handled internally.
* (enable state, button invocation behaviour)
*/
public void setRemoveButtonIndex(int removeButtonIndex) {
Assert.isTrue(removeButtonIndex < fButtonLabels.length);
fRemoveButtonIndex= removeButtonIndex;
}
/**
* Sets the index of the 'up' button in the button label array passed in the constructor.
* The behaviour of the button marked as the 'up' button will then be handled internally.
* (enable state, button invocation behaviour)
*/
public void setUpButtonIndex(int upButtonIndex) {
Assert.isTrue(upButtonIndex < fButtonLabels.length);
fUpButtonIndex= upButtonIndex;
}
/**
* Sets the index of the 'down' button in the button label array passed in the constructor.
* The behaviour of the button marked as the 'down' button will then be handled internally.
* (enable state, button invocation behaviour)
*/
public void setDownButtonIndex(int downButtonIndex) {
Assert.isTrue(downButtonIndex < fButtonLabels.length);
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
fDownButtonIndex= downButtonIndex;
}
private void buttonPressed(int index) {
if (!managedButtonPressed(index)) {
fListAdapter.customButtonPressed(this, index);
}
}
/**
* Checks if the button pressed is handled internally
* @return Returns true if button has been handled.
*/
protected boolean managedButtonPressed(int index) {
if (index == fRemoveButtonIndex) {
remove();
} else if (index == fUpButtonIndex) {
up();
} else if (index == fDownButtonIndex) {
down();
} else {
return false;
}
return true;
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
/*
* @see DialogField#doFillIntoGrid
*/
public Control[] doFillIntoGrid(Composite parent, int nColumns) {
assertEnoughColumns(nColumns);
Label label= getLabelControl(parent);
MGridData gd= gridDataForLabel(1);
gd.verticalAlignment= gd.BEGINNING;
label.setLayoutData(gd);
Control list= getListControl(parent);
gd= new MGridData();
gd.horizontalAlignment= gd.FILL;
gd.grabExcessHorizontalSpace= true;
gd.verticalAlignment= gd.FILL;
gd.grabExcessVerticalSpace= true;
gd.grabColumn= 0;
gd.horizontalSpan= nColumns - 2;
gd.widthHint= SWTUtil.convertWidthInCharsToPixels(40, list);
gd.heightHint= SWTUtil.convertHeightInCharsToPixels(6, list);
list.setLayoutData(gd);
Composite buttons= getButtonBox(parent);
gd= new MGridData();
gd.horizontalAlignment= gd.FILL;
gd.grabExcessHorizontalSpace= false;
gd.verticalAlignment= gd.FILL;
gd.grabExcessVerticalSpace= false;
gd.horizontalSpan= 1;
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
buttons.setLayoutData(gd);
return new Control[] { label, list, buttons };
}
/*
* @see DialogField#getNumberOfControls
*/
public int getNumberOfControls() {
return 3;
}
/**
* Sets the minimal width of the buttons. Must be called after widget creation.
*/
public void setButtonsMinWidth(int minWidth) {
if (fLastSeparator != null) {
((MGridData)fLastSeparator.getLayoutData()).widthHint= minWidth;
}
}
/**
* Returns the list control. When called the first time, the control will be created.
* @param The parent composite when called the first time, or <code>null</code>
* after.
*/
public Control getListControl(Composite parent) {
if (fTableControl == null) {
assertCompositeNotNull(parent);
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
fTable= createTableViewer(parent);
fTable.setContentProvider(fListViewerAdapter);
fTable.setLabelProvider(fLabelProvider);
fTable.addSelectionChangedListener(fListViewerAdapter);
fTableControl= (Table)fTable.getControl();
TableLayout tableLayout= new TableLayout();
tableLayout.addColumnData(new ColumnWeightData(100));
fTableColumn= new TableColumn(fTableControl, SWT.NONE);
fTableColumn.setResizable(false);
fTableControl.setLayout(tableLayout);
fTable.setInput(fParentElement);
fTableControl.setEnabled(isEnabled());
if (fSelectionWhenEnabled != null) {
postSetSelection(fSelectionWhenEnabled);
}
fTableColumn.getDisplay().asyncExec(new Runnable() {
public void run() {
if (fTableColumn != null && !fTableColumn.isDisposed()) {
fTableColumn.pack();
}
}
});
}
return fTableControl;
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
}
/**
* Returns the internally used table viewer.
*/
public TableViewer getTableViewer() {
return fTable;
}
/*
* Subclasses may override to specify a different style.
*/
protected int getListStyle(){
return SWT.BORDER + SWT.MULTI + SWT.H_SCROLL + SWT.V_SCROLL;
}
protected TableViewer createTableViewer(Composite parent) {
Table table= new Table(parent, getListStyle());
return new TableViewer(table);
}
protected Button createButton(Composite parent, String label, SelectionListener listener) {
Button button= new Button(parent, SWT.PUSH);
button.setText(label);
button.addSelectionListener(listener);
MGridData gd= new MGridData();
gd.horizontalAlignment= gd.FILL;
gd.grabExcessHorizontalSpace= true;
gd.verticalAlignment= gd.BEGINNING;
gd.heightHint = SWTUtil.getButtonHeigthHint(button);
gd.widthHint = SWTUtil.getButtonWidthHint(button);
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
button.setLayoutData(gd);
return button;
}
private Label createSeparator(Composite parent) {
Label separator= new Label(parent, SWT.NONE);
separator.setVisible(false);
MGridData gd= new MGridData();
gd.horizontalAlignment= gd.FILL;
gd.verticalAlignment= gd.BEGINNING;
gd.heightHint= 4;
separator.setLayoutData(gd);
return separator;
}
/**
* Returns the composite containing the buttons. When called the first time, the control
* will be created.
* @param The parent composite when called the first time, or <code>null</code>
* after.
*/
public Composite getButtonBox(Composite parent) {
if (fButtonsControl == null) {
assertCompositeNotNull(parent);
SelectionListener listener= new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
doButtonSelected(e);
}
public void widgetSelected(SelectionEvent e) {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
doButtonSelected(e);
}
};
Composite contents= new Composite(parent, SWT.NULL);
MGridLayout layout= new MGridLayout();
layout.marginWidth= 0;
layout.marginHeight= 0;
contents.setLayout(layout);
if (fButtonLabels != null) {
fButtonControls= new Button[fButtonLabels.length];
for (int i= 0; i < fButtonLabels.length; i++) {
String currLabel= fButtonLabels[i];
if (currLabel != null) {
fButtonControls[i]= createButton(contents, currLabel, listener);
fButtonControls[i].setEnabled(isEnabled() && fButtonsEnabled[i]);
} else {
fButtonControls[i]= null;
createSeparator(contents);
}
}
}
fLastSeparator= createSeparator(contents);
updateButtonState();
fButtonsControl= contents;
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
return fButtonsControl;
}
private void doButtonSelected(SelectionEvent e) {
if (fButtonControls != null) {
for (int i= 0; i < fButtonControls.length; i++) {
if (e.widget == fButtonControls[i]) {
buttonPressed(i);
return;
}
}
}
}
/*
* @see DialogField#dialogFieldChanged
*/
public void dialogFieldChanged() {
super.dialogFieldChanged();
if (fTableColumn != null && !fTableColumn.isDisposed()) {
fTableColumn.pack();
}
updateButtonState();
}
private Button getButton(int index) {
if (fButtonControls != null && index >= 0 && index < fButtonControls.length) {
return fButtonControls[index];
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
return null;
}
/*
* Updates the enable state of the all buttons
*/
protected void updateButtonState() {
if (fButtonControls != null) {
ISelection sel= fTable.getSelection();
for (int i= 0; i < fButtonControls.length; i++) {
Button button= fButtonControls[i];
if (isOkToUse(button)) {
boolean extraState= getManagedButtonState(sel, i);
button.setEnabled(isEnabled() && extraState && fButtonsEnabled[i]);
}
}
}
}
protected boolean getManagedButtonState(ISelection sel, int index) {
if (index == fRemoveButtonIndex) {
return !sel.isEmpty();
} else if (index == fUpButtonIndex) {
return !sel.isEmpty() && canMoveUp();
} else if (index == fDownButtonIndex) {
return !sel.isEmpty() && canMoveDown();
}
return true;
}
/*
* @see DialogField#updateEnableState
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
*/
protected void updateEnableState() {
super.updateEnableState();
boolean enabled= isEnabled();
if (isOkToUse(fTableControl)) {
if (!enabled) {
fSelectionWhenEnabled= fTable.getSelection();
selectElements(null);
} else {
selectElements(fSelectionWhenEnabled);
fSelectionWhenEnabled= null;
}
fTableControl.setEnabled(enabled);
}
updateButtonState();
}
/**
* Sets a button enabled or disabled.
*/
public void enableButton(int index, boolean enable) {
if (fButtonsEnabled != null && index < fButtonsEnabled.length) {
fButtonsEnabled[index]= enable;
updateButtonState();
}
}
/**
* Sets the elements shown in the list.
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
*/
public void setElements(List elements) {
fElements= new ArrayList(elements);
if (fTable != null) {
fTable.refresh();
}
dialogFieldChanged();
}
/**
* Gets the elements shown in the list.
* The list returned is a copy, so it can be modified by the user.
*/
public List getElements() {
return new ArrayList(fElements);
}
/**
* Gets the elements shown at the given index.
*/
public Object getElement(int index) {
return fElements.get(index);
}
/**
* Replace an element.
*/
public void replaceElement(Object oldElement, Object newElement) throws IllegalArgumentException {
int idx= fElements.indexOf(oldElement);
if (idx != -1) {
if (oldElement.equals(newElement) || fElements.contains(newElement)) {
return;
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
fElements.set(idx, newElement);
if (fTable != null) {
List selected= getSelectedElements();
if (selected.remove(oldElement)) {
selected.add(newElement);
}
fTable.refresh();
fTable.setSelection(new StructuredSelection(selected));
}
dialogFieldChanged();
} else {
throw new IllegalArgumentException();
}
}
/**
* Adds an element at the end of the list.
*/
public void addElement(Object element) {
if (fElements.contains(element)) {
return;
}
fElements.add(element);
if (fTable != null) {
fTable.add(element);
}
dialogFieldChanged();
}
/**
* Adds elements at the end of the list.
*/
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
public void addElements(List elements) {
int nElements= elements.size();
if (nElements > 0) {
ArrayList elementsToAdd= new ArrayList(nElements);
for (int i= 0; i < nElements; i++) {
Object elem= elements.get(i);
if (!fElements.contains(elem)) {
elementsToAdd.add(elem);
}
}
fElements.addAll(elementsToAdd);
if (fTable != null) {
fTable.add(elementsToAdd.toArray());
}
dialogFieldChanged();
}
}
/**
* Adds an element at a position.
*/
public void insertElementAt(Object element, int index) {
if (fElements.contains(element)) {
return;
}
fElements.add(index, element);
if (fTable != null) {
fTable.add(element);
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
}
dialogFieldChanged();
}
/**
* Adds an element at a position.
*/
public void removeAllElements() {
if (fElements.size() > 0) {
fElements.clear();
if (fTable != null) {
fTable.refresh();
}
dialogFieldChanged();
}
}
/**
* Removes an element from the list.
*/
public void removeElement(Object element) throws IllegalArgumentException {
if (fElements.remove(element)) {
if (fTable != null) {
fTable.remove(element);
}
dialogFieldChanged();
} else {
throw new IllegalArgumentException();
}
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
/**
* Removes elements from the list.
*/
public void removeElements(List elements) {
if (elements.size() > 0) {
fElements.removeAll(elements);
if (fTable != null) {
fTable.remove(elements.toArray());
}
dialogFieldChanged();
}
}
/**
* Gets the number of elements
*/
public int getSize() {
return fElements.size();
}
public void selectElements(ISelection selection) {
fSelectionWhenEnabled= selection;
if (fTable != null) {
fTable.setSelection(selection);
}
}
public void postSetSelection(final ISelection selection) {
if (isOkToUse(fTableControl)) {
Display d= fTableControl.getDisplay();
d.asyncExec(new Runnable() {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
public void run() {
if (isOkToUse(fTableControl)) {
selectElements(selection);
}
}
});
}
}
/**
* Refreshes the table.
*/
public void refresh() {
fTable.refresh();
}
private List moveUp(List elements, List move) {
int nElements= elements.size();
List res= new ArrayList(nElements);
Object floating= null;
for (int i= 0; i < nElements; i++) {
Object curr= elements.get(i);
if (move.contains(curr)) {
res.add(curr);
} else {
if (floating != null) {
res.add(floating);
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
floating= curr;
}
}
if (floating != null) {
res.add(floating);
}
return res;
}
private void moveUp(List toMoveUp) {
if (toMoveUp.size() > 0) {
setElements(moveUp(fElements, toMoveUp));
fTable.reveal(toMoveUp.get(0));
}
}
private void moveDown(List toMoveDown) {
if (toMoveDown.size() > 0) {
setElements(reverse(moveUp(reverse(fElements), toMoveDown)));
fTable.reveal(toMoveDown.get(toMoveDown.size() - 1));
}
}
private List reverse(List p) {
List reverse= new ArrayList(p.size());
for (int i= p.size()-1; i >= 0; i--) {
reverse.add(p.get(i));
}
return reverse;
}
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
private void remove() {
removeElements(getSelectedElements());
}
private void up() {
moveUp(getSelectedElements());
}
private void down() {
moveDown(getSelectedElements());
}
private boolean canMoveUp() {
if (isOkToUse(fTableControl)) {
int[] indc= fTableControl.getSelectionIndices();
for (int i= 0; i < indc.length; i++) {
if (indc[i] != i) {
return true;
}
}
}
return false;
}
private boolean canMoveDown() {
if (isOkToUse(fTableControl)) {
int[] indc= fTableControl.getSelectionIndices();
int k= fElements.size() - 1;
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
for (int i= indc.length - 1; i >= 0 ; i--, k--) {
if (indc[i] != k) {
return true;
}
}
}
return false;
}
/**
* Returns the selected elements.
*/
public List getSelectedElements() {
List result= new ArrayList();
if (fTable != null) {
ISelection selection= fTable.getSelection();
if (selection instanceof IStructuredSelection) {
Iterator iter= ((IStructuredSelection)selection).iterator();
while (iter.hasNext()) {
result.add(iter.next());
}
}
}
return result;
}
private class ListViewerAdapter implements IStructuredContentProvider, ISelectionChangedListener {
|
6,196 |
Bug 6196 Last item selected by default in variable selection dialog
|
Build 20011120 - go to add a classpath variable - Browse for var name - it selects the last item by default Normally the default selection is the first item. This seems picky, but it's actually fairly annoying when using keyboard navigation for the default selection to be in the wrong place. (particularly when the one I always go for is ECLIPSE_HOME, which is always the first item <g>).
|
verified fixed
|
e26dfad
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-23T15:53:36Z | 2001-11-21T22:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
|
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
public boolean isDeleted(Object element) {
return false;
}
public void dispose() {
}
public Object[] getElements(Object obj) {
return fElements.toArray();
}
public void selectionChanged(SelectionChangedEvent event) {
doListSelected(event);
}
}
private void doListSelected(SelectionChangedEvent event) {
updateButtonState();
if (fListAdapter != null) {
fListAdapter.selectionChanged(this);
}
}
}
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
package org.eclipse.jdt.internal.ui.javaeditor;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import java.lang.reflect.InvocationTargetException;
import java.util.Iterator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.BadPositionCategoryException;
import org.eclipse.jface.text.DefaultPositionUpdater;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IPositionUpdater;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextInputListener;
import org.eclipse.jface.text.ITextListener;
import org.eclipse.jface.text.ITextOperationTarget;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.TextEvent;
import org.eclipse.jface.text.TextPresentation;
import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.IContentAssistant;
import org.eclipse.jface.text.source.Annotation;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.IVerticalRuler;
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.ui.dialogs.SaveAsDialog;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
import org.eclipse.ui.texteditor.MarkerAnnotation;
import org.eclipse.ui.texteditor.MarkerUtilities;
import org.eclipse.ui.texteditor.TextOperationAction;
import org.eclipse.ui.views.tasklist.TaskList;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.ISourceReference;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.IContextMenuConstants;
import org.eclipse.jdt.ui.IWorkingCopyManager;
import org.eclipse.jdt.ui.text.JavaTextTools;
import org.eclipse.jdt.internal.ui.JavaPlugin;
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
import org.eclipse.jdt.internal.ui.compare.JavaAddElementFromHistory;
import org.eclipse.jdt.internal.ui.compare.JavaReplaceWithEditionAction;
import org.eclipse.jdt.internal.ui.reorg.DeleteAction;
import org.eclipse.jdt.internal.ui.text.ContentAssistPreference;
import org.eclipse.jdt.internal.ui.text.JavaPairMatcher;
/**
* Java specific text editor.
*/
public class CompilationUnitEditor extends JavaEditor {
/**
* Responsible for highlighting matching pairs of brackets.
*/
class BracketHighlighter implements KeyListener, MouseListener, ISelectionChangedListener, ITextListener, ITextInputListener {
/**
* Highlights the brackets.
*/
class HighlightBrackets implements PaintListener {
private JavaPairMatcher fMatcher= new JavaPairMatcher(new char[] { '{', '}', '(', ')', '[', ']' });
private Position fBracketPosition= new Position(0, 0);
private int fAnchor;
private boolean fIsActive= false;
private StyledText fTextWidget;
private Color fColor;
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
public HighlightBrackets() {
fTextWidget= fSourceViewer.getTextWidget();
}
public void setHighlightColor(Color color) {
fColor= color;
}
public void dispose() {
if (fMatcher != null) {
fMatcher.dispose();
fMatcher= null;
}
fColor= null;
fTextWidget= null;
}
public void deactivate(boolean redraw) {
if (fIsActive) {
fIsActive= false;
fTextWidget.removePaintListener(this);
fManager.unmanage(fBracketPosition);
if (redraw)
handleDrawRequest(null);
}
}
public void run() {
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
Point selection= fSourceViewer.getSelectedRange();
if (selection.y > 0) {
deactivate(true);
return;
}
IRegion pair= fMatcher.match(fSourceViewer.getDocument(), selection.x);
if (pair == null) {
deactivate(true);
return;
}
if (fIsActive) {
if (pair.getOffset() != fBracketPosition.getOffset() ||
pair.getLength() != fBracketPosition.getLength() ||
fMatcher.getAnchor() != fAnchor) {
handleDrawRequest(null);
fBracketPosition.isDeleted= false;
fBracketPosition.offset= pair.getOffset();
fBracketPosition.length= pair.getLength();
fAnchor= fMatcher.getAnchor();
handleDrawRequest(null);
}
} else {
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
fIsActive= true;
fBracketPosition.isDeleted= false;
fBracketPosition.offset= pair.getOffset();
fBracketPosition.length= pair.getLength();
fAnchor= fMatcher.getAnchor();
fTextWidget.addPaintListener(this);
fManager.manage(fBracketPosition);
handleDrawRequest(null);
}
}
public void paintControl(PaintEvent event) {
if (fTextWidget != null)
handleDrawRequest(event.gc);
}
private void handleDrawRequest(GC gc) {
IRegion region= fSourceViewer.getVisibleRegion();
int offset= fBracketPosition.getOffset();
int length= fBracketPosition.getLength();
if (region.getOffset() <= offset && region.getOffset() + region.getLength() >= offset + length) {
offset -= region.getOffset();
if (fMatcher.RIGHT == fAnchor)
draw(gc, offset, 1);
else
draw(gc, offset + length -1, 1);
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
}
}
private void draw(GC gc, int offset, int length) {
if (gc != null) {
Point left= fTextWidget.getLocationAtOffset(offset);
Point right= fTextWidget.getLocationAtOffset(offset + length);
gc.setForeground(fColor);
gc.drawRectangle(left.x, left.y, right.x - left.x - 1, gc.getFontMetrics().getHeight() - 1);
} else {
fTextWidget.redrawRange(offset, length, true);
}
}
};
/**
* Manages the registration and updating of the bracket position.
*/
class BracketPositionManager {
private IDocument fDocument;
private IPositionUpdater fPositionUpdater;
private String fCategory;
public BracketPositionManager() {
fCategory= getClass().getName() + hashCode();
fPositionUpdater= new DefaultPositionUpdater(fCategory);
}
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
public void install(IDocument document) {
fDocument= document;
fDocument.addPositionCategory(fCategory);
fDocument.addPositionUpdater(fPositionUpdater);
}
public void dispose() {
uninstall(fDocument);
}
public void uninstall(IDocument document) {
if (document == fDocument && document != null) {
try {
fDocument.removePositionUpdater(fPositionUpdater);
fDocument.removePositionCategory(fCategory);
} catch (BadPositionCategoryException x) {
}
fDocument= null;
}
}
public void manage(Position position) {
try {
fDocument.addPosition(fCategory, position);
} catch (BadPositionCategoryException x) {
} catch (BadLocationException x) {
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
}
}
public void unmanage(Position position) {
try {
fDocument.removePosition(fCategory, position);
} catch (BadPositionCategoryException x) {
}
}
};
private BracketPositionManager fManager= new BracketPositionManager();
private HighlightBrackets fHighlightBrackets;
private ISourceViewer fSourceViewer;
private boolean fTextChanged= false;
public BracketHighlighter(ISourceViewer sourceViewer) {
fSourceViewer= sourceViewer;
fHighlightBrackets= new HighlightBrackets();
}
public void setHighlightColor(Color color) {
fHighlightBrackets.setHighlightColor(color);
}
public void install() {
fManager.install(fSourceViewer.getDocument());
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
fSourceViewer.addTextInputListener(this);
ISelectionProvider provider= fSourceViewer.getSelectionProvider();
provider.addSelectionChangedListener(this);
fSourceViewer.addTextListener(this);
StyledText text= fSourceViewer.getTextWidget();
text.addKeyListener(this);
text.addMouseListener(this);
}
public void dispose() {
if (fManager != null) {
fManager.dispose();
fManager= null;
}
if (fHighlightBrackets != null) {
fHighlightBrackets.dispose();
fHighlightBrackets= null;
}
if (fSourceViewer != null && fBracketHighlighter != null) {
fSourceViewer.removeTextInputListener(this);
ISelectionProvider provider= fSourceViewer.getSelectionProvider();
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
provider.removeSelectionChangedListener(this);
fSourceViewer.removeTextListener(this);
StyledText text= fSourceViewer.getTextWidget();
if (text != null && !text.isDisposed()) {
text.removeKeyListener(fBracketHighlighter);
text.removeMouseListener(fBracketHighlighter);
}
fSourceViewer= null;
}
}
/*
* @see KeyListener#keyPressed(KeyEvent)
*/
public void keyPressed(KeyEvent e) {
fTextChanged= false;
}
/*
* @see KeyListener#keyReleased(KeyEvent)
*/
public void keyReleased(KeyEvent e) {
if (!fTextChanged)
fHighlightBrackets.run();
}
/*
* @see MouseListener#mouseDoubleClick(MouseEvent)
*/
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
public void mouseDoubleClick(MouseEvent e) {
}
/*
* @see MouseListener#mouseDown(MouseEvent)
*/
public void mouseDown(MouseEvent e) {
}
/*
* @see MouseListener#mouseUp(MouseEvent)
*/
public void mouseUp(MouseEvent e) {
fHighlightBrackets.run();
}
/*
* @see ISelectionChangedListener#selectionChanged(SelectionChangedEvent)
*/
public void selectionChanged(SelectionChangedEvent event) {
fHighlightBrackets.run();
}
/*
* @see ITextListener#textChanged(TextEvent)
*/
public void textChanged(TextEvent event) {
fTextChanged= true;
Control control= fSourceViewer.getTextWidget();
if (control != null) {
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
control.getDisplay().asyncExec(new Runnable() {
public void run() {
if (fTextChanged && fHighlightBrackets != null)
fHighlightBrackets.run();
}
});
}
}
/*
* @see ITextInputListener#inputDocumentAboutToBeChanged(IDocument, IDocument)
*/
public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
if (oldInput != null) {
fHighlightBrackets.deactivate(false);
fManager.uninstall(oldInput);
}
}
/*
* @see ITextInputListener#inputDocumentChanged(IDocument, IDocument)
*/
public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
if (newInput != null)
fManager.install(newInput);
}
};
class InternalSourceViewer extends SourceViewer {
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
public InternalSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
super(parent, ruler, styles);
}
public IContentAssistant getContentAssistant() {
return fContentAssistant;
}
};
public final static String MATCHING_BRACKETS= "matchingBrackets";
public final static String MATCHING_BRACKETS_COLOR= "matchingBracketsColor";
protected ISelectionChangedListener fStatusLineClearer;
protected ISavePolicy fSavePolicy;
private JavaEditorErrorTickUpdater fJavaEditorErrorTickUpdater;
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
private BracketHighlighter fBracketHighlighter;
/**
* Creates a new compilation unit editor.
*/
public CompilationUnitEditor() {
super();
setDocumentProvider(JavaPlugin.getDefault().getCompilationUnitDocumentProvider());
setEditorContextMenuId("#CompilationUnitEditorContext");
setRulerContextMenuId("#CompilationUnitRulerContext");
setOutlinerContextMenuId("#CompilationUnitOutlinerContext");
fSavePolicy= null;
fJavaEditorErrorTickUpdater= new JavaEditorErrorTickUpdater(this);
}
/*
* @see AbstractTextEditor#createActions
*/
protected void createActions() {
super.createActions();
setAction("ContentAssistProposal", new TextOperationAction(JavaEditorMessages.getResourceBundle(), "ContentAssistProposal.", this, ISourceViewer.CONTENTASSIST_PROPOSALS));
setAction("AddImportOnSelection", new AddImportOnSelectionAction(this));
setAction("OrganizeImports", new OrganizeImportsAction(this));
setAction("Comment", new TextOperationAction(JavaEditorMessages.getResourceBundle(), "Comment.", this, ITextOperationTarget.PREFIX));
setAction("Uncomment", new TextOperationAction(JavaEditorMessages.getResourceBundle(), "Uncomment.", this, ITextOperationTarget.STRIP_PREFIX));
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
setAction("Format", new TextOperationAction(JavaEditorMessages.getResourceBundle(), "Format.", this, ISourceViewer.FORMAT));
setAction("AddBreakpoint", new AddBreakpointAction(this));
setAction("ManageBreakpoints", new BreakpointRulerAction(getVerticalRuler(), this));
setAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK, getAction("ManageBreakpoints"));
}
/*
* @see JavaEditor#getElementAt
*/
protected IJavaElement getElementAt(int offset) {
IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();
ICompilationUnit unit= manager.getWorkingCopy(getEditorInput());
if (unit != null) {
synchronized (unit) {
try {
unit.reconcile();
return unit.getElementAt(offset);
} catch (JavaModelException x) {
}
}
}
return null;
}
/*
* @see JavaEditor#getCorrespondingElement(IJavaElement)
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
*/
protected IJavaElement getCorrespondingElement(IJavaElement element) {
try {
return EditorUtility.getWorkingCopy(element, true);
} catch (JavaModelException x) {
}
return null;
}
/*
* @see AbstractEditor#editorContextMenuAboutToChange
*/
public void editorContextMenuAboutToShow(IMenuManager menu) {
super.editorContextMenuAboutToShow(menu);
addAction(menu, IContextMenuConstants.GROUP_GENERATE, "ContentAssistProposal");
addAction(menu, IContextMenuConstants.GROUP_GENERATE, "AddImportOnSelection");
addAction(menu, IContextMenuConstants.GROUP_GENERATE, "OrganizeImports");
addAction(menu, ITextEditorActionConstants.GROUP_ADD, "AddBreakpoint");
addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Comment");
addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Uncomment");
addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Format");
}
/*
* @see AbstractTextEditor#rulerContextMenuAboutToShow
*/
protected void rulerContextMenuAboutToShow(IMenuManager menu) {
super.rulerContextMenuAboutToShow(menu);
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
addAction(menu, "ManageBreakpoints");
}
/*
* @see JavaEditor#createOutlinePage
*/
protected JavaOutlinePage createOutlinePage() {
JavaOutlinePage page= super.createOutlinePage();
page.setAction("OrganizeImports", new OrganizeImportsAction(this));
page.setAction("ReplaceWithEdition", new JavaReplaceWithEditionAction(page));
page.setAction("AddEdition", new JavaAddElementFromHistory(this, page));
DeleteAction deleteElement= new DeleteAction(page);
page.setAction("DeleteElement", deleteElement);
return page;
}
/*
* @see JavaEditor#setOutlinePageInput(JavaOutlinePage, IEditorInput)
*/
protected void setOutlinePageInput(JavaOutlinePage page, IEditorInput input) {
if (page != null) {
IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();
page.setInput(manager.getWorkingCopy(input));
}
}
/*
* @see AbstractTextEditor#performSaveOperation(WorkspaceModifyOperation, IProgressMonitor)
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
*/
protected void performSaveOperation(WorkspaceModifyOperation operation, IProgressMonitor progressMonitor) {
IDocumentProvider p= getDocumentProvider();
if (p instanceof CompilationUnitDocumentProvider) {
CompilationUnitDocumentProvider cp= (CompilationUnitDocumentProvider) p;
cp.setSavePolicy(fSavePolicy);
}
try {
super.performSaveOperation(operation, progressMonitor);
} finally {
if (p instanceof CompilationUnitDocumentProvider) {
CompilationUnitDocumentProvider cp= (CompilationUnitDocumentProvider) p;
cp.setSavePolicy(null);
}
}
}
/*
* @see AbstractTextEditor#doSave(IProgressMonitor)
*/
public void doSave(IProgressMonitor progressMonitor) {
IDocumentProvider p= getDocumentProvider();
if (p == null)
return;
if (p.isDeleted(getEditorInput())) {
if (isSaveAsAllowed()) {
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
/*
* 1GEUSSR: ITPUI:ALL - User should never loose changes made in the editors.
* Changed Behavior to make sure that if called inside a regular save (because
* of deletion of input element) there is a way to report back to the caller.
*/
performSaveAs(progressMonitor);
} else {
/*
* 1GF5YOX: ITPJUI:ALL - Save of delete file claims it's still there
* Missing resources.
*/
Shell shell= getSite().getShell();
MessageDialog.openError(shell, JavaEditorMessages.getString("CompilationUnitEditor.error.saving.title1"), JavaEditorMessages.getString("CompilationUnitEditor.error.saving.message1"));
}
} else {
getStatusLineManager().setErrorMessage("");
IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();
ICompilationUnit unit= manager.getWorkingCopy(getEditorInput());
if (unit != null) {
synchronized (unit) {
performSaveOperation(createSaveOperation(false), progressMonitor);
}
} else
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
performSaveOperation(createSaveOperation(false), progressMonitor);
}
}
/**
* Jumps to the error next according to the given direction.
*/
public void gotoError(boolean forward) {
ISelectionProvider provider= getSelectionProvider();
if (fStatusLineClearer != null) {
provider.removeSelectionChangedListener(fStatusLineClearer);
fStatusLineClearer= null;
}
ITextSelection s= (ITextSelection) provider.getSelection();
IMarker nextError= getNextError(s.getOffset(), forward);
if (nextError != null) {
gotoMarker(nextError);
IWorkbenchPage page= getSite().getPage();
IViewPart view= view= page.findView("org.eclipse.ui.views.TaskList");
if (view instanceof TaskList) {
StructuredSelection ss= new StructuredSelection(nextError);
((TaskList) view).setSelection(ss, true);
}
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
getStatusLineManager().setErrorMessage(nextError.getAttribute(IMarker.MESSAGE, ""));
fStatusLineClearer= new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
getSelectionProvider().removeSelectionChangedListener(fStatusLineClearer);
fStatusLineClearer= null;
getStatusLineManager().setErrorMessage("");
}
};
provider.addSelectionChangedListener(fStatusLineClearer);
} else {
getStatusLineManager().setErrorMessage("");
}
}
private IMarker getNextError(int offset, boolean forward) {
IMarker nextError= null;
IDocument document= getDocumentProvider().getDocument(getEditorInput());
int endOfDocument= document.getLength();
int distance= 0;
IAnnotationModel model= getDocumentProvider().getAnnotationModel(getEditorInput());
Iterator e= model.getAnnotationIterator();
while (e.hasNext()) {
Annotation a= (Annotation) e.next();
if (a instanceof MarkerAnnotation) {
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
MarkerAnnotation ma= (MarkerAnnotation) a;
IMarker marker= ma.getMarker();
if (MarkerUtilities.isMarkerType(marker, IMarker.PROBLEM)) {
Position p= model.getPosition(a);
if (!p.includes(offset)) {
int currentDistance= 0;
if (forward) {
currentDistance= p.getOffset() - offset;
if (currentDistance < 0)
currentDistance= endOfDocument - offset + p.getOffset();
} else {
currentDistance= offset - p.getOffset();
if (currentDistance < 0)
currentDistance= offset + endOfDocument - p.getOffset();
}
if (nextError == null || currentDistance < distance) {
distance= currentDistance;
nextError= marker;
}
}
}
}
}
return nextError;
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
}
/*
* @see AbstractTextEditor#isSaveAsAllowed()
*/
public boolean isSaveAsAllowed() {
return true;
}
/*
* 1GF7WG9: ITPJUI:ALL - EXCEPTION: "Save As..." always fails
*/
protected IPackageFragment getPackage(IWorkspaceRoot root, IPath path) {
if (path.segmentCount() == 1) {
IProject project= root.getProject(path.toString());
if (project != null) {
IJavaProject jProject= JavaCore.create(project);
if (jProject != null) {
try {
IJavaElement element= jProject.findElement(new Path(""));
if (element instanceof IPackageFragment) {
IPackageFragment fragment= (IPackageFragment) element;
IJavaElement parent= fragment.getParent();
if (parent instanceof IPackageFragmentRoot) {
IPackageFragmentRoot pRoot= (IPackageFragmentRoot) parent;
if ( !pRoot.isArchive() && !pRoot.isExternal() && path.equals(pRoot.getPath()))
return fragment;
}
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
}
} catch (JavaModelException x) {
}
}
}
return null;
} else if (path.segmentCount() > 1) {
IFolder folder= root.getFolder(path);
IJavaElement element= JavaCore.create(folder);
if (element instanceof IPackageFragment)
return (IPackageFragment) element;
}
return null;
}
/*
* 1GEUSSR: ITPUI:ALL - User should never loose changes made in the editors.
* Changed behavior to make sure that if called inside a regular save (because
* of deletion of input element) there is a way to report back to the caller.
*/
protected void performSaveAs(IProgressMonitor progressMonitor) {
Shell shell= getSite().getShell();
SaveAsDialog dialog= new SaveAsDialog(shell);
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
if (dialog.open() == Dialog.CANCEL) {
if (progressMonitor != null)
progressMonitor.setCanceled(true);
return;
}
IPath filePath= dialog.getResult();
if (filePath == null) {
if (progressMonitor != null)
progressMonitor.setCanceled(true);
return;
}
filePath= filePath.removeTrailingSeparator();
final String fileName= filePath.lastSegment();
IPath folderPath= filePath.removeLastSegments(1);
if (folderPath == null) {
if (progressMonitor != null)
progressMonitor.setCanceled(true);
return;
}
IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
/*
* 1GF7WG9: ITPJUI:ALL - EXCEPTION: "Save As..." always fails
*/
final IPackageFragment fragment= getPackage(root, folderPath);
IFile file= root.getFile(filePath);
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
final FileEditorInput newInput= new FileEditorInput(file);
WorkspaceModifyOperation op= new WorkspaceModifyOperation() {
public void execute(final IProgressMonitor monitor) throws CoreException {
if (fragment != null) {
try {
IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();
ICompilationUnit unit= manager.getWorkingCopy(getEditorInput());
/*
* 1GJXY0L: ITPJUI:WINNT - NPE during save As in Java editor
* Introduced null check, just go on in the null case
*/
if (unit != null) {
/*
* 1GF5YOX: ITPJUI:ALL - Save of delete file claims it's still there
* Changed false to true.
*/
unit.copy(fragment, null, fileName, true, monitor);
return;
}
} catch (JavaModelException x) {
}
}
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
/*
* 1GF5YOX: ITPJUI:ALL - Save of delete file claims it's still there
* Changed false to true.
*/
getDocumentProvider().saveDocument(monitor, newInput, getDocumentProvider().getDocument(getEditorInput()), true);
}
};
boolean success= false;
try {
if (fragment == null)
getDocumentProvider().aboutToChange(newInput);
new ProgressMonitorDialog(shell).run(false, true, op);
setInput(newInput);
success= true;
} catch (InterruptedException x) {
} catch (InvocationTargetException x) {
/*
* 1GF5YOX: ITPJUI:ALL - Save of delete file claims it's still there
* Missing resources.
*/
Throwable t= x.getTargetException();
if (t instanceof CoreException) {
CoreException cx= (CoreException) t;
|
4,369 |
Bug 4369 F2 should work even if "Hide Text Hover" is enabled
|
- enable "Hide Text Hover" - position the cursor on a type - press F2 observe: nothing happens although I explicitly requested JavaDoc help.
|
resolved fixed
|
ce37c8c
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-26T17:37:50Z | 2001-10-11T11:33:20Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
|
ErrorDialog.openError(shell, JavaEditorMessages.getString("CompilationUnitEditor.error.saving.title2"), JavaEditorMessages.getString("CompilationUnitEditor.error.saving.message2"), cx.getStatus());
} else {
MessageDialog.openError(shell, JavaEditorMessages.getString("CompilationUnitEditor.error.saving.title3"), JavaEditorMessages.getString("CompilationUnitEditor.error.saving.message3") + t.getMessage());
}
} finally {
if (fragment == null)
getDocumentProvider().changed(newInput);
if (progressMonitor != null)
progressMonitor.setCanceled(!success);
}
}
/*
* @see AbstractTextEditor#doSetInput(IEditorInput)
*/
protected void doSetInput(IEditorInput input) throws CoreException {
super.doSetInput(input);
fJavaEditorErrorTickUpdater.setAnnotationModel(getDocumentProvider().getAnnotationModel(input));
}
private void startBracketHighlighting() {
if (fBracketHighlighter == null) {
ISourceViewer sourceViewer= getSourceViewer();
fBracketHighlighter= new BracketHighlighter(sourceViewer);
fBracketHighlighter.setHighlightColor(getColor(MATCHING_BRACKETS_COLOR));
fBracketHighlighter.install();
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.