mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix warnings
This commit is contained in:
parent
d61c4d35ec
commit
12dc80623b
68 changed files with 158 additions and 326 deletions
|
@ -28,7 +28,7 @@ import org.eclipse.cdt.internal.ui.editor.IndentUtil;
|
|||
import org.eclipse.cdt.internal.ui.text.FastCPartitionScanner;
|
||||
import org.eclipse.cdt.ui.text.ICPartitions;
|
||||
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.text.BadLocationException;
|
||||
import org.eclipse.jface.text.BadPositionCategoryException;
|
||||
import org.eclipse.jface.text.Document;
|
||||
|
|
|
@ -16,7 +16,7 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.text.BadLocationException;
|
||||
import org.eclipse.jface.text.BadPartitioningException;
|
||||
import org.eclipse.jface.text.IDocument;
|
||||
|
|
|
@ -15,7 +15,7 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.text.BadLocationException;
|
||||
import org.eclipse.jface.text.BadPartitioningException;
|
||||
import org.eclipse.jface.text.BadPositionCategoryException;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
package org.eclipse.cdt.internal.ui.actions;
|
||||
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
|
||||
import org.eclipse.ui.IActionBars;
|
||||
import org.eclipse.ui.actions.ActionContext;
|
||||
|
|
|
@ -16,7 +16,7 @@ import java.util.ResourceBundle;
|
|||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.text.BadLocationException;
|
||||
import org.eclipse.jface.text.IDocument;
|
||||
import org.eclipse.jface.text.IRegion;
|
||||
|
|
|
@ -13,7 +13,7 @@ package org.eclipse.cdt.internal.ui.actions;
|
|||
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
|
||||
import org.eclipse.cdt.internal.ui.actions.ActionMessages;
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.eclipse.core.runtime.IStatus;
|
|||
import org.eclipse.core.runtime.ListenerList;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jface.preference.PreferenceConverter;
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.text.IDocument;
|
||||
import org.eclipse.jface.text.IDocumentPartitioner;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
|
|
|
@ -71,15 +71,17 @@ public class CViewContentProvider extends CElementContentProvider {
|
|||
public Object[] getChildren(Object element) {
|
||||
Object[] objs = null;
|
||||
|
||||
// use the the deferred manager for some cases
|
||||
if (element instanceof IBinary) {
|
||||
// It takes sometimes to parse binaries deferred it
|
||||
objs = fManager.getChildren(element);
|
||||
} else if (element instanceof IArchive) {
|
||||
// It takes sometimes to parse archives deferred it
|
||||
objs = fManager.getChildren(element);
|
||||
if (fManager != null) {
|
||||
// use the the deferred manager for some cases
|
||||
if (element instanceof IBinary) {
|
||||
// It takes sometimes to parse binaries deferred it
|
||||
objs = fManager.getChildren(element);
|
||||
} else if (element instanceof IArchive) {
|
||||
// It takes sometimes to parse archives deferred it
|
||||
objs = fManager.getChildren(element);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (objs == null) {
|
||||
objs = super.getChildren(element);
|
||||
}
|
||||
|
@ -202,11 +204,14 @@ public class CViewContentProvider extends CElementContentProvider {
|
|||
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
|
||||
*/
|
||||
public boolean hasChildren(Object element) {
|
||||
if (element instanceof IBinary) {
|
||||
return fManager.mayHaveChildren(element);
|
||||
} else if (element instanceof IArchive) {
|
||||
return fManager.mayHaveChildren(element);
|
||||
} else if (element instanceof IBinaryContainer) {
|
||||
if (fManager != null) {
|
||||
if (element instanceof IBinary) {
|
||||
return fManager.mayHaveChildren(element);
|
||||
} else if (element instanceof IArchive) {
|
||||
return fManager.mayHaveChildren(element);
|
||||
}
|
||||
}
|
||||
if (element instanceof IBinaryContainer) {
|
||||
try {
|
||||
IBinaryContainer cont = (IBinaryContainer)element;
|
||||
IBinary[] bins = getBinaries(cont);
|
||||
|
@ -250,7 +255,9 @@ public class CViewContentProvider extends CElementContentProvider {
|
|||
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
|
||||
*/
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
fManager.cancel();
|
||||
if (fManager != null) {
|
||||
fManager.cancel();
|
||||
}
|
||||
super.inputChanged(viewer, oldInput, newInput);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.eclipse.core.resources.IContainer;
|
|||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.swt.SWTError;
|
||||
import org.eclipse.swt.dnd.Clipboard;
|
||||
|
|
|
@ -17,7 +17,7 @@ import org.eclipse.core.resources.IContainer;
|
|||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.swt.dnd.Clipboard;
|
||||
import org.eclipse.swt.dnd.FileTransfer;
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.Collection;
|
|||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
|
||||
import org.eclipse.ui.dialogs.ISelectionStatusValidator;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui.dialogs;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.jface.viewers.ViewerFilter;
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ import org.eclipse.swt.widgets.FileDialog;
|
|||
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
|
||||
import org.eclipse.ui.model.WorkbenchContentProvider;
|
||||
import org.eclipse.ui.model.WorkbenchLabelProvider;
|
||||
import org.eclipse.ui.views.navigator.ResourceComparator;
|
||||
|
||||
/**
|
||||
* CPathLibraryEntryPage
|
||||
|
@ -473,7 +474,7 @@ public class CPathLibraryEntryPage extends CPathBasePage {
|
|||
dialog.setMessage(message);
|
||||
dialog.addFilter(filter);
|
||||
dialog.setInput(fWorkspaceRoot);
|
||||
dialog.setSorter(new ResourceSorter(ResourceSorter.NAME));
|
||||
dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
|
||||
if (existing == null) {
|
||||
dialog.setInitialSelection(fCurrCProject.getProject());
|
||||
} else {
|
||||
|
|
|
@ -39,7 +39,7 @@ import org.eclipse.core.runtime.IPath;
|
|||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
import org.eclipse.jface.viewers.ITreeContentProvider;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
|
|
|
@ -39,7 +39,7 @@ import org.eclipse.core.runtime.IPath;
|
|||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
import org.eclipse.jface.viewers.ITreeContentProvider;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
|
|
|
@ -13,17 +13,6 @@ package org.eclipse.cdt.internal.ui.dialogs.cpaths;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.StatusDialog;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.TypedElementSelectionValidator;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.TypedViewerFilter;
|
||||
import org.eclipse.cdt.internal.ui.util.ImageDescriptorRegistry;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.IListAdapter;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.LayoutUtil;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.ListDialogField;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
|
@ -47,7 +36,20 @@ import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
|
|||
import org.eclipse.ui.dialogs.ISelectionStatusValidator;
|
||||
import org.eclipse.ui.model.WorkbenchContentProvider;
|
||||
import org.eclipse.ui.model.WorkbenchLabelProvider;
|
||||
import org.eclipse.ui.views.navigator.ResourceSorter;
|
||||
import org.eclipse.ui.views.navigator.ResourceComparator;
|
||||
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.StatusDialog;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.TypedElementSelectionValidator;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.TypedViewerFilter;
|
||||
import org.eclipse.cdt.internal.ui.util.ImageDescriptorRegistry;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.IListAdapter;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.LayoutUtil;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.ListDialogField;
|
||||
|
||||
public class ExclusionPatternDialog extends StatusDialog {
|
||||
|
||||
|
@ -244,7 +246,7 @@ public class ExclusionPatternDialog extends StatusDialog {
|
|||
dialog.addFilter(filter);
|
||||
dialog.setInput(fCurrSourceFolder);
|
||||
dialog.setInitialSelection(initialElement);
|
||||
dialog.setSorter(new ResourceSorter(ResourceSorter.NAME));
|
||||
dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
|
||||
|
||||
if (dialog.open() == Window.OK) {
|
||||
Object[] objects= dialog.getResult();
|
||||
|
|
|
@ -12,15 +12,6 @@ package org.eclipse.cdt.internal.ui.dialogs.cpaths;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.dialogs.StatusDialog;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.StatusInfo;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.TypedElementSelectionValidator;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.TypedViewerFilter;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.IStringButtonAdapter;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.LayoutUtil;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
|
||||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
|
@ -43,7 +34,17 @@ import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
|
|||
import org.eclipse.ui.dialogs.ISelectionStatusValidator;
|
||||
import org.eclipse.ui.model.WorkbenchContentProvider;
|
||||
import org.eclipse.ui.model.WorkbenchLabelProvider;
|
||||
import org.eclipse.ui.views.navigator.ResourceSorter;
|
||||
import org.eclipse.ui.views.navigator.ResourceComparator;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.dialogs.StatusDialog;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.StatusInfo;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.TypedElementSelectionValidator;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.TypedViewerFilter;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.IStringButtonAdapter;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.LayoutUtil;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
|
||||
|
||||
public class ExclusionPatternEntryDialog extends StatusDialog {
|
||||
|
||||
|
@ -214,7 +215,7 @@ public class ExclusionPatternEntryDialog extends StatusDialog {
|
|||
dialog.addFilter(filter);
|
||||
dialog.setInput(fCurrSourceFolder);
|
||||
dialog.setInitialSelection(initialElement);
|
||||
dialog.setSorter(new ResourceSorter(ResourceSorter.NAME));
|
||||
dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
|
||||
|
||||
if (dialog.open() == Window.OK) {
|
||||
IResource res = (IResource) dialog.getFirstResult();
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.eclipse.swt.widgets.Control;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
|
||||
import org.eclipse.ui.dialogs.NewFolderDialog;
|
||||
import org.eclipse.ui.views.navigator.ResourceSorter;
|
||||
import org.eclipse.ui.views.navigator.ResourceComparator;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.util.SWTUtil;
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class FolderSelectionDialog extends ElementTreeSelectionDialog implements
|
|||
|
||||
public FolderSelectionDialog(Shell parent, ILabelProvider labelProvider, ITreeContentProvider contentProvider) {
|
||||
super(parent, labelProvider, contentProvider);
|
||||
setSorter(new ResourceSorter(ResourceSorter.NAME));
|
||||
setComparator(new ResourceComparator(ResourceComparator.NAME));
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -41,7 +41,7 @@ import org.eclipse.swt.widgets.Shell;
|
|||
import org.eclipse.swt.widgets.Tree;
|
||||
import org.eclipse.ui.dialogs.NewFolderDialog;
|
||||
import org.eclipse.ui.dialogs.SelectionStatusDialog;
|
||||
import org.eclipse.ui.views.navigator.ResourceSorter;
|
||||
import org.eclipse.ui.views.navigator.ResourceComparator;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.dialogs.StatusInfo;
|
||||
import org.eclipse.cdt.internal.ui.util.SWTUtil;
|
||||
|
@ -190,7 +190,7 @@ public class MultipleFolderSelectionDialog extends SelectionStatusDialog impleme
|
|||
}
|
||||
});
|
||||
|
||||
fViewer.setSorter(new ResourceSorter(ResourceSorter.NAME));
|
||||
fViewer.setComparator(new ResourceComparator(ResourceComparator.NAME));
|
||||
if (fFilters != null) {
|
||||
for (int i = 0; i != fFilters.size(); i++)
|
||||
fViewer.addFilter((ViewerFilter) fFilters.get(i));
|
||||
|
|
|
@ -1,184 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2005 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM Corporation - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui.dialogs.cpaths;
|
||||
|
||||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.jface.viewers.ViewerSorter;
|
||||
|
||||
/**
|
||||
* Sorter for viewers that display items of type <code>IResource</code>.
|
||||
* The sorter supports two sort criteria:
|
||||
* <p>
|
||||
* <code>NAME</code>: Folders are given order precedence, followed by files.
|
||||
* Within these two groups resources are ordered by name. All name comparisons
|
||||
* are case-insensitive.
|
||||
* </p>
|
||||
* <p>
|
||||
* <code>TYPE</code>: Folders are given order precedence, followed by files.
|
||||
* Within these two groups resources are ordered by extension. All extension
|
||||
* comparisons are case-insensitive.
|
||||
* </p>
|
||||
* <p>
|
||||
* This class may be instantiated; it is not intended to be subclassed.
|
||||
* </p>
|
||||
*/
|
||||
public class ResourceSorter extends ViewerSorter {
|
||||
|
||||
/**
|
||||
* Constructor argument value that indicates to sort items by name.
|
||||
*/
|
||||
public final static int NAME = 1;
|
||||
|
||||
/**
|
||||
* Constructor argument value that indicates to sort items by extension.
|
||||
*/
|
||||
public final static int TYPE = 2;
|
||||
|
||||
private int criteria;
|
||||
|
||||
/**
|
||||
* Creates a resource sorter that will use the given sort criteria.
|
||||
*
|
||||
* @param criteria the sort criterion to use: one of <code>NAME</code> or
|
||||
* <code>TYPE</code>
|
||||
*/
|
||||
public ResourceSorter(int criteria) {
|
||||
super();
|
||||
this.criteria = criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an integer value representing the relative sort priority of the
|
||||
* given element based on its class.
|
||||
* <p>
|
||||
* <ul>
|
||||
* <li>resources (<code>IResource</code>) - 2</li>
|
||||
* <li>project references (<code>ProjectReference</code>) - 1</li>
|
||||
* <li>everything else - 0</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @param element the element
|
||||
* @return the sort priority (larger numbers means more important)
|
||||
*/
|
||||
protected int classComparison(Object element) {
|
||||
if (element instanceof IResource) {
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* Method declared on ViewerSorter.
|
||||
*/
|
||||
public int compare(Viewer viewer, Object o1, Object o2) {
|
||||
//have to deal with non-resources in navigator
|
||||
//if one or both objects are not resources, returned a comparison
|
||||
//based on class.
|
||||
if (!(o1 instanceof IResource && o2 instanceof IResource)) {
|
||||
return compareClass(o1, o2);
|
||||
}
|
||||
IResource r1 = (IResource) o1;
|
||||
IResource r2 = (IResource) o2;
|
||||
|
||||
if (r1 instanceof IContainer && r2 instanceof IContainer)
|
||||
return compareNames(r1, r2);
|
||||
else if (r1 instanceof IContainer)
|
||||
return -1;
|
||||
else if (r2 instanceof IContainer)
|
||||
return 1;
|
||||
else if (criteria == NAME)
|
||||
return compareNames(r1, r2);
|
||||
else if (criteria == TYPE)
|
||||
return compareTypes(r1, r2);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a number reflecting the collation order of the given elements
|
||||
* based on their class.
|
||||
*
|
||||
* @param element1 the first element to be ordered
|
||||
* @param element2 the second element to be ordered
|
||||
* @return a negative number if the first element is less than the
|
||||
* second element; the value <code>0</code> if the first element is
|
||||
* equal to the second element; and a positive number if the first
|
||||
* element is greater than the second element
|
||||
*/
|
||||
protected int compareClass(Object element1, Object element2) {
|
||||
return classComparison(element1) - classComparison(element2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a number reflecting the collation order of the given resources
|
||||
* based on their resource names.
|
||||
*
|
||||
* @param resource1 the first resource element to be ordered
|
||||
* @param resource2 the second resource element to be ordered
|
||||
* @return a negative number if the first element is less than the
|
||||
* second element; the value <code>0</code> if the first element is
|
||||
* equal to the second element; and a positive number if the first
|
||||
* element is greater than the second element
|
||||
*/
|
||||
protected int compareNames(IResource resource1, IResource resource2) {
|
||||
return collator.compare(resource1.getName(), resource2.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a number reflecting the collation order of the given resources
|
||||
* based on their respective file extensions. Resources with the same file
|
||||
* extension will be collated based on their names.
|
||||
*
|
||||
* @param resource1 the first resource element to be ordered
|
||||
* @param resource2 the second resource element to be ordered
|
||||
* @return a negative number if the first element is less than the
|
||||
* second element; the value <code>0</code> if the first element is
|
||||
* equal to the second element; and a positive number if the first
|
||||
* element is greater than the second element
|
||||
*/
|
||||
protected int compareTypes(IResource resource1, IResource resource2) {
|
||||
String ext1 = getExtensionFor(resource1);
|
||||
String ext2 = getExtensionFor(resource2);
|
||||
|
||||
// Compare extensions. If they're different then return a value that
|
||||
// indicates correct extension ordering. If they're the same then
|
||||
// return a value that indicates the correct NAME ordering.
|
||||
int result = collator.compare(ext1, ext2);
|
||||
|
||||
if (result != 0) // ie.- different extensions
|
||||
return result;
|
||||
|
||||
return compareNames(resource1, resource2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sort criteria of this this sorter.
|
||||
*
|
||||
* @return the sort criterion: one of <code>NAME</code> or <code>TYPE</code>
|
||||
*/
|
||||
public int getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the extension portion of the given resource.
|
||||
*
|
||||
* @param resource the resource
|
||||
* @return the file extension, possibily the empty string
|
||||
*/
|
||||
private String getExtensionFor(IResource resource) {
|
||||
String ext = resource.getFileExtension();
|
||||
return ext == null ? "" : ext; //$NON-NLS-1$
|
||||
}
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
package org.eclipse.cdt.internal.ui.dnd;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
import org.eclipse.swt.dnd.DND;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
package org.eclipse.cdt.internal.ui.dnd;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.StructuredViewer;
|
||||
import org.eclipse.swt.dnd.DragSourceEvent;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
package org.eclipse.cdt.internal.ui.dnd;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.StructuredViewer;
|
||||
import org.eclipse.swt.dnd.DND;
|
||||
import org.eclipse.swt.dnd.DropTargetEvent;
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.ArrayList;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.swt.dnd.DragSource;
|
||||
import org.eclipse.swt.dnd.DragSourceEvent;
|
||||
import org.eclipse.swt.dnd.DragSourceListener;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
package org.eclipse.cdt.internal.ui.dnd;
|
||||
|
||||
import org.eclipse.core.runtime.SafeRunner;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.util.SafeRunnable;
|
||||
import org.eclipse.swt.dnd.DND;
|
||||
import org.eclipse.swt.dnd.DropTargetEvent;
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.eclipse.core.runtime.MultiStatus;
|
|||
import org.eclipse.core.runtime.SubProgressMonitor;
|
||||
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
||||
import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* IBM Corporation - initial API and implementation
|
||||
* Anton Leherbauer (Wind River Systems) - 148114 Disable move-refactor in CView
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui.dnd;
|
||||
|
||||
|
@ -15,14 +16,15 @@ import java.util.Collections;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.CUIMessages;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.util.LocalSelectionTransfer;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.swt.dnd.DND;
|
||||
import org.eclipse.swt.dnd.DragSource;
|
||||
import org.eclipse.swt.dnd.DragSourceEvent;
|
||||
|
@ -32,6 +34,8 @@ import org.eclipse.swt.widgets.Shell;
|
|||
import org.eclipse.ui.actions.ReadOnlyStateChecker;
|
||||
import org.eclipse.ui.part.ResourceTransfer;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.CUIMessages;
|
||||
|
||||
/**
|
||||
* A drag adapter that transfers the current selection as </code>
|
||||
* IResource</code>. Only those elements in the selection are part
|
||||
|
@ -57,7 +61,11 @@ public class ResourceTransferDragAdapter implements TransferDragSourceListener {
|
|||
}
|
||||
|
||||
public void dragStart(DragSourceEvent event) {
|
||||
event.doit = getSelectedResources().length > 0;
|
||||
IResource[] resources = getSelectedResources();
|
||||
event.doit = resources.length > 0;
|
||||
// Need to set selection to LocalSelectionTransfer because this
|
||||
// is used in ResourceTransferDropAdapter to validate the drop
|
||||
LocalSelectionTransfer.getTransfer().setSelection(new StructuredSelection(resources));
|
||||
}
|
||||
|
||||
public void dragSetData(DragSourceEvent event) {
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.eclipse.cdt.internal.ui.viewsupport.CUILabelProvider;
|
|||
import org.eclipse.cdt.internal.ui.viewsupport.ProblemsLabelDecorator;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.IEditorInput;
|
||||
|
|
|
@ -12,7 +12,7 @@ package org.eclipse.cdt.internal.ui.editor;
|
|||
|
||||
import org.eclipse.jface.action.IAction;
|
||||
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.text.IRegion;
|
||||
import org.eclipse.jface.text.hyperlink.IHyperlink;
|
||||
|
||||
|
|
|
@ -399,7 +399,6 @@ public class CSourceViewer extends ProjectionViewer implements IPropertyChangeLi
|
|||
* This is a performance optimization to reduce the computation of
|
||||
* the text presentation triggered by {@link #setVisibleDocument(IDocument)}
|
||||
* </p>
|
||||
* @see #prepareDelayedProjection()
|
||||
* @since 4.0
|
||||
*/
|
||||
protected void setVisibleDocument(IDocument document) {
|
||||
|
|
|
@ -40,7 +40,7 @@ import org.eclipse.jface.text.DefaultLineTracker;
|
|||
import org.eclipse.jface.text.DocumentEvent;
|
||||
import org.eclipse.jface.text.IDocument;
|
||||
import org.eclipse.jface.text.IDocumentListener;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
package org.eclipse.cdt.internal.ui.editor;
|
||||
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import org.eclipse.cdt.core.model.IWorkingCopy;
|
|||
import org.eclipse.cdt.ui.IWorkingCopyManager;
|
||||
import org.eclipse.cdt.ui.IWorkingCopyManagerExtension;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.ui.IEditorInput;
|
||||
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.eclipse.swt.widgets.Text;
|
|||
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
|
||||
import org.eclipse.cdt.internal.ui.util.SWTUtil;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.ArrayContentProvider;
|
||||
import org.eclipse.jface.viewers.CheckStateChangedEvent;
|
||||
import org.eclipse.jface.viewers.CheckboxTableViewer;
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.eclipse.core.runtime.IConfigurationElement;
|
|||
import org.eclipse.core.runtime.IExtensionRegistry;
|
||||
import org.eclipse.core.runtime.ISafeRunnable;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.util.SafeRunnable;
|
||||
import org.eclipse.jface.viewers.ViewerFilter;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.eclipse.core.runtime.FileLocator;
|
|||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.ui.IActionBars;
|
||||
import org.eclipse.ui.IViewPart;
|
||||
import org.eclipse.ui.actions.ActionGroup;
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
|
||||
package org.eclipse.cdt.internal.ui.preferences;
|
||||
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.resource.JFaceResources;
|
||||
import org.eclipse.jface.text.source.SourceViewer;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.eclipse.swt.events.DisposeEvent;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000 2005 IBM Corporation and others.
|
||||
* Copyright (c) 2000, 2006 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -11,14 +11,9 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui.preferences;
|
||||
|
||||
/*
|
||||
* (c) Copyright IBM Corp. 2000, 2001.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.preference.PreferenceStore;
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package org.eclipse.cdt.internal.ui.preferences;
|
|||
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.eclipse.swt.SWT;
|
||||
|
|
|
@ -14,7 +14,7 @@ package org.eclipse.cdt.internal.ui.text;
|
|||
import org.eclipse.jface.text.BadLocationException;
|
||||
import org.eclipse.jface.text.IDocument;
|
||||
import org.eclipse.jface.text.rules.ICharacterScanner;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
|
||||
/**
|
||||
* A buffered document scanner. The buffer always contains a section
|
||||
|
|
|
@ -14,7 +14,7 @@ package org.eclipse.cdt.internal.ui.text;
|
|||
import com.ibm.icu.text.BreakIterator;
|
||||
import java.text.CharacterIterator;
|
||||
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,7 +13,7 @@ package org.eclipse.cdt.internal.ui.text;
|
|||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.StyleRange;
|
||||
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.text.BadLocationException;
|
||||
import org.eclipse.jface.text.IDocument;
|
||||
import org.eclipse.jface.text.IRegion;
|
||||
|
|
|
@ -46,7 +46,7 @@ import org.eclipse.jface.text.rules.RuleBasedScanner;
|
|||
import org.eclipse.jface.text.source.IAnnotationHover;
|
||||
import org.eclipse.jface.text.source.ISourceViewer;
|
||||
import org.eclipse.jface.text.source.SourceViewerConfiguration;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
|
|
@ -14,7 +14,7 @@ package org.eclipse.cdt.internal.ui.text;
|
|||
import com.ibm.icu.text.BreakIterator;
|
||||
import java.text.CharacterIterator;
|
||||
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,7 +12,7 @@ package org.eclipse.cdt.internal.ui.text;
|
|||
|
||||
import java.text.CharacterIterator;
|
||||
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.text.BadLocationException;
|
||||
import org.eclipse.jface.text.IDocument;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ package org.eclipse.cdt.internal.ui.text;
|
|||
|
||||
import java.text.CharacterIterator;
|
||||
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.eclipse.core.runtime.IExtensionRegistry;
|
|||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.osgi.framework.Bundle;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import org.eclipse.cdt.ui.CUIPlugin;
|
|||
import org.eclipse.cdt.ui.text.ICCompletionProposal;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.preference.PreferenceConverter;
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.text.BadLocationException;
|
||||
import org.eclipse.jface.text.BadPositionCategoryException;
|
||||
import org.eclipse.jface.text.DefaultPositionUpdater;
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.eclipse.jface.text.templates.Template;
|
|||
import org.eclipse.jface.text.templates.TemplateContext;
|
||||
import org.eclipse.jface.text.templates.TemplateContextType;
|
||||
import org.eclipse.jface.text.templates.TemplateProposal;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.eclipse.swt.graphics.Image;
|
|||
import org.eclipse.swt.widgets.Display;
|
||||
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
|
||||
/**
|
||||
* A registry that maps <code>ImageDescriptors</code> to <code>Image</code>.
|
||||
|
|
|
@ -13,7 +13,7 @@ package org.eclipse.cdt.internal.ui.util;
|
|||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
|
||||
/**
|
||||
* Helper class to layout a number of children if the composite uses a <code>GridLayout</code>.
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.eclipse.swt.widgets.Widget;
|
|||
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.resource.JFaceResources;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
|
||||
/**
|
||||
* Utility class to simplify access to some SWT resources.
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.eclipse.swt.widgets.Composite;
|
|||
import org.eclipse.swt.widgets.Table;
|
||||
import org.eclipse.swt.widgets.TableColumn;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.ColumnLayoutData;
|
||||
import org.eclipse.jface.viewers.ColumnPixelData;
|
||||
import org.eclipse.jface.viewers.ColumnWeightData;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui.util;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -41,7 +41,7 @@ public class SourceFolderSelectionDialog extends ElementTreeSelectionDialog {
|
|||
public SourceFolderSelectionDialog(Shell parent) {
|
||||
super(parent, fLabelProvider, fContentProvider);
|
||||
setValidator(fValidator);
|
||||
setSorter(fSorter);
|
||||
setComparator(fSorter);
|
||||
addFilter(fFilter);
|
||||
setTitle(NewWizardMessages.getString("SourceFolderSelectionDialog.title")); //$NON-NLS-1$
|
||||
setMessage(NewWizardMessages.getString("SourceFolderSelectionDialog.description")); //$NON-NLS-1$
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.ArrayList;
|
|||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.CheckStateChangedEvent;
|
||||
import org.eclipse.jface.viewers.CheckboxTableViewer;
|
||||
import org.eclipse.jface.viewers.IBaseLabelProvider;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui.wizards.dialogfields;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.eclipse.swt.widgets.Label;
|
|||
import org.eclipse.swt.widgets.Table;
|
||||
import org.eclipse.swt.widgets.TableColumn;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.ColumnLayoutData;
|
||||
import org.eclipse.jface.viewers.ColumnWeightData;
|
||||
import org.eclipse.jface.viewers.DoubleClickEvent;
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.eclipse.swt.widgets.Control;
|
|||
import org.eclipse.swt.widgets.Group;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
|
||||
/**
|
||||
* Dialog field describing a group with buttons (Checkboxes, radio buttons..)
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.eclipse.swt.widgets.Display;
|
|||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Tree;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.DoubleClickEvent;
|
||||
import org.eclipse.jface.viewers.IDoubleClickListener;
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
|
|
|
@ -15,33 +15,6 @@ import java.util.HashSet;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.cdt.core.CCProjectNature;
|
||||
import org.eclipse.cdt.core.CProjectNature;
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.model.CoreModelUtil;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ICModelStatus;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.model.IPathEntry;
|
||||
import org.eclipse.cdt.core.model.ISourceEntry;
|
||||
import org.eclipse.cdt.core.model.ISourceRoot;
|
||||
import org.eclipse.cdt.internal.core.model.PathEntryManager;
|
||||
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.StatusInfo;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.TypedElementSelectionValidator;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.TypedViewerFilter;
|
||||
import org.eclipse.cdt.internal.ui.util.CoreUtility;
|
||||
import org.eclipse.cdt.internal.ui.util.EditorUtility;
|
||||
import org.eclipse.cdt.internal.ui.wizards.NewElementWizardPage;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.IStringButtonAdapter;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.LayoutUtil;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.SelectionButtonDialogField;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
|
||||
import org.eclipse.cdt.ui.CElementLabelProvider;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
|
@ -69,7 +42,37 @@ import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
|
|||
import org.eclipse.ui.dialogs.ISelectionStatusValidator;
|
||||
import org.eclipse.ui.model.WorkbenchContentProvider;
|
||||
import org.eclipse.ui.model.WorkbenchLabelProvider;
|
||||
import org.eclipse.ui.views.navigator.ResourceSorter;
|
||||
import org.eclipse.ui.views.navigator.ResourceComparator;
|
||||
|
||||
import org.eclipse.cdt.core.CCProjectNature;
|
||||
import org.eclipse.cdt.core.CProjectNature;
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.model.CoreModelUtil;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ICModelStatus;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.model.IPathEntry;
|
||||
import org.eclipse.cdt.core.model.ISourceEntry;
|
||||
import org.eclipse.cdt.core.model.ISourceRoot;
|
||||
import org.eclipse.cdt.ui.CElementLabelProvider;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
|
||||
import org.eclipse.cdt.internal.core.model.PathEntryManager;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.StatusInfo;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.TypedElementSelectionValidator;
|
||||
import org.eclipse.cdt.internal.ui.dialogs.TypedViewerFilter;
|
||||
import org.eclipse.cdt.internal.ui.util.CoreUtility;
|
||||
import org.eclipse.cdt.internal.ui.util.EditorUtility;
|
||||
import org.eclipse.cdt.internal.ui.wizards.NewElementWizardPage;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.IStringButtonAdapter;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.LayoutUtil;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.SelectionButtonDialogField;
|
||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
|
||||
|
||||
public class NewSourceFolderWizardPage extends NewElementWizardPage {
|
||||
|
||||
|
@ -452,7 +455,7 @@ public class NewSourceFolderWizardPage extends NewElementWizardPage {
|
|||
dialog.setMessage(message);
|
||||
dialog.addFilter(filter);
|
||||
dialog.setInput(currProject);
|
||||
dialog.setSorter(new ResourceSorter(ResourceSorter.NAME));
|
||||
dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
|
||||
IResource res= currProject.findMember(initialPath);
|
||||
if (res != null) {
|
||||
dialog.setInitialSelection(res);
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.eclipse.swt.graphics.Point;
|
|||
import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||
import org.eclipse.jface.resource.CompositeImageDescriptor;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -226,7 +226,7 @@ public class CElementSorter extends ViewerSorter {
|
|||
if (cat1 == PROJECTS) {
|
||||
IWorkbenchAdapter a1= (IWorkbenchAdapter)((IAdaptable)e1).getAdapter(IWorkbenchAdapter.class);
|
||||
IWorkbenchAdapter a2= (IWorkbenchAdapter)((IAdaptable)e2).getAdapter(IWorkbenchAdapter.class);
|
||||
return getCollator().compare(a1.getLabel(e1), a2.getLabel(e2));
|
||||
return getComparator().compare(a1.getLabel(e1), a2.getLabel(e2));
|
||||
}
|
||||
|
||||
if (cat1 == SOURCEROOTS) {
|
||||
|
@ -289,7 +289,7 @@ public class CElementSorter extends ViewerSorter {
|
|||
} else {
|
||||
name2 = e2.toString();
|
||||
}
|
||||
int result = getCollator().compare(name1, name2);
|
||||
int result = getComparator().compare(name1, name2);
|
||||
if (result == 0 && (e1destructor != e2destructor)) {
|
||||
result = e1destructor ? 1 : -1;
|
||||
}
|
||||
|
@ -312,7 +312,7 @@ public class CElementSorter extends ViewerSorter {
|
|||
String name1 = lprov.getText(e1);
|
||||
String name2 = lprov.getText(e2);
|
||||
if (name1 != null && name2 != null) {
|
||||
return getCollator().compare(name1, name2);
|
||||
return getComparator().compare(name1, name2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ import org.eclipse.jface.action.IMenuManager;
|
|||
import org.eclipse.jface.action.IToolBarManager;
|
||||
import org.eclipse.jface.action.Separator;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.IContentProvider;
|
||||
import org.eclipse.jface.viewers.ITreeContentProvider;
|
||||
import org.eclipse.jface.viewers.StructuredViewer;
|
||||
|
|
|
@ -19,7 +19,7 @@ import org.eclipse.jface.action.IAction;
|
|||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.action.MenuManager;
|
||||
import org.eclipse.jface.action.Separator;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.eclipse.cdt.internal.ui.actions.ActionMessages;
|
|||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.action.IToolBarManager;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.StructuredViewer;
|
||||
import org.eclipse.swt.custom.BusyIndicator;
|
||||
import org.eclipse.ui.IActionBars;
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.eclipse.swt.widgets.Shell;
|
|||
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.text.ITextSelection;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
|
|
|
@ -14,7 +14,7 @@ package org.eclipse.cdt.utils.ui.controls;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.DisposeEvent;
|
||||
import org.eclipse.swt.events.DisposeListener;
|
||||
|
|
Loading…
Add table
Reference in a new issue