issue_id
int64 2.04k
425k
| title
stringlengths 9
251
| body
stringlengths 4
32.8k
⌀ | status
stringclasses 6
values | after_fix_sha
stringlengths 7
7
| project_name
stringclasses 6
values | repo_url
stringclasses 6
values | repo_name
stringclasses 6
values | language
stringclasses 1
value | issue_url
null | before_fix_sha
null | pull_url
null | commit_datetime
timestamp[us, tz=UTC] | report_datetime
timestamp[us, tz=UTC] | updated_file
stringlengths 23
187
| chunk_content
stringlengths 1
22k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4,381 |
Bug 4381 Replace from local histroy - workspace element included
|
- modify a CU in the workspace - select the CU - activate "Replace from local history" - the workspace element is included in the local histroy, but a histroy never includes the actual element. I was really suprised seeing the element.
|
resolved fixed
|
5439e11
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-29T19:24:21Z | 2001-10-11T14:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/TextBufferNode.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.compare;
import java.io.*;
import org.eclipse.swt.graphics.Image;
import org.eclipse.jdt.internal.corext.codemanipulation.TextBuffer;
import org.eclipse.compare.*;
/**
* Implements the IStreamContentAccessor and ITypedElement protocols
* for a TextBuffer.
*/
class JavaTextBufferNode implements ITypedElement, IStreamContentAccessor {
|
4,381 |
Bug 4381 Replace from local histroy - workspace element included
|
- modify a CU in the workspace - select the CU - activate "Replace from local history" - the workspace element is included in the local histroy, but a histroy never includes the actual element. I was really suprised seeing the element.
|
resolved fixed
|
5439e11
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-29T19:24:21Z | 2001-10-11T14:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/TextBufferNode.java
|
private TextBuffer fBuffer;
private String fName;
JavaTextBufferNode(TextBuffer buffer, String name) {
fBuffer= buffer;
}
public String getName() {
return fName;
}
public String getType() {
return "java";
}
public Image getImage() {
return null;
}
public InputStream getContents() {
return new ByteArrayInputStream(fBuffer.getContent().getBytes());
}
}
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.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.List;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.jdt.core.IClasspathEntry;
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.jdt.internal.ui.dialogs.ISelectionValidator;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
import org.eclipse.jdt.internal.ui.preferences.JavaBasePreferencePage;
import org.eclipse.jdt.internal.ui.util.CoreUtility;
import org.eclipse.jdt.internal.ui.util.SWTUtil;
import org.eclipse.jdt.internal.ui.util.TabFolderLayout;
import org.eclipse.jdt.internal.ui.viewsupport.ImageDisposer;
import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
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.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.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.dialogfields.StringDialogField;
import org.eclipse.jdt.internal.ui.wizards.swt.MGridData;
import org.eclipse.jdt.internal.ui.wizards.swt.MGridLayout;
public class BuildPathsBlock {
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
private IWorkspaceRoot fWorkspaceRoot;
private CheckedListDialogField fClassPathList;
private StringDialogField fBuildPathDialogField;
private StatusInfo fClassPathStatus;
private StatusInfo fBuildPathStatus;
private IJavaProject fCurrJProject;
private IPath fOutputLocationPath;
private IStatusChangeListener fContext;
private Control fSWTWidget;
private boolean fIsNewProject;
private SourceContainerWorkbookPage fSourceContainerPage;
private ProjectsWorkbookPage fProjectsPage;
private LibrariesWorkbookPage fLibrariesPage;
private BuildPathBasePage fCurrPage;
public BuildPathsBlock(IWorkspaceRoot root, IStatusChangeListener context, boolean isNewProject) {
fWorkspaceRoot= root;
fContext= context;
fIsNewProject= isNewProject;
fSourceContainerPage= null;
fLibrariesPage= null;
fProjectsPage= null;
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
fCurrPage= null;
BuildPathAdapter adapter= new BuildPathAdapter();
String[] buttonLabels= new String[] {
NewWizardMessages.getString("BuildPathsBlock.classpath.up.button"),
NewWizardMessages.getString("BuildPathsBlock.classpath.down.button"),
null,
NewWizardMessages.getString("BuildPathsBlock.classpath.checkall.button"),
NewWizardMessages.getString("BuildPathsBlock.classpath.uncheckall.button")
};
fClassPathList= new CheckedListDialogField(null, buttonLabels, new CPListLabelProvider());
fClassPathList.setDialogFieldListener(adapter);
fClassPathList.setLabelText(NewWizardMessages.getString("BuildPathsBlock.classpath.label"));
fClassPathList.setUpButtonIndex(0);
fClassPathList.setDownButtonIndex(1);
fClassPathList.setCheckAllButtonIndex(3);
fClassPathList.setUncheckAllButtonIndex(4);
if (isNewProject) {
fBuildPathDialogField= new StringDialogField();
} else {
StringButtonDialogField dialogField= new StringButtonDialogField(adapter);
dialogField.setButtonLabel(NewWizardMessages.getString("BuildPathsBlock.buildpath.button"));
fBuildPathDialogField= dialogField;
}
fBuildPathDialogField.setDialogFieldListener(adapter);
fBuildPathDialogField.setLabelText(NewWizardMessages.getString("BuildPathsBlock.buildpath.label"));
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
fBuildPathStatus= new StatusInfo();
fClassPathStatus= new StatusInfo();
fCurrJProject= null;
}
public Control createControl(Composite parent) {
fSWTWidget= parent;
Composite composite= new Composite(parent, SWT.NONE);
MGridLayout layout= new MGridLayout();
layout.marginWidth= 0;
layout.minimumWidth= SWTUtil.convertWidthInCharsToPixels(80, parent);
layout.minimumHeight= SWTUtil.convertHeightInCharsToPixels(20, parent);
layout.numColumns= 1;
composite.setLayout(layout);
TabFolder folder= new TabFolder(composite, SWT.NONE);
folder.setLayout(new TabFolderLayout());
folder.setLayoutData(new MGridData(MGridData.FILL_BOTH));
folder.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
tabChanged(e.item);
}
});
ImageRegistry imageRegistry= JavaPlugin.getDefault().getImageRegistry();
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
TabItem item;
fSourceContainerPage= new SourceContainerWorkbookPage(fWorkspaceRoot, fClassPathList, fBuildPathDialogField, fIsNewProject);
item= new TabItem(folder, SWT.NONE);
item.setText(NewWizardMessages.getString("BuildPathsBlock.tab.source"));
item.setImage(imageRegistry.get(JavaPluginImages.IMG_OBJS_PACKFRAG_ROOT));
item.setData(fSourceContainerPage);
item.setControl(fSourceContainerPage.getControl(folder));
IWorkbench workbench= JavaPlugin.getDefault().getWorkbench();
Image projectImage= workbench.getSharedImages().getImage(ISharedImages.IMG_OBJ_PROJECT);
fProjectsPage= new ProjectsWorkbookPage(fClassPathList);
item= new TabItem(folder, SWT.NONE);
item.setText(NewWizardMessages.getString("BuildPathsBlock.tab.projects"));
item.setImage(projectImage);
item.setData(fProjectsPage);
item.setControl(fProjectsPage.getControl(folder));
fLibrariesPage= new LibrariesWorkbookPage(fWorkspaceRoot, fClassPathList);
item= new TabItem(folder, SWT.NONE);
item.setText(NewWizardMessages.getString("BuildPathsBlock.tab.libraries"));
item.setImage(imageRegistry.get(JavaPluginImages.IMG_OBJS_LIBRARY));
item.setData(fLibrariesPage);
item.setControl(fLibrariesPage.getControl(folder));
Image cpoImage= JavaPluginImages.DESC_TOOL_CLASSPATH_ORDER.createImage();
composite.addDisposeListener(new ImageDisposer(cpoImage));
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
ClasspathOrderingWorkbookPage ordpage= new ClasspathOrderingWorkbookPage(fClassPathList);
item= new TabItem(folder, SWT.NONE);
item.setText(NewWizardMessages.getString("BuildPathsBlock.tab.order"));
item.setImage(cpoImage);
item.setData(ordpage);
item.setControl(ordpage.getControl(folder));
if (fCurrJProject != null) {
fSourceContainerPage.init(fCurrJProject);
fLibrariesPage.init(fCurrJProject);
fProjectsPage.init(fCurrJProject);
}
Composite editorcomp= new Composite(composite, SWT.NONE);
DialogField[] editors= new DialogField[] { fBuildPathDialogField };
LayoutUtil.doDefaultLayout(editorcomp, editors, true, 0, 0, 0, 0);
int maxFieldWidth= SWTUtil.convertWidthInCharsToPixels(40, parent);
LayoutUtil.setWidthHint(fBuildPathDialogField.getTextControl(null), maxFieldWidth);
editorcomp.setLayoutData(new MGridData(MGridData.FILL_HORIZONTAL));
if (fIsNewProject) {
folder.setSelection(0);
fCurrPage= fSourceContainerPage;
} else {
folder.setSelection(3);
fCurrPage= ordpage;
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
fClassPathList.selectFirstElement();
}
WorkbenchHelp.setHelp(composite, new Object[] { IJavaHelpContextIds.BUILD_PATH_BLOCK });
return composite;
}
private Shell getShell() {
if (fSWTWidget != null) {
return fSWTWidget.getShell();
}
return JavaPlugin.getActiveWorkbenchShell();
}
/**
* Initializes the classpath for the given project. Multiple calls to init are allowed,
* but all existing settings will be cleared and replace by the given or default paths.
* @param project The java project to configure. Does not have to exist.
* @param outputLocation The output location to be set in the page. If <code>null</code>
* is passed, jdt default settings are used, or - if the project is an existing Java project - the
* output location of the existing project
* @param classpathEntries The classpath entries to be set in the page. If <code>null</code>
* is passed, jdt default settings are used, or - if the project is an existing Java project - the
* classpath entries of the existing project
*/
public void init(IJavaProject jproject, IPath outputLocation, IClasspathEntry[] classpathEntries) {
fCurrJProject= jproject;
boolean projExists= false;
try {
IProject project= fCurrJProject.getProject();
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
projExists= (project.exists() && project.hasNature(JavaCore.NATURE_ID));
if (projExists) {
if (outputLocation == null) {
outputLocation= fCurrJProject.getOutputLocation();
}
if (classpathEntries == null) {
classpathEntries= fCurrJProject.getRawClasspath();
}
}
} catch (CoreException e) {
JavaPlugin.log(e.getStatus());
}
if (outputLocation == null) {
outputLocation= getDefaultBuildPath(jproject);
}
List newClassPath;
if (classpathEntries == null) {
newClassPath= getDefaultClassPath(jproject);
} else {
newClassPath= new ArrayList();
for (int i= 0; i < classpathEntries.length; i++) {
IClasspathEntry curr= classpathEntries[i];
int entryKind= curr.getEntryKind();
IPath path= curr.getPath();
boolean isExported= curr.isExported();
IResource res= null;
boolean isMissing= false;
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
if (entryKind != IClasspathEntry.CPE_VARIABLE) {
res= fWorkspaceRoot.findMember(path);
if (res == null) {
isMissing= (entryKind != IClasspathEntry.CPE_LIBRARY || !path.toFile().isFile());
}
} else {
IPath resolvedPath= JavaCore.getResolvedVariablePath(path);
isMissing= (resolvedPath == null) || !resolvedPath.toFile().isFile();
}
CPListElement elem= new CPListElement(entryKind, path, res, curr.getSourceAttachmentPath(), curr.getSourceAttachmentRootPath(), isExported);
if (projExists) {
elem.setIsMissing(isMissing);
}
newClassPath.add(elem);
}
}
List exportedEntries = new ArrayList();
for (int i= 0; i < newClassPath.size(); i++) {
CPListElement curr= (CPListElement) newClassPath.get(i);
if (curr.isExported() || curr.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
exportedEntries.add(curr);
}
}
fBuildPathDialogField.setText(outputLocation.makeRelative().toString());
fClassPathList.setElements(newClassPath);
fClassPathList.setCheckedElements(exportedEntries);
if (fSourceContainerPage != null) {
fSourceContainerPage.init(fCurrJProject);
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
fProjectsPage.init(fCurrJProject);
fLibrariesPage.init(fCurrJProject);
}
doStatusLineUpdate();
}
/**
* Returns the Java project. Can return <code>null<code> if the page has not
* been initialized.
*/
public IJavaProject getJavaProject() {
return fCurrJProject;
}
/**
* Returns the current output location. Note that the path returned must not be valid.
*/
public IPath getOutputLocation() {
return new Path(fBuildPathDialogField.getText()).makeAbsolute();
}
/**
* Returns the current class path (raw). Note that the entries returned must not be valid.
*/
public IClasspathEntry[] getRawClassPath() {
List elements= fClassPathList.getElements();
int nElements= elements.size();
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
IClasspathEntry[] entries= new IClasspathEntry[elements.size()];
for (int i= 0; i < nElements; i++) {
CPListElement currElement= (CPListElement) elements.get(i);
entries[i]= currElement.getClasspathEntry();
}
return entries;
}
private List getDefaultClassPath(IJavaProject jproj) {
List list= new ArrayList();
IResource srcFolder;
if (JavaBasePreferencePage.useSrcAndBinFolders()) {
srcFolder= jproj.getProject().getFolder("src");
} else {
srcFolder= jproj.getProject();
}
list.add(new CPListElement(IClasspathEntry.CPE_SOURCE, srcFolder.getFullPath(), srcFolder));
IPath libPath= new Path(JavaRuntime.JRELIB_VARIABLE);
IPath attachPath= new Path(JavaRuntime.JRESRC_VARIABLE);
IPath attachRoot= new Path(JavaRuntime.JRESRCROOT_VARIABLE);
CPListElement elem= new CPListElement(IClasspathEntry.CPE_VARIABLE, libPath, null, attachPath, attachRoot, false);
list.add(elem);
return list;
}
private IPath getDefaultBuildPath(IJavaProject jproj) {
if (JavaBasePreferencePage.useSrcAndBinFolders()) {
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
return jproj.getProject().getFullPath().append("bin");
} else {
return jproj.getProject().getFullPath();
}
}
private class BuildPathAdapter implements IStringButtonAdapter, IDialogFieldListener {
public void changeControlPressed(DialogField field) {
buildPathChangeControlPressed(field);
}
public void dialogFieldChanged(DialogField field) {
buildPathDialogFieldChanged(field);
}
}
private void buildPathChangeControlPressed(DialogField field) {
if (field == fBuildPathDialogField) {
IContainer container= chooseContainer();
if (container != null) {
fBuildPathDialogField.setText(container.getFullPath().toString());
}
}
}
private void buildPathDialogFieldChanged(DialogField field) {
if (field == fClassPathList) {
updateClassPathStatus();
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
updateBuildPathStatus();
} else if (field == fBuildPathDialogField) {
updateBuildPathStatus();
}
doStatusLineUpdate();
}
private void doStatusLineUpdate() {
IStatus res= findMostSevereStatus();
fContext.statusChanged(res);
}
private IStatus findMostSevereStatus() {
return StatusUtil.getMoreSevere(fClassPathStatus, fBuildPathStatus);
}
/**
* Validates the build path.
*/
private void updateClassPathStatus() {
fClassPathStatus.setOK();
List elements= fClassPathList.getElements();
boolean entryMissing= false;
IClasspathEntry[] entries= new IClasspathEntry[elements.size()];
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
for (int i= elements.size()-1 ; i >= 0 ; i--) {
CPListElement currElement= (CPListElement)elements.get(i);
boolean isChecked= fClassPathList.isChecked(currElement);
if (currElement.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
if (!isChecked) {
fClassPathList.setCheckedWithoutUpdate(currElement, true);
}
} else {
currElement.setExported(isChecked);
}
entries[i]= currElement.getClasspathEntry();
entryMissing= entryMissing || currElement.isMissing();
}
if (entryMissing) {
fClassPathStatus.setWarning(NewWizardMessages.getString("BuildPathsBlock.warning.EntryMissing"));
}
if (fCurrJProject.hasClasspathCycle(entries)) {
fClassPathStatus.setWarning(NewWizardMessages.getString("BuildPathsBlock.warning.CycleInClassPath"));
}
}
/**
* Validates output location & build path.
*/
private void updateBuildPathStatus() {
fOutputLocationPath= null;
String text= fBuildPathDialogField.getText();
if ("".equals(text)) {
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
fBuildPathStatus.setError(NewWizardMessages.getString("BuildPathsBlock.error.EnterBuildPath"));
return;
}
IPath path= getOutputLocation();
IResource res= fWorkspaceRoot.findMember(path);
if (res != null) {
if (res.getType() == IResource.FILE) {
fBuildPathStatus.setError(NewWizardMessages.getString("BuildPathsBlock.error.InvalidBuildPath"));
return;
}
} else {
IPath projPath= path.uptoSegment(1);
if (!projPath.equals(fCurrJProject.getProject().getFullPath())) {
IProject proj= (IProject)fWorkspaceRoot.findMember(projPath);
if (proj == null || !proj.isOpen()) {
fBuildPathStatus.setError(NewWizardMessages.getString("BuildPathsBlock.error.BuildPathProjNotExists"));
return;
}
}
}
fOutputLocationPath= path;
List elements= fClassPathList.getElements();
IClasspathEntry[] entries= new IClasspathEntry[elements.size()];
for (int i= elements.size()-1 ; i >= 0 ; i--) {
CPListElement currElement= (CPListElement)elements.get(i);
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
entries[i]= currElement.getClasspathEntry();
}
IStatus status= JavaConventions.validateClasspath(fCurrJProject, entries, path);
if (!status.isOK()) {
fBuildPathStatus.setError(status.getMessage());
return;
}
fBuildPathStatus.setOK();
}
/**
* Creates a runnable that sets the configured build paths.
*/
public IRunnableWithProgress getRunnable() {
final List classPathEntries= fClassPathList.getElements();
final IPath path= getOutputLocation();
return new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
if (monitor == null) {
monitor= new NullProgressMonitor();
}
monitor.beginTask(NewWizardMessages.getString("BuildPathsBlock.operationdesc"), 12);
try {
createJavaProject(classPathEntries, path, monitor);
} catch (CoreException e) {
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
throw new InvocationTargetException(e);
} finally {
monitor.done();
}
}
};
}
/**
* Creates the Java project and sets the configured build path and output location.
* If the project already exists only build paths are updated.
*/
private void createJavaProject(List classPathEntries, IPath buildPath, IProgressMonitor monitor) throws CoreException {
IProject project= fCurrJProject.getProject();
if (!project.exists()) {
project.create(null);
}
if (!project.isOpen()) {
project.open(null);
}
if (!project.hasNature(JavaCore.NATURE_ID)) {
addNatureToProject(project, JavaCore.NATURE_ID, null);
}
monitor.worked(1);
String[] prevRequiredProjects= fCurrJProject.getRequiredProjectNames();
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
if (!fWorkspaceRoot.exists(buildPath)) {
IFolder folder= fWorkspaceRoot.getFolder(buildPath);
CoreUtility.createFolder(folder, true, true, null);
}
monitor.worked(1);
fCurrJProject.setOutputLocation(buildPath, new SubProgressMonitor(monitor, 3));
int nEntries= classPathEntries.size();
IClasspathEntry[] classpath= new IClasspathEntry[nEntries];
for (int i= 0; i < nEntries; i++) {
CPListElement entry= ((CPListElement)classPathEntries.get(i));
IResource res= entry.getResource();
if ((res instanceof IFolder) && !res.exists()) {
CoreUtility.createFolder((IFolder)res, true, true, null);
}
classpath[i]= entry.getClasspathEntry();
}
monitor.worked(1);
fCurrJProject.setRawClasspath(classpath, new SubProgressMonitor(monitor, 5));
}
/**
* Adds a nature to a project
*/
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
private static void addNatureToProject(IProject proj, String natureId, IProgressMonitor monitor) throws CoreException {
IProjectDescription description = proj.getDescription();
String[] prevNatures= description.getNatureIds();
String[] newNatures= new String[prevNatures.length + 1];
System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
newNatures[prevNatures.length]= natureId;
description.setNatureIds(newNatures);
proj.setDescription(description, monitor);
}
private IContainer chooseContainer() {
Class[] acceptedClasses= new Class[] { IProject.class, IFolder.class };
ISelectionValidator validator= new TypedElementSelectionValidator(acceptedClasses, false);
IProject[] allProjects= fWorkspaceRoot.getProjects();
ArrayList rejectedElements= new ArrayList(allProjects.length);
IProject currProject= fCurrJProject.getProject();
for (int i= 0; i < allProjects.length; i++) {
if (!allProjects[i].equals(currProject)) {
rejectedElements.add(allProjects[i]);
}
}
ViewerFilter filter= new TypedViewerFilter(acceptedClasses, rejectedElements.toArray());
ILabelProvider lp= new WorkbenchLabelProvider();
ITreeContentProvider cp= new WorkbenchContentProvider();
IResource initSelection= null;
if (fOutputLocationPath != null) {
initSelection= fWorkspaceRoot.findMember(fOutputLocationPath);
}
|
4,974 |
Bug 4974 Set classpath / output location should be one operation
|
204: 1. create a project with 'src' as source folder and 'bin' as output location. 2. in the project properties change the setting to use the project as source folder and the project as output location. Press Ok You get the error message: 'Cannot nest outputfolder /xy in source folder /xy/src' The problem is that setting outputlocation and classpath are two operations. By setting the first, an illegal state is created. -> Like the validation (checking classpath and outputlocation at once), the setting of classpath / output location should be offered as one operation. Note that the error message is strange. I guess it should say: '/xy/src' can not be nested in '/xy'
|
resolved fixed
|
35d95cb
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-11-30T15:01:58Z | 2001-10-15T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
|
ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(getShell(), lp, cp);
dialog.setTitle(NewWizardMessages.getString("BuildPathsBlock.ChooseOutputFolderDialog.title"));
dialog.setValidator(validator);
dialog.setMessage(NewWizardMessages.getString("BuildPathsBlock.ChooseOutputFolderDialog.description"));
dialog.addFilter(filter);
dialog.setInput(fWorkspaceRoot);
dialog.setInitialSelection(initSelection);
if (dialog.open() == dialog.OK) {
return (IContainer)dialog.getFirstResult();
}
return null;
}
private void tabChanged(Widget widget) {
if (widget instanceof TabItem) {
BuildPathBasePage newPage= (BuildPathBasePage) ((TabItem) widget).getData();
if (fCurrPage != null) {
List selection= fCurrPage.getSelection();
if (!selection.isEmpty()) {
newPage.setSelection(selection);
}
}
fCurrPage= newPage;
}
}
}
|
6,536 |
Bug 6536 Add Javadoc on field in TH does nothing
|
1. Select a field in the Type Hierarchy view 2. From its context menu select "Add Javadoc" ==> nothing happens. Either this menu should be removed or (preferably) the action should add the fields Javadoc.
|
verified fixed
|
49752b4
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T10:43:34Z | 2001-12-04T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddJavaDocStubAction.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.actions;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.viewers.ISelection;
|
6,536 |
Bug 6536 Add Javadoc on field in TH does nothing
|
1. Select a field in the Type Hierarchy view 2. From its context menu select "Add Javadoc" ==> nothing happens. Either this menu should be removed or (preferably) the action should add the fields Javadoc.
|
verified fixed
|
49752b4
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T10:43:34Z | 2001-12-04T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddJavaDocStubAction.java
|
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.corext.codegeneration.AddJavaDocStubOperation;
import org.eclipse.jdt.internal.corext.codegeneration.CodeGenerationSettings;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
/**
* Create Java Doc Stubs for selected members
* Always forces the he field to be in an open editor. The result is unsaved,
* so the user can decide if he wnats to accept the changes
*/
public class AddJavaDocStubAction extends Action {
private ISelectionProvider fSelectionProvider;
public AddJavaDocStubAction(ISelectionProvider selProvider) {
super(JavaUIMessages.getString("AddJavaDocStubAction.label"));
setDescription(JavaUIMessages.getString("AddJavaDocStubAction.description"));
setToolTipText(JavaUIMessages.getString("AddJavaDocStubAction.tooltip"));
fSelectionProvider= selProvider;
}
public void run() {
IMember[] members= getSelectedMembers();
if (members == null || members.length == 0) {
return;
}
|
6,536 |
Bug 6536 Add Javadoc on field in TH does nothing
|
1. Select a field in the Type Hierarchy view 2. From its context menu select "Add Javadoc" ==> nothing happens. Either this menu should be removed or (preferably) the action should add the fields Javadoc.
|
verified fixed
|
49752b4
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T10:43:34Z | 2001-12-04T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddJavaDocStubAction.java
|
try {
ICompilationUnit cu= members[0].getCompilationUnit();
IEditorPart editor= EditorUtility.openInEditor(cu);
ICompilationUnit workingCopyCU;
IMember[] workingCopyMembers;
if (cu.isWorkingCopy()) {
workingCopyCU= cu;
workingCopyMembers= members;
} else {
workingCopyCU= EditorUtility.getWorkingCopy(cu);
if (workingCopyCU == null) {
showError(JavaUIMessages.getString("AddJavaDocStubsAction.error.noWorkingCopy"));
return;
}
workingCopyMembers= new IMember[members.length];
for (int i= 0; i < members.length; i++) {
IMember member= members[i];
IMember workingCopyMember= (IMember) JavaModelUtil.findMemberInCompilationUnit(workingCopyCU, member);
if (workingCopyMember == null) {
showError(JavaUIMessages.getFormattedString("AddJavaDocStubsAction.error.memberNotExisting", member.getElementName()));
return;
}
workingCopyMembers[i]= workingCopyMember;
}
}
|
6,536 |
Bug 6536 Add Javadoc on field in TH does nothing
|
1. Select a field in the Type Hierarchy view 2. From its context menu select "Add Javadoc" ==> nothing happens. Either this menu should be removed or (preferably) the action should add the fields Javadoc.
|
verified fixed
|
49752b4
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T10:43:34Z | 2001-12-04T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddJavaDocStubAction.java
|
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
AddJavaDocStubOperation op= new AddJavaDocStubOperation(workingCopyMembers, settings);
ProgressMonitorDialog dialog= new ProgressMonitorDialog(JavaPlugin.getActiveWorkbenchShell());
dialog.run(false, true, new WorkbenchRunnableWrapper(op));
EditorUtility.revealInEditor(editor, members[0]);
} catch (InvocationTargetException e) {
JavaPlugin.log(e);
showError(JavaUIMessages.getString("AddJavaDocStubsAction.error.actionFailed"));
} catch (InterruptedException e) {
} catch (CoreException e) {
JavaPlugin.log(e.getStatus());
showError(JavaUIMessages.getString("AddJavaDocStubsAction.error.actionFailed"));
return;
}
}
private void showError(String message) {
Shell shell= JavaPlugin.getActiveWorkbenchShell();
String title= JavaUIMessages.getString("AddJavaDocStubsAction.error.dialogTitle");
MessageDialog.openError(shell, title, message);
}
private IMember[] getSelectedMembers() {
ISelection sel= fSelectionProvider.getSelection();
if (sel instanceof IStructuredSelection) {
List elements= ((IStructuredSelection)sel).toList();
int nElements= elements.size();
if (nElements > 0) {
|
6,536 |
Bug 6536 Add Javadoc on field in TH does nothing
|
1. Select a field in the Type Hierarchy view 2. From its context menu select "Add Javadoc" ==> nothing happens. Either this menu should be removed or (preferably) the action should add the fields Javadoc.
|
verified fixed
|
49752b4
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T10:43:34Z | 2001-12-04T10:00:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/AddJavaDocStubAction.java
|
IMember[] res= new IMember[nElements];
ICompilationUnit cu= null;
for (int i= 0; i < nElements; i++) {
Object curr= elements.get(i);
if (curr instanceof IMember) {
IMember member= (IMember)curr;
if (i == 0) {
cu= member.getCompilationUnit();
if (cu == null) {
return null;
}
} else if (!cu.equals(member.getCompilationUnit())) {
return null;
}
res[i]= member;
} else {
return null;
}
}
return res;
}
}
return null;
}
public boolean canActionBeAdded() {
return getSelectedMembers() != null;
}
}
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
package org.eclipse.jdt.internal.ui.javaeditor;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Item;
import org.eclipse.swt.widgets.Menu;
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.util.ListenerList;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.part.Page;
import org.eclipse.ui.texteditor.IUpdate;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import org.eclipse.jdt.core.ElementChangedEvent;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IElementChangedListener;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaElement;
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
import org.eclipse.jdt.core.IJavaElementDelta;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IParent;
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.ISourceReference;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.IContextMenuConstants;
import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.actions.ContextMenuGroup;
import org.eclipse.jdt.internal.ui.actions.GenerateGroup;
import org.eclipse.jdt.internal.ui.actions.OpenHierarchyPerspectiveItem;
import org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringGroup;
import org.eclipse.jdt.internal.ui.reorg.DeleteAction;
import org.eclipse.jdt.internal.ui.reorg.ReorgGroup;
import org.eclipse.jdt.internal.ui.search.JavaSearchGroup;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil;
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementSorter;
import org.eclipse.jdt.internal.ui.viewsupport.StatusBarUpdater;
/**
* The content outline page of the Java editor. The viewer implements a proprietary
* update mechanism based on Java model deltas. It does not react on domain changes.
* It is specified to show the content of ICompilationUnits and IClassFiles.
*/
class JavaOutlinePage extends Page implements IContentOutlinePage {
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
/**
* The element change listener of the java outline viewer.
* @see IElementChangedListener
*/
class ElementChangedListener implements IElementChangedListener {
public void elementChanged(final ElementChangedEvent e) {
Display d= getControl().getDisplay();
if (d != null) {
d.asyncExec(new Runnable() {
public void run() {
IJavaElementDelta delta= findElement( (ICompilationUnit) fInput, e.getDelta());
if (delta != null && fOutlineViewer != null) {
fOutlineViewer.reconcile(delta);
}
}
});
}
}
protected IJavaElementDelta findElement(ICompilationUnit unit, IJavaElementDelta delta) {
if (delta == null || unit == null)
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
return null;
IJavaElement element= delta.getElement();
if (unit.equals(element))
return delta;
if (element.getElementType() > IJavaElement.CLASS_FILE)
return null;
IJavaElementDelta[] children= delta.getAffectedChildren();
if (children == null || children.length == 0)
return null;
for (int i= 0; i < children.length; i++) {
IJavaElementDelta d= findElement(unit, children[i]);
if (d != null)
return d;
}
return null;
}
};
/**
* Content provider for the children of an ICompilationUnit or
* an IClassFile
* @see ITreeContentProvider
*/
class ChildrenProvider implements ITreeContentProvider {
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
private ElementChangedListener fListener;
private JavaOutlineErrorTickUpdater fErrorTickUpdater;
protected boolean matches(IJavaElement element) {
if (element.getElementType() == IJavaElement.METHOD) {
String name= element.getElementName();
return (name != null && name.indexOf('<') >= 0);
}
return false;
}
protected IJavaElement[] filter(IJavaElement[] children) {
boolean initializers= false;
for (int i= 0; i < children.length; i++) {
if (matches(children[i])) {
initializers= true;
break;
}
}
if (!initializers)
return children;
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
Vector v= new Vector();
for (int i= 0; i < children.length; i++) {
if (matches(children[i]))
continue;
v.addElement(children[i]);
}
IJavaElement[] result= new IJavaElement[v.size()];
v.copyInto(result);
return result;
}
public Object[] getChildren(Object parent) {
if (parent instanceof IParent) {
IParent c= (IParent) parent;
try {
return filter(c.getChildren());
} catch (JavaModelException x) {
JavaPlugin.getDefault().logErrorStatus(JavaEditorMessages.getString("JavaOutlinePage.error.ChildrenProvider.getChildren.message1"), x.getStatus());
}
}
return new Object[0];
}
public Object[] getElements(Object parent) {
return getChildren(parent);
}
public Object getParent(Object child) {
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
if (child instanceof IJavaElement) {
IJavaElement e= (IJavaElement) child;
return e.getParent();
}
return null;
}
public boolean hasChildren(Object parent) {
if (parent instanceof IParent) {
IParent c= (IParent) parent;
try {
IJavaElement[] children= filter(c.getChildren());
return (children != null && children.length > 0);
} catch (JavaModelException x) {
JavaPlugin.getDefault().logErrorStatus(JavaEditorMessages.getString("JavaOutlinePage.error.ChildrenProvider.hasChildren.message1"), x.getStatus());
}
}
return false;
}
public boolean isDeleted(Object o) {
return false;
}
public void dispose() {
if (fListener != null) {
JavaCore.removeElementChangedListener(fListener);
fListener= null;
}
if (fErrorTickUpdater != null) {
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
fErrorTickUpdater.setAnnotationModel(null);
fErrorTickUpdater= null;
}
}
/**
* @see IContentProvider#inputChanged(Viewer, Object, Object)
*/
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
boolean isCU= (newInput instanceof ICompilationUnit);
if (isCU && fListener == null) {
fListener= new ElementChangedListener();
JavaCore.addElementChangedListener(fListener);
fErrorTickUpdater= new JavaOutlineErrorTickUpdater(fOutlineViewer);
fErrorTickUpdater.setAnnotationModel(fEditor.getDocumentProvider().getAnnotationModel(fEditor.getEditorInput()));
} else if (isCU && fErrorTickUpdater != null) {
fErrorTickUpdater.setAnnotationModel(fEditor.getDocumentProvider().getAnnotationModel(fEditor.getEditorInput()));
} else if (!isCU && fListener != null) {
JavaCore.removeElementChangedListener(fListener);
fListener= null;
fErrorTickUpdater.setAnnotationModel(null);
fErrorTickUpdater= null;
}
}
};
class JavaOutlineViewer extends TreeViewer {
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
/**
* Indicates an item which has been reused. At the point of
* its reuse it has been expanded. This field is used to
* communicate between <code>internalExpandToLevel</code> and
* <code>reuseTreeItem</code>.
*/
private Item fReusedExpandedItem;
public JavaOutlineViewer(Tree tree) {
super(tree);
setAutoExpandLevel(ALL_LEVELS);
}
/**
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
* Investigates the given element change event and if affected incrementally
* updates the outline.
*/
public void reconcile(IJavaElementDelta delta) {
if (getSorter() == null) {
Widget w= findItem(fInput);
if (w != null)
update(w, delta);
} else {
refresh();
}
}
/**
* @see TreeViewer#internalExpandToLevel
*/
protected void internalExpandToLevel(Widget node, int level) {
if (node instanceof Item) {
Item i= (Item) node;
if (i.getData() instanceof IJavaElement) {
IJavaElement je= (IJavaElement) i.getData();
if (je.getElementType() == IJavaElement.IMPORT_CONTAINER || isInnerType(je)) {
if (i != fReusedExpandedItem) {
setExpanded(i, false);
return;
}
}
}
}
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
super.internalExpandToLevel(node, level);
}
protected void reuseTreeItem(Item item, Object element) {
Item[] c= getChildren(item);
if (c != null && c.length > 0) {
if (getExpanded(item))
fReusedExpandedItem= item;
for (int k= 0; k < c.length; k++) {
if (c[k].getData() != null)
disassociate(c[k]);
c[k].dispose();
}
}
updateItem(item, element);
updatePlus(item, element);
internalExpandToLevel(item, ALL_LEVELS);
fReusedExpandedItem= null;
}
/**
* @see TreeViewer#createTreeItem
*/
protected void createTreeItem(Widget parent, Object element, int ix) {
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
Item[] children= getChildren(parent);
boolean expand= (parent instanceof Item && (children == null || children.length == 0));
Item item= newItem(parent, SWT.NULL, ix);
updateItem(item, element);
updatePlus(item, element);
if (expand)
setExpanded((Item) parent, true);
internalExpandToLevel(item, ALL_LEVELS);
}
protected boolean mustUpdateParent(IJavaElementDelta delta, IJavaElement element) {
if (element instanceof IMethod) {
if ((delta.getKind() & IJavaElementDelta.ADDED) != 0) {
try {
return JavaModelUtil.isMainMethod((IMethod)element);
} catch (JavaModelException e) {
JavaPlugin.log(e.getStatus());
}
}
return "main".equals(element.getElementName());
}
return false;
}
protected ISourceRange getSourceRange(IJavaElement element) throws JavaModelException {
if (element instanceof IMember)
return ((IMember) element).getNameRange();
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
if (element instanceof ISourceReference)
return ((ISourceReference) element).getSourceRange();
return null;
}
protected boolean overlaps(ISourceRange range, int start, int end) {
return start <= (range.getOffset() + range.getLength() - 1) && range.getOffset() <= end;
}
protected boolean filtered(IJavaElement parent, IJavaElement child) {
Object[] result= new Object[] { child };
ViewerFilter[] filters= getFilters();
for (int i= 0; i < filters.length; i++) {
result= filters[i].filter(this, parent, result);
if (result.length == 0)
return true;
}
return false;
}
protected void update(Widget w, IJavaElementDelta delta) {
Item item;
Object element;
IJavaElement parent= delta.getElement();
IJavaElementDelta[] affected= delta.getAffectedChildren();
Item[] children= getChildren(w);
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
boolean doUpdateParent= false;
Vector deletions= new Vector();
Vector additions= new Vector();
go1: for (int i= 0; i < children.length; i++) {
item= children[i];
element= item.getData();
for (int j= 0; j < affected.length; j++) {
IJavaElement affectedElement= affected[j].getElement();
int status= affected[j].getKind();
if (affectedElement.equals(element)) {
if ((status & IJavaElementDelta.REMOVED) != 0) {
deletions.addElement(item);
doUpdateParent= doUpdateParent || mustUpdateParent(affected[j], affectedElement);
continue go1;
}
if ((status & IJavaElementDelta.CHANGED) != 0) {
int change= affected[j].getFlags();
doUpdateParent= doUpdateParent || mustUpdateParent(affected[j], affectedElement);
if ((change & IJavaElementDelta.F_MODIFIERS) != 0) {
if (filtered(parent, affectedElement))
deletions.addElement(item);
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
else
updateItem(item, affectedElement);
}
if ((change & IJavaElementDelta.F_CONTENT) != 0)
updateItem(item, affectedElement);
if ((change & IJavaElementDelta.F_CHILDREN) != 0)
update(item, affected[j]);
continue go1;
}
} else {
if ((status & IJavaElementDelta.CHANGED) != 0 &&
(affected[j].getFlags() & IJavaElementDelta.F_MODIFIERS) != 0 &&
!filtered(parent, affectedElement))
additions.addElement(affected[j]);
}
}
}
IJavaElementDelta[] add= delta.getAddedChildren();
if (additions.size() > 0) {
IJavaElementDelta[] tmp= new IJavaElementDelta[add.length + additions.size()];
System.arraycopy(add, 0, tmp, 0, add.length);
for (int i= 0; i < additions.size(); i++)
tmp[i + add.length]= (IJavaElementDelta) additions.elementAt(i);
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
add= tmp;
}
go2: for (int i= 0; i < add.length; i++) {
try {
IJavaElement e= add[i].getElement();
if (filtered(parent, e))
continue go2;
doUpdateParent= doUpdateParent || mustUpdateParent(add[i], e);
ISourceRange rng= getSourceRange(e);
int start= rng.getOffset();
int end= start + rng.getLength() - 1;
Item last= null;
item= null;
children= getChildren(w);
for (int j= 0; j < children.length; j++) {
item= children[j];
IJavaElement r= (IJavaElement) item.getData();
if (r == null) {
continue go2;
}
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
try {
rng= getSourceRange(r);
if (overlaps(rng, start, end)) {
reuseTreeItem(item, e);
continue go2;
} else if (rng.getOffset() > start) {
if (last != null && deletions.contains(last)) {
deletions.removeElement(last);
reuseTreeItem(last, (Object) e);
} else {
createTreeItem(w, (Object) e, j);
}
continue go2;
}
} catch (JavaModelException x) {
}
last= item;
}
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
if (last != null && deletions.contains(last)) {
deletions.removeElement(last);
reuseTreeItem(last, e);
} else {
createTreeItem(w, e, -1);
}
} catch (JavaModelException x) {
}
}
Enumeration e= deletions.elements();
while (e.hasMoreElements()) {
item= (Item) e.nextElement();
disassociate(item);
item.dispose();
}
if (doUpdateParent)
updateItem(w, delta.getElement());
}
};
class LexicalSortingAction extends Action {
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
private JavaElementSorter fSorter= new JavaElementSorter();
public LexicalSortingAction() {
super();
setText(JavaEditorMessages.getString("JavaOutlinePage.Sort.label"));
JavaPluginImages.setLocalImageDescriptors(this, "alphab_sort_co.gif");
boolean checked= JavaPlugin.getDefault().getPreferenceStore().getBoolean("LexicalSortingAction.isChecked");
valueChanged(checked, false);
}
public void run() {
valueChanged(isChecked(), true);
}
private void valueChanged(boolean on, boolean store) {
setChecked(on);
fOutlineViewer.setSorter(on ? fSorter : null);
setToolTipText(on ? JavaEditorMessages.getString("JavaOutlinePage.Sort.tooltip.checked") : JavaEditorMessages.getString("JavaOutlinePage.Sort.tooltip.unchecked"));
setDescription(on ? JavaEditorMessages.getString("JavaOutlinePage.Sort.description.checked") : JavaEditorMessages.getString("JavaOutlinePage.Sort.description.unchecked"));
if (store)
JavaPlugin.getDefault().getPreferenceStore().setValue("LexicalSortingAction.isChecked", on);
}
};
class FieldFilter extends ViewerFilter {
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
public boolean select(Viewer viewer, Object parentElement, Object element) {
return !(element instanceof IField);
}
};
class VisibilityFilter extends ViewerFilter {
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
public final static int PUBLIC= 0;
public final static int PROTECTED= 1;
public final static int PRIVATE= 2;
public final static int DEFAULT= 3;
public final static int NOT_STATIC= 4;
private int fVisibility;
public VisibilityFilter(int visibility) {
fVisibility= visibility;
}
/*
* 1GEWBY4: ITPJUI:ALL - filtering incorrect on interfaces.
*/
private boolean belongsToInterface(IMember member) {
IType type= member.getDeclaringType();
if (type != null) {
try {
return type.isInterface();
} catch (JavaModelException x) {
}
}
return false;
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
}
public boolean select(Viewer viewer, Object parentElement, Object element) {
if ( !(element instanceof IMember))
return true;
if (element instanceof IType) {
IType type= (IType) element;
IJavaElement parent= type.getParent();
if (parent == null)
return true;
int elementType= parent.getElementType();
if (elementType == IJavaElement.COMPILATION_UNIT || elementType == IJavaElement.CLASS_FILE)
return true;
}
IMember member= (IMember) element;
try {
int flags= member.getFlags();
switch (fVisibility) {
case PUBLIC:
return Flags.isPublic(flags) || belongsToInterface(member);
case PROTECTED:
return Flags.isProtected(flags);
case PRIVATE:
return Flags.isPrivate(flags);
case DEFAULT: {
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
boolean dflt= !(Flags.isPublic(flags) || Flags.isProtected(flags) || Flags.isPrivate(flags));
return dflt ? !belongsToInterface(member) : dflt;
}
case NOT_STATIC:
return !Flags.isStatic(flags);
}
} catch (JavaModelException x) {
}
return false;
}
};
class FilterAction extends Action {
private ViewerFilter fFilter;
private String fCheckedDesc;
private String fUncheckedDesc;
private String fCheckedTooltip;
private String fUncheckedTooltip;
private String fPreferenceKey;
public FilterAction(ViewerFilter filter, String label, String checkedDesc, String uncheckedDesc, String checkedTooltip, String uncheckedTooltip, String prefKey) {
super();
fFilter= filter;
setText(label);
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
fCheckedDesc= checkedDesc;
fUncheckedDesc= uncheckedDesc;
fCheckedTooltip= checkedTooltip;
fUncheckedTooltip= uncheckedTooltip;
fPreferenceKey= prefKey;
boolean checked= JavaPlugin.getDefault().getPreferenceStore().getBoolean(fPreferenceKey);
valueChanged(checked, false);
}
public void run() {
valueChanged(isChecked(), true);
}
private void valueChanged(boolean on, boolean store) {
setChecked(on);
if (on) {
fOutlineViewer.addFilter(fFilter);
setToolTipText(fCheckedTooltip);
setDescription(fCheckedDesc);
} else {
fOutlineViewer.removeFilter(fFilter);
setToolTipText(fUncheckedTooltip);
setDescription(fUncheckedDesc);
}
if (store)
JavaPlugin.getDefault().getPreferenceStore().setValue(fPreferenceKey, on);
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
}
};
private IJavaElement fInput;
private String fContextMenuID;
private Menu fMenu;
private JavaOutlineViewer fOutlineViewer;
private JavaEditor fEditor;
private ListenerList fSelectionChangedListeners= new ListenerList();
private Hashtable fActions= new Hashtable();
private ContextMenuGroup[] fActionGroups;
public JavaOutlinePage(String contextMenuID, JavaEditor editor) {
super();
Assert.isNotNull(editor);
fContextMenuID= contextMenuID;
fEditor= editor;
}
private void fireSelectionChanged(ISelection selection) {
SelectionChangedEvent event= new SelectionChangedEvent(this, selection);
Object[] listeners= fSelectionChangedListeners.getListeners();
for (int i= 0; i < listeners.length; ++i)
((ISelectionChangedListener) listeners[i]).selectionChanged(event);
}
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
/**
* @see IPage#createControl
*/
public void createControl(Composite parent) {
Tree tree= new Tree(parent, SWT.MULTI);
JavaElementLabelProvider lprovider= new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_PARAMETERS | JavaElementLabelProvider.SHOW_OVERLAY_ICONS | JavaElementLabelProvider.SHOW_TYPE);
fOutlineViewer= new JavaOutlineViewer(tree);
fOutlineViewer.setContentProvider(new ChildrenProvider());
fOutlineViewer.setLabelProvider(lprovider);
MenuManager manager= new MenuManager(fContextMenuID, fContextMenuID);
manager.setRemoveAllWhenShown(true);
manager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
contextMenuAboutToShow(manager);
}
});
fMenu= manager.createContextMenu(tree);
tree.setMenu(fMenu);
fActionGroups= new ContextMenuGroup[] { new GenerateGroup(), new JavaSearchGroup(), new ReorgGroup() };
fOutlineViewer.setInput(fInput);
fOutlineViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent e) {
fireSelectionChanged(e.getSelection());
}
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
});
fOutlineViewer.getControl().addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
handleKeyPressed(e);
}
});
}
public void dispose() {
if (fEditor == null)
return;
fEditor.outlinePageClosed();
fEditor= null;
Object[] listeners= fSelectionChangedListeners.getListeners();
for (int i= 0; i < listeners.length; i++)
fSelectionChangedListeners.remove(listeners[i]);
fSelectionChangedListeners= null;
if (fMenu != null && !fMenu.isDisposed()) {
fMenu.dispose();
fMenu= null;
}
super.dispose();
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
}
public Control getControl() {
if (fOutlineViewer != null)
return fOutlineViewer.getControl();
return null;
}
public void setInput(IJavaElement inputElement) {
fInput= inputElement;
if (fOutlineViewer != null)
fOutlineViewer.setInput(fInput);
}
public void select(ISourceReference reference) {
if (fOutlineViewer != null) {
ISelection s= StructuredSelection.EMPTY;
if (reference != null)
s= new StructuredSelection(reference);
fOutlineViewer.setSelection(s, true);
}
}
public void setAction(String actionID, IAction action) {
Assert.isNotNull(actionID);
if (action == null)
fActions.remove(actionID);
else
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
fActions.put(actionID, action);
}
public IAction getAction(String actionID) {
Assert.isNotNull(actionID);
return (IAction) fActions.get(actionID);
}
/**
* Convenience method to add the action installed under the given actionID to the
* specified group of the menu.
*/
protected void addAction(IMenuManager menu, String group, String actionID) {
IAction action= getAction(actionID);
if (action != null) {
if (action instanceof IUpdate)
((IUpdate) action).update();
if (action.isEnabled()) {
IMenuManager subMenu= menu.findMenuUsingPath(group);
if (subMenu != null)
subMenu.add(action);
else
menu.appendToGroup(group, action);
}
}
}
private void addRefactoring(IMenuManager menu){
MenuManager refactoring= new MenuManager(JavaEditorMessages.getString("JavaOutlinePage.ContextMenu.refactoring.label"));
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
ContextMenuGroup.add(refactoring, new ContextMenuGroup[] { new RefactoringGroup() }, fOutlineViewer);
if (!refactoring.isEmpty())
menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, refactoring);
}
private void addOpenPerspectiveItem(IMenuManager menu) {
ISelection s= getSelection();
if (s.isEmpty() || ! (s instanceof IStructuredSelection))
return;
IStructuredSelection selection= (IStructuredSelection)s;
if (selection.size() != 1)
return;
Object element= selection.getFirstElement();
if (!(element instanceof IType))
return;
IType[] input= {(IType)element};
IWorkbenchWindow w= JavaPlugin.getActiveWorkbenchWindow();
menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, new OpenHierarchyPerspectiveItem(w, input));
}
protected void contextMenuAboutToShow(IMenuManager menu) {
JavaPlugin.createStandardGroups(menu);
if (OrganizeImportsAction.canActionBeAdded(getSelection())) {
addAction(menu, IContextMenuConstants.GROUP_REORGANIZE, "OrganizeImports");
}
addAction(menu, IContextMenuConstants.GROUP_OPEN, "OpenImportDeclaration");
addAction(menu, IContextMenuConstants.GROUP_OPEN, "OpenSuperImplementation");
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
addAction(menu, IContextMenuConstants.GROUP_SHOW, "ShowInPackageView");
addAction(menu, IContextMenuConstants.GROUP_REORGANIZE, "ReplaceWithEdition");
addAction(menu, IContextMenuConstants.GROUP_REORGANIZE, "AddEdition");
addAction(menu, IContextMenuConstants.GROUP_ADDITIONS, "AddMethodEntryBreakpoint");
addAction(menu, IContextMenuConstants.GROUP_ADDITIONS, "AddWatchpoint");
ContextMenuGroup.add(menu, fActionGroups, fOutlineViewer);
addRefactoring(menu);
addOpenPerspectiveItem(menu);
}
/**
* @see Page#setFocus()
*/
public void setFocus() {
if (fOutlineViewer != null)
fOutlineViewer.getControl().setFocus();
}
/**
* @see Page#makeContributions(IMenuManager, IToolBarManager, IStatusLineManager)
*/
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
if (statusLineManager != null) {
StatusBarUpdater updater= new StatusBarUpdater(statusLineManager);
addSelectionChangedListener(updater);
}
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
Action action= new LexicalSortingAction();
toolBarManager.add(action);
action= new FilterAction(new FieldFilter(), JavaEditorMessages.getString("JavaOutlinePage.HideFields.label"), JavaEditorMessages.getString("JavaOutlinePage.HideFields.description.checked"), JavaEditorMessages.getString("JavaOutlinePage.HideFields.description.unchecked"), JavaEditorMessages.getString("JavaOutlinePage.HideFields.tooltip.checked"), JavaEditorMessages.getString("JavaOutlinePage.HideFields.tooltip.unchecked"), "HideFields.isChecked");
JavaPluginImages.setLocalImageDescriptors(action, "fields_co.gif");
toolBarManager.add(action);
action= new FilterAction(new VisibilityFilter(VisibilityFilter.NOT_STATIC), JavaEditorMessages.getString("JavaOutlinePage.HideStaticMembers.label"), JavaEditorMessages.getString("JavaOutlinePage.HideStaticMembers.description.checked"), JavaEditorMessages.getString("JavaOutlinePage.HideStaticMembers.description.unchecked"), JavaEditorMessages.getString("JavaOutlinePage.HideStaticMembers.tooltip.checked"), JavaEditorMessages.getString("JavaOutlinePage.HideStaticMembers.tooltip.unchecked"), "HideStaticMembers.isChecked");
JavaPluginImages.setLocalImageDescriptors(action, "static_co.gif");
toolBarManager.add(action);
action= new FilterAction(new VisibilityFilter(VisibilityFilter.PUBLIC), JavaEditorMessages.getString("JavaOutlinePage.HideNonePublicMembers.label"), JavaEditorMessages.getString("JavaOutlinePage.HideNonePublicMembers.description.checked"), JavaEditorMessages.getString("JavaOutlinePage.HideNonePublicMembers.description.unchecked"), JavaEditorMessages.getString("JavaOutlinePage.HideNonePublicMembers.tooltip.checked"), JavaEditorMessages.getString("JavaOutlinePage.HideNonePublicMembers.tooltip.unchecked"), "HideNonePublicMembers.isChecked");
JavaPluginImages.setLocalImageDescriptors(action, "public_co.gif");
toolBarManager.add(action);
}
/**
* @see ISelectionProvider#addSelectionChangedListener(ISelectionChangedListener)
*/
public void addSelectionChangedListener(ISelectionChangedListener listener) {
fSelectionChangedListeners.add(listener);
}
/**
* @see ISelectionProvider#removeSelectionChangedListener(ISelectionChangedListener)
*/
public void removeSelectionChangedListener(ISelectionChangedListener listener) {
fSelectionChangedListeners.remove(listener);
}
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
/**
* @see ISelectionProvider#getSelection()
*/
public ISelection getSelection() {
if (fOutlineViewer == null)
return StructuredSelection.EMPTY;
return fOutlineViewer.getSelection();
}
/**
* @see ISelectionProvider#setSelection(ISelection)
*/
public void setSelection(ISelection selection) {
if (fOutlineViewer != null)
fOutlineViewer.setSelection(selection);
}
/**
* Checkes whether a given Java element is an inner type.
*/
private boolean isInnerType(IJavaElement element) {
if (element.getElementType() == IJavaElement.TYPE) {
IJavaElement parent= element.getParent();
int type= parent.getElementType();
return (type != IJavaElement.COMPILATION_UNIT && type != IJavaElement.CLASS_FILE);
}
return false;
}
|
6,407 |
Bug 6407 reminder: register the context menu in the JavaOutlinePage
|
the context menu in the JavaOutlinePage should be registered with the page's site.
|
resolved fixed
|
31519fa
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-04T17:24:24Z | 2001-11-28T23:26:40Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
|
/**
* Handles key events in viewer.
*/
private void handleKeyPressed(KeyEvent event) {
if (event.stateMask != 0)
return;
IAction action= null;
if (event.character == SWT.DEL) {
action= getAction("DeleteElement");
if (action instanceof DeleteAction){
DeleteAction deleteAction= (DeleteAction)action;
deleteAction.update();
if (deleteAction.isEnabled())
deleteAction.run();
return;
}
}
else if (event.keyCode == SWT.F4) {
OpenTypeHierarchyUtil.open(getSelection(), fEditor.getSite().getWorkbenchWindow());
}
if (action != null && action.isEnabled())
action.run();
}
}
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.jarpackager;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.ITreeViewerListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeExpansionEvent;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.viewers.ViewerSorter;
/**
* Combines a CheckboxTreeViewer and CheckboxListViewer.
* All viewer selection-driven interactions are handled within this viewer
*/
public class CheckboxTreeAndListGroup implements ICheckStateListener, ISelectionChangedListener, ITreeViewerListener {
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
private Object fRoot;
private Object fCurrentTreeSelection;
private List fExpandedTreeNodes= new ArrayList();
private Map fCheckedStateStore= new HashMap(9);
private List fWhiteCheckedTreeItems= new ArrayList();
private List fListeners= new ArrayList();
private ITreeContentProvider fTreeContentProvider;
private IStructuredContentProvider fListContentProvider;
private ILabelProvider fTreeLabelProvider;
private ILabelProvider fListLabelProvider;
private CheckboxTreeViewer fTreeViewer;
private CheckboxTableViewer fListViewer;
/**
* Creates an instance of this class. Use this constructor if you wish to specify
* the width and/or height of the combined widget (to only hardcode one of the
* sizing dimensions, specify the other dimension's value as -1)
*
* @param parent org.eclipse.swt.widgets.Composite
* @param style int
* @param rootObject java.lang.Object
* @param childPropertyName java.lang.String
* @param parentPropertyName java.lang.String
* @param listPropertyName java.lang.String
* @param width int
* @param height int
*/
public CheckboxTreeAndListGroup(
Composite parent,
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
Object rootObject,
ITreeContentProvider treeContentProvider,
ILabelProvider treeLabelProvider,
IStructuredContentProvider listContentProvider,
ILabelProvider listLabelProvider,
int style,
int width,
int height) {
fRoot= rootObject;
fTreeContentProvider= treeContentProvider;
fListContentProvider= listContentProvider;
fTreeLabelProvider= treeLabelProvider;
fListLabelProvider= listLabelProvider;
createContents(parent, width, height, style);
}
/**
* This method must be called just before this window becomes visible.
*/
public void aboutToOpen() {
determineWhiteCheckedDescendents(fRoot);
checkNewTreeElements(getTreeChildren(fRoot));
fCurrentTreeSelection= null;
Object[] elements= getTreeChildren(fRoot);
Object primary= elements.length > 0 ? elements[0] : null;
if (primary != null) {
fTreeViewer.setSelection(new StructuredSelection(primary));
}
fTreeViewer.getControl().setFocus();
}
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
/**
* Adds the passed listener to self's collection of clients
* that listen for changes to element checked states
*
* @param listener ICheckStateListener
*/
public void addCheckStateListener(ICheckStateListener listener) {
fListeners.add(listener);
}
/**
* Adds the receiver and all of it's ancestors to the checkedStateStore if they
* are not already there.
*/
private void addToHierarchyToCheckedStore(Object treeElement) {
if (!fCheckedStateStore.containsKey(treeElement))
fCheckedStateStore.put(treeElement, new ArrayList());
Object parent= fTreeContentProvider.getParent(treeElement);
if (parent != null)
addToHierarchyToCheckedStore(parent);
}
/**
* Returns a boolean indicating whether all children of the passed tree element
* are currently white-checked
*
* @return boolean
* @param treeElement java.lang.Object
*/
protected boolean areAllChildrenWhiteChecked(Object treeElement) {
Object[] children= getTreeChildren(treeElement);
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
for (int i= 0; i < children.length; ++i) {
if (!fWhiteCheckedTreeItems.contains(children[i]))
return false;
}
return true;
}
/**
* Returns a boolean indicating whether all list elements associated with
* the passed tree element are currently checked
*
* @return boolean
* @param treeElement java.lang.Object
*/
protected boolean areAllElementsChecked(Object treeElement) {
List checkedElements= (List)fCheckedStateStore.get(treeElement);
if (checkedElements == null)
return false;
return getListItemsSize(treeElement) == checkedElements.size();
}
/**
* Iterates through the passed elements which are being realized for the first
* time and check each one in the tree viewer as appropriate
*/
protected void checkNewTreeElements(Object[] elements) {
for (int i= 0; i < elements.length; ++i) {
Object currentElement= elements[i];
boolean checked= fCheckedStateStore.containsKey(currentElement);
fTreeViewer.setChecked(currentElement, checked);
fTreeViewer.setGrayed(
currentElement,
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
checked && !fWhiteCheckedTreeItems.contains(currentElement));
}
}
/**
* An item was checked in one of self's two views. Determine which
* view this occurred in and delegate appropriately
*
* @param event CheckStateChangedEvent
*/
public void checkStateChanged(final CheckStateChangedEvent event) {
BusyIndicator.showWhile(fTreeViewer.getControl().getDisplay(), new Runnable() {
public void run() {
if (event.getCheckable().equals(fTreeViewer))
treeItemChecked(event.getElement(), event.getChecked());
else
listItemChecked(event.getElement(), event.getChecked(), true);
notifyCheckStateChangeListeners(event);
}
});
}
/**
* Lay out and initialize self's visual components.
*
* @param parent org.eclipse.swt.widgets.Composite
* @param width int
* @param height int
*/
protected void createContents(
Composite parent,
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
int width,
int height,
int style) {
Composite composite= new Composite(parent, style);
GridLayout layout= new GridLayout();
layout.numColumns= 2;
layout.makeColumnsEqualWidth= true;
layout.marginHeight= 0;
layout.marginWidth= 0;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
createTreeViewer(composite, width / 2, height);
createListViewer(composite, width / 2, height);
initialize();
}
/**
* Creates this group's list viewer.
*/
protected void createListViewer(Composite parent, int width, int height) {
fListViewer= new CheckboxTableViewer(parent, SWT.BORDER);
GridData data= new GridData(GridData.FILL_BOTH);
data.widthHint= width;
data.heightHint= height;
fListViewer.getTable().setLayoutData(data);
fListViewer.setContentProvider(fListContentProvider);
fListViewer.setLabelProvider(fListLabelProvider);
fListViewer.addCheckStateListener(this);
}
/**
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
* Creates this group's tree viewer.
*/
protected void createTreeViewer(Composite parent, int width, int height) {
Tree tree= new Tree(parent, SWT.CHECK | SWT.BORDER);
GridData data= new GridData(GridData.FILL_BOTH);
data.widthHint= width;
data.heightHint= height;
tree.setLayoutData(data);
fTreeViewer= new CheckboxTreeViewer(tree);
fTreeViewer.setContentProvider(fTreeContentProvider);
fTreeViewer.setLabelProvider(fTreeLabelProvider);
fTreeViewer.addTreeListener(this);
fTreeViewer.addCheckStateListener(this);
fTreeViewer.addSelectionChangedListener(this);
}
/**
* Returns a boolean indicating whether the passed tree element should be
* at LEAST gray-checked. Note that this method does not consider whether
* it should be white-checked, so a specified tree item which should be
* white-checked will result in a <code>true</code> answer from this method.
* To determine whether a tree item should be white-checked use method
* #determineShouldBeWhiteChecked(Object).
*
* @param element java.lang.Object
* @return boolean
* @see #determineShouldBeWhiteChecked(java.lang.Object)
*/
protected boolean determineShouldBeAtLeastGrayChecked(Object treeElement) {
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
List checked= (List) fCheckedStateStore.get(treeElement);
if (checked != null && (!checked.isEmpty()))
return true;
Object[] children= getTreeChildren(treeElement);
for (int i= 0; i < children.length; ++i) {
if (fCheckedStateStore.containsKey(children[i]))
return true;
}
return false;
}
/**
* Returns a boolean indicating whether the passed tree item should be
* white-checked.
*
* @return boolean
* @param treeElement java.lang.Object
*/
protected boolean determineShouldBeWhiteChecked(Object treeElement) {
return areAllChildrenWhiteChecked(treeElement)
&& areAllElementsChecked(treeElement);
}
/**
* Recursively adds appropriate tree elements to the collection of
* known white-checked tree elements.
*
* @param treeElement java.lang.Object
*/
protected void determineWhiteCheckedDescendents(Object treeElement) {
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
Object[] children= getTreeChildren(treeElement);
for (int i= 0; i < children.length; ++i)
determineWhiteCheckedDescendents(children[i]);
if (determineShouldBeWhiteChecked(treeElement))
setWhiteChecked(treeElement, true);
}
/**
* Causes the tree viewer to expand all its items
*/
public void expandAll() {
fTreeViewer.expandAll();
}
/**
* Answers a flat collection of all of the checked elements in the
* list portion of self
*
* @return java.util.Vector
*/
public Iterator getAllCheckedListItems() {
Set result= new HashSet();
Iterator listCollectionsEnum= fCheckedStateStore.values().iterator();
while (listCollectionsEnum.hasNext())
result.addAll((List)listCollectionsEnum.next());
return result.iterator();
}
/**
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
* Answer a collection of all of the checked elements in the tree portion
* of self
*
* @return java.util.Vector
*/
public Set getAllCheckedTreeItems() {
return new HashSet(fCheckedStateStore.keySet());
}
/**
* Answers the number of elements that have been checked by the
* user.
*
* @return int
*/
public int getCheckedElementCount() {
return fCheckedStateStore.size();
}
/**
* Returns a count of the number of list items associated with a
* given tree item.
*
* @return int
* @param treeElement java.lang.Object
*/
protected int getListItemsSize(Object treeElement) {
Object[] elements= getListElements(treeElement);
return elements.length;
}
/**
* Gets the table that displays the folder content
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
*
* @return the table used to show the list
*/
public Table getTable() {
return fListViewer.getTable();
}
/**
* Gets the tree that displays the list for a folder
*
* @return the tree used to show the folders
*/
public Tree getTree() {
return fTreeViewer.getTree();
}
/**
* Adds the given filter to the tree viewer and
* triggers refiltering and resorting of the elements.
*
* @param filter a viewer filter
*/
public void addTreeFilter(ViewerFilter filter) {
fTreeViewer.addFilter(filter);
}
/**
* Adds the given filter to the list viewer and
* triggers refiltering and resorting of the elements.
*
* @param filter a viewer filter
*/
public void addListFilter(ViewerFilter filter) {
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
fListViewer.addFilter(filter);
}
/**
* Logically gray-check all ancestors of treeItem by ensuring that they
* appear in the checked table
*/
protected void grayCheckHierarchy(Object treeElement) {
if (fCheckedStateStore.containsKey(treeElement))
return;
fCheckedStateStore.put(treeElement, new ArrayList());
if (determineShouldBeWhiteChecked(treeElement)) {
setWhiteChecked(treeElement, true);
}
Object parent= fTreeContentProvider.getParent(treeElement);
if (parent != null)
grayCheckHierarchy(parent);
}
/**
* Sets the initial checked state of the passed list element to true.
*/
public void initialCheckListItem(Object element) {
Object parent= fTreeContentProvider.getParent(element);
fCurrentTreeSelection= parent;
listItemChecked(element, true, false);
updateHierarchy(parent);
}
/**
* Sets the initial checked state of the passed element to true,
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
* as well as to all of its children and associated list elements
*/
public void initialCheckTreeItem(Object element) {
treeItemChecked(element, true);
}
/**
* Initializes this group's viewers after they have been laid out.
*/
protected void initialize() {
fTreeViewer.setInput(fRoot);
}
/**
* Callback that's invoked when the checked status of an item in the list
* is changed by the user. Do not try and update the hierarchy if we are building the
* initial list.
*/
protected void listItemChecked(
Object listElement,
boolean state,
boolean updatingFromSelection) {
List checkedListItems= (List) fCheckedStateStore.get(fCurrentTreeSelection);
if (state) {
if (checkedListItems == null) {
grayCheckHierarchy(fCurrentTreeSelection);
checkedListItems= (List) fCheckedStateStore.get(fCurrentTreeSelection);
}
checkedListItems.add(listElement);
} else {
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
checkedListItems.remove(listElement);
if (checkedListItems.isEmpty()) {
ungrayCheckHierarchy(fCurrentTreeSelection);
}
}
if (updatingFromSelection)
updateHierarchy(fCurrentTreeSelection);
}
/**
* Notifies all checked state listeners that the passed element has had
* its checked state changed to the passed state
*/
protected void notifyCheckStateChangeListeners(CheckStateChangedEvent event) {
Iterator listenersEnum= fListeners.iterator();
while (listenersEnum.hasNext())
((ICheckStateListener) listenersEnum.next()).checkStateChanged(event);
}
/**
*Sets the contents of the list viewer based upon the specified selected
*tree element. This also includes checking the appropriate list items.
*
*@param treeElement java.lang.Object
*/
protected void populateListViewer(final Object treeElement) {
fListViewer.setInput(treeElement);
List listItemsToCheck= (List) fCheckedStateStore.get(treeElement);
if (listItemsToCheck != null) {
Iterator listItemsEnum= listItemsToCheck.iterator();
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
while (listItemsEnum.hasNext())
fListViewer.setChecked(listItemsEnum.next(), true);
}
}
/**
* Removes the passed listener from self's collection of clients
* that listen for changes to element checked states
*
* @param listener ICheckStateListener
*/
public void removeCheckStateListener(ICheckStateListener listener) {
fListeners.remove(listener);
}
/**
* Handles the selection of an item in the tree viewer
*
* @param selection ISelection
*/
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection= (IStructuredSelection) event.getSelection();
Object selectedElement= selection.getFirstElement();
if (selectedElement == null) {
fCurrentTreeSelection= null;
fListViewer.setInput(fCurrentTreeSelection);
return;
}
if (selectedElement != fCurrentTreeSelection)
populateListViewer(selectedElement);
fCurrentTreeSelection= selectedElement;
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
}
/**
* Selects or deselect all of the elements in the tree depending on the value of the selection
* boolean. Be sure to update the displayed files as well.
*/
public void setAllSelections(final boolean selection) {
BusyIndicator.showWhile(fTreeViewer.getControl().getDisplay(), new Runnable() {
public void run() {
setTreeChecked(fRoot, selection);
fListViewer.setAllChecked(selection);
}
});
}
/**
* Sets the list viewer's providers to those passed
*
* @param contentProvider ITreeContentProvider
* @param labelProvider ILabelProvider
*/
public void setListProviders(
IStructuredContentProvider contentProvider,
ILabelProvider labelProvider) {
fListViewer.setContentProvider(contentProvider);
fListViewer.setLabelProvider(labelProvider);
}
/**
* Sets the sorter that is to be applied to self's list viewer
*/
public void setListSorter(ViewerSorter sorter) {
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
fListViewer.setSorter(sorter);
}
/**
* Sets the root of the widget to be new Root. Regenerate all of the tables and lists from this
* value.
*
* @param newRoot
*/
public void setRoot(Object newRoot) {
this.fRoot= newRoot;
initialize();
}
/**
* Sets the checked state of the passed tree element appropriately, and
* do so recursively to all of its child tree elements as well
*/
protected void setTreeChecked(Object treeElement, boolean state) {
if (treeElement.equals(fCurrentTreeSelection)) {
fListViewer.setAllChecked(state);
}
if (state) {
Object[] listItems= getListElements(treeElement);
List listItemsChecked= new ArrayList();
for (int i= 0; i < listItems.length; ++i)
listItemsChecked.add(listItems[i]);
fCheckedStateStore.put(treeElement, listItemsChecked);
} else
fCheckedStateStore.remove(treeElement);
setWhiteChecked(treeElement, state);
fTreeViewer.setChecked(treeElement, state);
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
fTreeViewer.setGrayed(treeElement, false);
Object[] children= getTreeChildren(treeElement);
for (int i= 0; i < children.length; ++i) {
setTreeChecked(children[i], state);
}
}
/**
* Sets the tree viewer's providers to those passed
*
* @param contentProvider ITreeContentProvider
* @param labelProvider ILabelProvider
*/
public void setTreeProviders(
ITreeContentProvider contentProvider,
ILabelProvider labelProvider) {
fTreeViewer.setContentProvider(contentProvider);
fTreeViewer.setLabelProvider(labelProvider);
}
/**
* Sets the sorter that is to be applied to self's tree viewer
*/
public void setTreeSorter(ViewerSorter sorter) {
fTreeViewer.setSorter(sorter);
}
/**
* Adjusts the collection of references to white-checked tree elements appropriately.
*
* @param treeElement java.lang.Object
* @param isWhiteChecked boolean
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
*/
protected void setWhiteChecked(Object treeElement, boolean isWhiteChecked) {
if (isWhiteChecked) {
if (!fWhiteCheckedTreeItems.contains(treeElement))
fWhiteCheckedTreeItems.add(treeElement);
} else
fWhiteCheckedTreeItems.remove(treeElement);
}
/**
* Handle the collapsing of an element in a tree viewer
*/
public void treeCollapsed(TreeExpansionEvent event) {
}
/**
* Handles the expansionsion of an element in a tree viewer
*/
public void treeExpanded(TreeExpansionEvent event) {
Object item= event.getElement();
if (!fExpandedTreeNodes.contains(item)) {
fExpandedTreeNodes.add(item);
checkNewTreeElements(getTreeChildren(item));
}
}
/**
* Callback that's invoked when the checked status of an item in the tree
* is changed by the user.
*/
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
protected void treeItemChecked(Object treeElement, boolean state) {
setTreeChecked(treeElement, state);
Object parent= fTreeContentProvider.getParent(treeElement);
if (parent == null)
return;
if (state)
grayCheckHierarchy(parent);
else
ungrayCheckHierarchy(parent);
updateHierarchy(treeElement);
}
/**
* Logically un-gray-check all ancestors of treeItem iff appropriate.
*/
protected void ungrayCheckHierarchy(Object treeElement) {
if (!determineShouldBeAtLeastGrayChecked(treeElement))
fCheckedStateStore.remove(treeElement);
Object parent= fTreeContentProvider.getParent(treeElement);
if (parent != null)
ungrayCheckHierarchy(parent);
}
/**
* Sets the checked state of self and all ancestors appropriately
*/
protected void updateHierarchy(Object treeElement) {
boolean whiteChecked= determineShouldBeWhiteChecked(treeElement);
boolean shouldBeAtLeastGray= determineShouldBeAtLeastGrayChecked(treeElement);
fTreeViewer.setChecked(treeElement, shouldBeAtLeastGray);
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
setWhiteChecked(treeElement, whiteChecked);
if (whiteChecked)
fTreeViewer.setGrayed(treeElement, false);
else
fTreeViewer.setGrayed(treeElement, shouldBeAtLeastGray);
Object parent= fTreeContentProvider.getParent(treeElement);
if (parent != null) {
updateHierarchy(parent);
}
}
/**
* Update the selections of the tree elements in items to reflect the new
* selections provided.
*
* @param Map with keys of Object (the tree element) and values of List (the selected
* list elements).
*/
public void updateSelections(final Map items) {
BusyIndicator.showWhile(fTreeViewer.getControl().getDisplay(), new Runnable() {
public void run() {
handleUpdateSelection(items);
}
});
}
/**
* Returns the result of running the given elements through the filters.
*
* @param elements the elements to filter
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
* @return only the elements which all filters accept
*/
protected Object[] filter(ViewerFilter[] filters, Object[] elements) {
if (filters != null) {
ArrayList filtered = new ArrayList(elements.length);
for (int i = 0; i < elements.length; i++) {
boolean add = true;
for (int j = 0; j < filters.length; j++) {
add = filters[j].select(null, null, elements[i]);
if (!add)
break;
}
if (add)
filtered.add(elements[i]);
}
return filtered.toArray();
}
return elements;
}
private Object[] getTreeChildren(Object element) {
return filter(fTreeViewer.getFilters(), fTreeContentProvider.getChildren(element));
}
private Object[] getListElements(Object element) {
return filter(fListViewer.getFilters(), fListContentProvider.getElements(element));
}
public Set getWhiteCheckedTreeItems() {
return new HashSet(fWhiteCheckedTreeItems);
}
private void handleUpdateSelection(Map items) {
Iterator keyIterator= items.keySet().iterator();
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
|
while (keyIterator.hasNext()) {
Object key= keyIterator.next();
List selections= (List) items.get(key);
if (selections.size() == 0)
fCheckedStateStore.remove(key);
else {
fCheckedStateStore.put(key, selections);
Object parent= fTreeContentProvider.getParent(key);
if (parent != null) {
addToHierarchyToCheckedStore(parent);
}
}
}
keyIterator= items.keySet().iterator();
while (keyIterator.hasNext()) {
Object key= keyIterator.next();
updateHierarchy(key);
if (fCurrentTreeSelection != null && fCurrentTreeSelection.equals(key)) {
fListViewer.setAllChecked(false);
fListViewer.setCheckedElements(((List) items.get(key)).toArray());
}
}
}
}
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
|
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
package org.eclipse.jdt.internal.ui.jarpackager;
import java.io.File;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
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.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
|
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.ui.dialogs.SaveAsDialog;
import org.eclipse.ui.dialogs.WizardExportResourcesPage;
import org.eclipse.ui.help.DialogPageContextComputer;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaModel;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.JavaElementContentProvider;
import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.packageview.EmptyInnerPackageFilter;
import org.eclipse.jdt.internal.ui.util.SWTUtil;
import org.eclipse.jdt.internal.ui.viewsupport.BaseJavaElementContentProvider;
/**
* Page 1 of the JAR Package wizard
*/
public class JarPackageWizardPage extends WizardExportResourcesPage implements IJarPackageWizardPage {
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
|
private JarPackage fJarPackage;
private IStructuredSelection fInitialSelection;
private CheckboxTreeAndListGroup fInputGroup;
private Text fSourceNameField;
private Button fSourceBrowseButton;
private Button fExportClassFilesCheckbox;
private Button fExportJavaFilesCheckbox;
private Combo fDestinationNamesCombo;
private Button fDestinationBrowseButton;
private Button fCompressCheckbox;
private Button fOverwriteCheckbox;
private Composite fDescriptionFileGroup;
private Button fSaveDescriptionCheckbox;
private Label fDescriptionFileLabel;
private Text fDescriptionFileText;
private Button fDescriptionFileBrowseButton;
private final static String PAGE_NAME= "JarPackageWizardPage";
private final static String STORE_EXPORT_CLASS_FILES= PAGE_NAME + ".EXPORT_CLASS_FILES";
private final static String STORE_EXPORT_JAVA_FILES= PAGE_NAME + ".EXPORT_JAVA_FILES";
private final static String STORE_DESTINATION_NAMES= PAGE_NAME + ".DESTINATION_NAMES_ID";
private final static String STORE_COMPRESS= PAGE_NAME + ".COMPRESS";
private final static String STORE_OVERWRITE= PAGE_NAME + ".OVERWRITE";
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
|
private final static int SIZING_SELECTION_WIDGET_WIDTH= 400;
private final static int SIZING_SELECTION_WIDGET_HEIGHT= 150;
/**
* Create an instance of this class
*/
public JarPackageWizardPage(JarPackage jarPackage, IStructuredSelection selection) {
super(PAGE_NAME, selection);
setTitle(JarPackagerMessages.getString("JarPackageWizardPage.title"));
setDescription(JarPackagerMessages.getString("JarPackageWizardPage.description"));
fJarPackage= jarPackage;
fInitialSelection= selection;
}
/*
* Method declared on IDialogPage.
*/
public void createControl(Composite parent) {
initializeDialogUnits(parent);
Composite composite= new Composite(parent, SWT.NULL);
composite.setLayout(new GridLayout());
composite.setLayoutData(
new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
createPlainLabel(composite, JarPackagerMessages.getString("JarPackageWizardPage.whatToExport.label"));
createInputGroup(composite);
createExportTypeGroup(composite);
new Label(composite, SWT.NONE);
createPlainLabel(composite, JarPackagerMessages.getString("JarPackageWizardPage.whereToExport.label"));
createDestinationGroup(composite);
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
|
createPlainLabel(composite, JarPackagerMessages.getString("JarPackageWizardPage.options.label"));
createOptionsGroup(composite);
restoreResourceSpecificationWidgetValues();
restoreWidgetValues();
if (fInitialSelection != null)
setupBasedOnInitialSelections();
setControl(composite);
update();
giveFocusToDestination();
WorkbenchHelp.setHelp(composite, new DialogPageContextComputer(this, IJavaHelpContextIds.JARPACKAGER_WIZARD_PAGE));
}
/**
* Create the export options specification widgets.
*
* @param parent org.eclipse.swt.widgets.Composite
*/
protected void createOptionsGroup(Composite parent) {
Composite optionsGroup= new Composite(parent, SWT.NONE);
GridLayout layout= new GridLayout();
layout.marginHeight= 0;
optionsGroup.setLayout(layout);
fCompressCheckbox= new Button(optionsGroup, SWT.CHECK | SWT.LEFT);
fCompressCheckbox.setText(JarPackagerMessages.getString("JarPackageWizardPage.compress.text"));
fCompressCheckbox.addListener(SWT.Selection, this);
fOverwriteCheckbox= new Button(optionsGroup, SWT.CHECK | SWT.LEFT);
fOverwriteCheckbox.setText(JarPackagerMessages.getString("JarPackageWizardPage.overwrite.text"));
fOverwriteCheckbox.addListener(SWT.Selection, this);
}
/**
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
|
* Answer the contents of the destination specification widget. If this
* value does not have the required suffix then add it first.
*
* @return java.lang.String
*/
protected String getDestinationValue() {
String requiredSuffix= getOutputSuffix();
String destinationText= fDestinationNamesCombo.getText().trim();
if (!destinationText.toLowerCase().endsWith(requiredSuffix.toLowerCase()))
destinationText += requiredSuffix;
return destinationText;
}
/**
* Answer the string to display in self as the destination type
*
* @return java.lang.String
*/
protected String getDestinationLabel() {
return JarPackagerMessages.getString("JarPackageWizardPage.destination.label");
}
/**
* Answer the suffix that files exported from this wizard must have.
* If this suffix is a file extension (which is typically the case)
* then it must include the leading period character.
*
* @return java.lang.String
*/
protected String getOutputSuffix() {
return "." + JarPackage.EXTENSION;
}
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
|
/**
* Returns an iterator over this page's collection of currently-specified
* elements to be exported. This is the primary element selection facility
* accessor for subclasses.
*
* @return an iterator over the collection of elements currently selected for export
*/
protected Iterator getSelectedResourcesIterator() {
return fInputGroup.getAllCheckedListItems();
}
/**
* Persists resource specification control setting that are to be restored
* in the next instance of this page. Subclasses wishing to persist
* settings for their controls should extend the hook method
* <code>internalSaveWidgetValues</code>.
*/
public final void saveWidgetValues() {
IDialogSettings settings= getDialogSettings();
if (settings != null) {
String[] directoryNames= settings.getArray(STORE_DESTINATION_NAMES);
if (directoryNames == null)
directoryNames= new String[0];
directoryNames= addToHistory(directoryNames, getDestinationValue());
settings.put(STORE_DESTINATION_NAMES, directoryNames);
settings.put(STORE_EXPORT_CLASS_FILES, fJarPackage.areClassFilesExported());
settings.put(STORE_EXPORT_JAVA_FILES, fJarPackage.areJavaFilesExported());
settings.put(STORE_COMPRESS, fJarPackage.isCompressed());
settings.put(STORE_OVERWRITE, fJarPackage.allowOverwrite());
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
|
}
internalSaveWidgetValues();
}
/**
* Hook method for subclasses to persist their settings.
*/
protected void internalSaveWidgetValues() {
}
/**
* Hook method for restoring widget values to the values that they held
* last time this wizard was used to completion.
*/
protected void restoreWidgetValues() {
if (!fJarPackage.isUsedToInitialize())
initializeJarPackage();
fExportClassFilesCheckbox.setSelection(fJarPackage.areClassFilesExported());
fExportJavaFilesCheckbox.setSelection(fJarPackage.areJavaFilesExported());
if (fJarPackage.getJarLocation().isEmpty())
fDestinationNamesCombo.setText("");
else
fDestinationNamesCombo.setText(fJarPackage.getJarLocation().toOSString());
IDialogSettings settings= getDialogSettings();
if (settings != null) {
String[] directoryNames= settings.getArray(STORE_DESTINATION_NAMES);
if (directoryNames == null)
return;
if (! fDestinationNamesCombo.getText().equals(directoryNames[0]))
fDestinationNamesCombo.add(fDestinationNamesCombo.getText());
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
|
for (int i= 0; i < directoryNames.length; i++)
fDestinationNamesCombo.add(directoryNames[i]);
}
fCompressCheckbox.setSelection(fJarPackage.isCompressed());
fOverwriteCheckbox.setSelection(fJarPackage.allowOverwrite());
}
/**
* Initializes the JAR package from last used wizard page values.
*/
protected void initializeJarPackage() {
IDialogSettings settings= getDialogSettings();
if (settings != null) {
fJarPackage.setSelectedElements(getSelectedResources());
fJarPackage.setExportClassFiles(settings.getBoolean(STORE_EXPORT_CLASS_FILES));
fJarPackage.setExportJavaFiles(settings.getBoolean(STORE_EXPORT_JAVA_FILES));
fJarPackage.setCompress(settings.getBoolean(STORE_COMPRESS));
fJarPackage.setOverwrite(settings.getBoolean(STORE_OVERWRITE));
String[] directoryNames= settings.getArray(STORE_DESTINATION_NAMES);
if (directoryNames == null)
return;
fJarPackage.setJarLocation(getPathFromString(directoryNames[0]));
}
}
/**
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
|
* Stores the widget values in the JAR package.
*/
protected void updateModel() {
if (getControl() == null)
return;
fJarPackage.setSelectedElements(getSelectedResources());
fJarPackage.setExportClassFiles(fExportClassFilesCheckbox.getSelection());
fJarPackage.setExportJavaFiles(fExportJavaFilesCheckbox.getSelection());
fJarPackage.setJarLocation(getPathFromString(fDestinationNamesCombo.getText()));
fJarPackage.setCompress(fCompressCheckbox.getSelection());
fJarPackage.setOverwrite(fOverwriteCheckbox.getSelection());
}
protected IPath getPathFromString(String text) {
return new Path(text).makeAbsolute();
}
/**
* Returns a boolean indicating whether the passed File handle is
* is valid and available for use.
*
* @return boolean
*/
protected boolean ensureTargetFileIsValid(File targetFile) {
if (targetFile.exists() && targetFile.isDirectory()) {
setErrorMessage(JarPackagerMessages.getString("JarPackageWizardPage.error.exportDestinationMustNotBeDirectory"));
fDestinationNamesCombo.setFocus();
return false;
|
5,571 |
Bug 5571 JAR Packager: Reveal first checked project
|
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
|
closed fixed
|
9cf7888
|
JDT
|
https://github.com/eclipse-jdt/eclipse.jdt.ui
|
eclipse-jdt/eclipse.jdt.ui
|
java
| null | null | null | 2001-12-07T15:03:04Z | 2001-11-06T15:20:00Z |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
|
}
if (targetFile.exists()) {
if (!targetFile.canWrite()) {
setErrorMessage(JarPackagerMessages.getString("JarPackageWizardPage.error.jarFileExistsAndNotWritable"));
fDestinationNamesCombo.setFocus();
return false;
}
}
return true;
}
/*
* Overrides method from WizardExportPage
*/
protected void createDestinationGroup(Composite parent) {
initializeDialogUnits(parent);
Composite destinationSelectionGroup= new Composite(parent, SWT.NONE);
GridLayout layout= new GridLayout();
layout.numColumns= 3;
destinationSelectionGroup.setLayout(layout);
destinationSelectionGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
new Label(destinationSelectionGroup, SWT.NONE).setText(getDestinationLabel());
fDestinationNamesCombo= new Combo(destinationSelectionGroup, SWT.SINGLE | SWT.BORDER);
fDestinationNamesCombo.addListener(SWT.Modify, this);
fDestinationNamesCombo.addListener(SWT.Selection, this);
GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
data.widthHint= SIZING_TEXT_FIELD_WIDTH;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.