mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 17:55:39 +02:00
2004-12-22 Alain Magloire
On going work to clean cdt.ui from misc. warnings and removing the deprecated interfaces in Eclipse-3.1
This commit is contained in:
parent
aee9e0e44e
commit
cc17803d62
17 changed files with 120 additions and 142 deletions
|
@ -58,7 +58,11 @@ public class NewClassCodeGenerator {
|
||||||
private boolean fCreateIncludePaths = true;
|
private boolean fCreateIncludePaths = true;
|
||||||
|
|
||||||
public static class CodeGeneratorException extends Exception {
|
public static class CodeGeneratorException extends Exception {
|
||||||
public CodeGeneratorException(String message) {
|
/**
|
||||||
|
* Comment for <code>serialVersionUID</code>
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
public CodeGeneratorException(String message) {
|
||||||
}
|
}
|
||||||
public CodeGeneratorException(Throwable e) {
|
public CodeGeneratorException(Throwable e) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -780,7 +780,7 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateFilesFromClassName(String className) {
|
void updateFilesFromClassName(String className) {
|
||||||
String headerName = ""; //$NON-NLS-1$
|
String headerName = ""; //$NON-NLS-1$
|
||||||
String sourceName = ""; //$NON-NLS-1$
|
String sourceName = ""; //$NON-NLS-1$
|
||||||
if (className.length() > 0) {
|
if (className.length() > 0) {
|
||||||
|
@ -922,9 +922,8 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
if (resType == IResource.PROJECT) {
|
if (resType == IResource.PROJECT) {
|
||||||
status.setError(NewClassWizardMessages.getString("NewClassCreationWizardPage.warning.NotACProject")); //$NON-NLS-1$
|
status.setError(NewClassWizardMessages.getString("NewClassCreationWizardPage.warning.NotACProject")); //$NON-NLS-1$
|
||||||
return status;
|
return status;
|
||||||
} else {
|
|
||||||
status.setWarning(NewClassWizardMessages.getString("NewClassCreationWizardPage.warning.NotInACProject")); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
|
status.setWarning(NewClassWizardMessages.getString("NewClassCreationWizardPage.warning.NotInACProject")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
ICElement e = CoreModel.getDefault().create(res.getFullPath());
|
ICElement e = CoreModel.getDefault().create(res.getFullPath());
|
||||||
if (CModelUtil.getSourceFolder(e) == null) {
|
if (CModelUtil.getSourceFolder(e) == null) {
|
||||||
|
@ -1018,25 +1017,24 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
status.setError(NewClassWizardMessages.getString("NewClassCreationWizardPage.error.NamespaceExistsDifferentCase")); //$NON-NLS-1$
|
status.setError(NewClassWizardMessages.getString("NewClassCreationWizardPage.error.NamespaceExistsDifferentCase")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
} else {
|
|
||||||
// look for other types
|
|
||||||
exactMatch = false;
|
|
||||||
for (int i = 0; i < types.length; ++i) {
|
|
||||||
ITypeInfo currType = types[i];
|
|
||||||
if (currType.getCElementType() != ICElement.C_NAMESPACE) {
|
|
||||||
exactMatch = currType.getQualifiedTypeName().equals(typeName);
|
|
||||||
if (exactMatch) {
|
|
||||||
// found a matching type
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (exactMatch) {
|
|
||||||
status.setWarning(NewClassWizardMessages.getString("NewClassCreationWizardPage.error.TypeMatchingNamespaceExists")); //$NON-NLS-1$
|
|
||||||
} else {
|
|
||||||
status.setWarning(NewClassWizardMessages.getString("NewClassCreationWizardPage.error.TypeMatchingNamespaceExistsDifferentCase")); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// look for other types
|
||||||
|
exactMatch = false;
|
||||||
|
for (int i = 0; i < types.length; ++i) {
|
||||||
|
ITypeInfo currType = types[i];
|
||||||
|
if (currType.getCElementType() != ICElement.C_NAMESPACE) {
|
||||||
|
exactMatch = currType.getQualifiedTypeName().equals(typeName);
|
||||||
|
if (exactMatch) {
|
||||||
|
// found a matching type
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (exactMatch) {
|
||||||
|
status.setWarning(NewClassWizardMessages.getString("NewClassCreationWizardPage.error.TypeMatchingNamespaceExists")); //$NON-NLS-1$
|
||||||
|
} else {
|
||||||
|
status.setWarning(NewClassWizardMessages.getString("NewClassCreationWizardPage.error.TypeMatchingNamespaceExistsDifferentCase")); //$NON-NLS-1$
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
status.setWarning(NewClassWizardMessages.getString("NewClassCreationWizardPage.warning.NamespaceNotExists")); //$NON-NLS-1$
|
status.setWarning(NewClassWizardMessages.getString("NewClassCreationWizardPage.warning.NamespaceNotExists")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
@ -1169,27 +1167,26 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
status.setError(NewClassWizardMessages.getString("NewClassCreationWizardPage.error.ClassNameExistsDifferentCase")); //$NON-NLS-1$
|
status.setError(NewClassWizardMessages.getString("NewClassCreationWizardPage.error.ClassNameExistsDifferentCase")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
} else {
|
|
||||||
// look for other types
|
|
||||||
exactMatch = false;
|
|
||||||
for (int i = 0; i < types.length; ++i) {
|
|
||||||
ITypeInfo currType = types[i];
|
|
||||||
if (currType.getCElementType() != ICElement.C_CLASS
|
|
||||||
&& currType.getCElementType() != ICElement.C_STRUCT) {
|
|
||||||
exactMatch = currType.getQualifiedTypeName().equals(fullyQualifiedName);
|
|
||||||
if (exactMatch) {
|
|
||||||
// found a matching type
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (exactMatch) {
|
|
||||||
status.setError(NewClassWizardMessages.getString("NewClassCreationWizardPage.error.TypeMatchingClassExists")); //$NON-NLS-1$
|
|
||||||
} else {
|
|
||||||
status.setError(NewClassWizardMessages.getString("NewClassCreationWizardPage.error.TypeMatchingClassExistsDifferentCase")); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
// look for other types
|
||||||
|
exactMatch = false;
|
||||||
|
for (int i = 0; i < types.length; ++i) {
|
||||||
|
ITypeInfo currType = types[i];
|
||||||
|
if (currType.getCElementType() != ICElement.C_CLASS
|
||||||
|
&& currType.getCElementType() != ICElement.C_STRUCT) {
|
||||||
|
exactMatch = currType.getQualifiedTypeName().equals(fullyQualifiedName);
|
||||||
|
if (exactMatch) {
|
||||||
|
// found a matching type
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (exactMatch) {
|
||||||
|
status.setError(NewClassWizardMessages.getString("NewClassCreationWizardPage.error.TypeMatchingClassExists")); //$NON-NLS-1$
|
||||||
|
} else {
|
||||||
|
status.setError(NewClassWizardMessages.getString("NewClassCreationWizardPage.error.TypeMatchingClassExistsDifferentCase")); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
|
@ -1240,19 +1237,18 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
if (baseProject != null) {
|
if (baseProject != null) {
|
||||||
if (baseProject.equals(project)) {
|
if (baseProject.equals(project)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
ITypeReference ref = type.getResolvedReference();
|
ITypeReference ref = type.getResolvedReference();
|
||||||
for (int i = 0; i < includePaths.length; ++i) {
|
for (int i = 0; i < includePaths.length; ++i) {
|
||||||
IPath includePath = new Path(includePaths[i]);
|
IPath includePath = new Path(includePaths[i]);
|
||||||
if (ref != null) {
|
if (ref != null) {
|
||||||
if (includePath.isPrefixOf(ref.getLocation()))
|
if (includePath.isPrefixOf(ref.getLocation()))
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// we don't have the real location, so just check the project path
|
// we don't have the real location, so just check the project path
|
||||||
if (baseProject.getLocation().isPrefixOf(includePath))
|
if (baseProject.getLocation().isPrefixOf(includePath))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -2175,15 +2171,14 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IPath updateSourceFolderFromPath(IPath filePath) {
|
IPath updateSourceFolderFromPath(IPath filePath) {
|
||||||
ICElement folder = getSourceFolderFromPath(filePath);
|
ICElement folder = getSourceFolderFromPath(filePath);
|
||||||
if (folder != null) {
|
if (folder != null) {
|
||||||
return folder.getPath();
|
return folder.getPath();
|
||||||
} else {
|
|
||||||
IProject proj = PathUtil.getEnclosingProject(filePath);
|
|
||||||
if (proj != null)
|
|
||||||
return proj.getFullPath();
|
|
||||||
}
|
}
|
||||||
|
IProject proj = PathUtil.getEnclosingProject(filePath);
|
||||||
|
if (proj != null)
|
||||||
|
return proj.getFullPath();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,24 +64,24 @@ import org.eclipse.ui.dialogs.SelectionStatusDialog;
|
||||||
|
|
||||||
public class SourceFileSelectionDialog extends SelectionStatusDialog {
|
public class SourceFileSelectionDialog extends SelectionStatusDialog {
|
||||||
|
|
||||||
private TreeViewer fViewer;
|
TreeViewer fViewer;
|
||||||
private final ITreeContentProvider fContentProvider = new CElementContentProvider();
|
private final ITreeContentProvider fContentProvider = new CElementContentProvider();
|
||||||
private final ILabelProvider fLabelProvider = new CElementLabelProvider(CElementLabelProvider.SHOW_DEFAULT);
|
private final ILabelProvider fLabelProvider = new CElementLabelProvider(CElementLabelProvider.SHOW_DEFAULT);
|
||||||
private IStatus fCurrStatus = new StatusInfo();
|
IStatus fCurrStatus = new StatusInfo();
|
||||||
private IStatus fFolderNameStatus = new StatusInfo();
|
IStatus fFolderNameStatus = new StatusInfo();
|
||||||
private IStatus fFileNameStatus = new StatusInfo();
|
IStatus fFileNameStatus = new StatusInfo();
|
||||||
private ICElement fInput;
|
ICElement fInput;
|
||||||
private int fWidth = 60;
|
private int fWidth = 60;
|
||||||
private int fHeight = 18;
|
private int fHeight = 18;
|
||||||
private StringDialogField fFolderNameDialogField;
|
StringDialogField fFolderNameDialogField;
|
||||||
private StringDialogField fFileNameDialogField;
|
StringDialogField fFileNameDialogField;
|
||||||
private IWorkspaceRoot fWorkspaceRoot;
|
private IWorkspaceRoot fWorkspaceRoot;
|
||||||
private final FieldsAdapter fFieldsAdapter = new FieldsAdapter();
|
private final FieldsAdapter fFieldsAdapter = new FieldsAdapter();
|
||||||
|
|
||||||
private ICElement fCurrentFolder = null;
|
private ICElement fCurrentFolder = null;
|
||||||
private String fCurrentFileString = null;
|
private String fCurrentFileString = null;
|
||||||
private String fInitialFolderName = null;
|
String fInitialFolderName = null;
|
||||||
private String fInitialFileName = null;
|
String fInitialFileName = null;
|
||||||
|
|
||||||
private final class FieldsAdapter extends SelectionAdapter
|
private final class FieldsAdapter extends SelectionAdapter
|
||||||
implements ISelectionChangedListener, IDoubleClickListener, IDialogFieldListener {
|
implements ISelectionChangedListener, IDoubleClickListener, IDialogFieldListener {
|
||||||
|
@ -149,7 +149,7 @@ public class SourceFileSelectionDialog extends SelectionStatusDialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Class[] FILTER_TYPES = new Class[] {
|
static final Class[] FILTER_TYPES = new Class[] {
|
||||||
ICModel.class,
|
ICModel.class,
|
||||||
ICProject.class,
|
ICProject.class,
|
||||||
ICContainer.class,
|
ICContainer.class,
|
||||||
|
@ -247,7 +247,7 @@ public class SourceFileSelectionDialog extends SelectionStatusDialog {
|
||||||
updateStatus(StatusUtil.getMostSevere(status));
|
updateStatus(StatusUtil.getMostSevere(status));
|
||||||
}
|
}
|
||||||
|
|
||||||
private IStatus folderNameChanged() {
|
IStatus folderNameChanged() {
|
||||||
StatusInfo status = new StatusInfo();
|
StatusInfo status = new StatusInfo();
|
||||||
|
|
||||||
fCurrentFolder = null;
|
fCurrentFolder = null;
|
||||||
|
@ -277,9 +277,8 @@ public class SourceFileSelectionDialog extends SelectionStatusDialog {
|
||||||
if (resType == IResource.PROJECT) {
|
if (resType == IResource.PROJECT) {
|
||||||
status.setError(NewClassWizardMessages.getString("SourceFileSelectionDialog.warning.NotACProject")); //$NON-NLS-1$
|
status.setError(NewClassWizardMessages.getString("SourceFileSelectionDialog.warning.NotACProject")); //$NON-NLS-1$
|
||||||
return status;
|
return status;
|
||||||
} else {
|
|
||||||
status.setWarning(NewClassWizardMessages.getString("SourceFileSelectionDialog.warning.NotInACProject")); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
|
status.setWarning(NewClassWizardMessages.getString("SourceFileSelectionDialog.warning.NotInACProject")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
status.setError(NewClassWizardMessages.getFormattedString("SourceFileSelectionDialog.error.NotAFolder", str)); //$NON-NLS-1$
|
status.setError(NewClassWizardMessages.getFormattedString("SourceFileSelectionDialog.error.NotAFolder", str)); //$NON-NLS-1$
|
||||||
|
@ -292,7 +291,7 @@ public class SourceFileSelectionDialog extends SelectionStatusDialog {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IStatus fileNameChanged() {
|
IStatus fileNameChanged() {
|
||||||
StatusInfo status = new StatusInfo();
|
StatusInfo status = new StatusInfo();
|
||||||
|
|
||||||
fCurrentFileString = null;
|
fCurrentFileString = null;
|
||||||
|
@ -382,7 +381,7 @@ public class SourceFileSelectionDialog extends SelectionStatusDialog {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
private void superCreate() {
|
void superCreate() {
|
||||||
super.create();
|
super.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -496,7 +495,7 @@ public class SourceFileSelectionDialog extends SelectionStatusDialog {
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setPathFields(String folderName, String fileName) {
|
void setPathFields(String folderName, String fileName) {
|
||||||
fFolderNameDialogField.setTextWithoutUpdate(folderName != null ? folderName : ""); //$NON-NLS-1$
|
fFolderNameDialogField.setTextWithoutUpdate(folderName != null ? folderName : ""); //$NON-NLS-1$
|
||||||
fFileNameDialogField.setTextWithoutUpdate(fileName != null ? fileName : ""); //$NON-NLS-1$
|
fFileNameDialogField.setTextWithoutUpdate(fileName != null ? fileName : ""); //$NON-NLS-1$
|
||||||
fFolderNameStatus = folderNameChanged();
|
fFolderNameStatus = folderNameChanged();
|
||||||
|
|
|
@ -183,7 +183,7 @@ public class CheckedListDialogField extends ListDialogField {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void doCheckStateChanged(CheckStateChangedEvent e) {
|
void doCheckStateChanged(CheckStateChangedEvent e) {
|
||||||
if (e.getChecked()) {
|
if (e.getChecked()) {
|
||||||
fCheckElements.add(e.getElement());
|
fCheckElements.add(e.getElement());
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class LinkToFileGroup extends StringButtonDialogField {
|
||||||
protected Button browseButton;
|
protected Button browseButton;
|
||||||
private Label resolvedPathLabelText;
|
private Label resolvedPathLabelText;
|
||||||
private Label resolvedPathLabelData;
|
private Label resolvedPathLabelData;
|
||||||
private boolean preventDialogFieldChanged = false;
|
boolean preventDialogFieldChanged = false;
|
||||||
|
|
||||||
public LinkToFileGroup(IStringButtonAdapter adapter, Listener listener) {
|
public LinkToFileGroup(IStringButtonAdapter adapter, Listener listener) {
|
||||||
super(adapter);
|
super(adapter);
|
||||||
|
|
|
@ -94,14 +94,13 @@ public class SelectionButtonDialogFieldGroup extends DialogField {
|
||||||
buttonsgroup.setLayoutData(gd);
|
buttonsgroup.setLayoutData(gd);
|
||||||
|
|
||||||
return new Control[] { label, buttonsgroup };
|
return new Control[] { label, buttonsgroup };
|
||||||
} else {
|
|
||||||
Composite buttonsgroup= getSelectionButtonsGroup(parent);
|
|
||||||
GridData gd= new GridData();
|
|
||||||
gd.horizontalSpan= nColumns;
|
|
||||||
buttonsgroup.setLayoutData(gd);
|
|
||||||
|
|
||||||
return new Control[] { buttonsgroup };
|
|
||||||
}
|
}
|
||||||
|
Composite buttonsgroup= getSelectionButtonsGroup(parent);
|
||||||
|
GridData gd= new GridData();
|
||||||
|
gd.horizontalSpan= nColumns;
|
||||||
|
buttonsgroup.setLayoutData(gd);
|
||||||
|
|
||||||
|
return new Control[] { buttonsgroup };
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -69,7 +69,7 @@ public abstract class AbstractFileCreationWizardPage extends NewElementWizardPag
|
||||||
private static final int SOURCE_FOLDER_ID = 1;
|
private static final int SOURCE_FOLDER_ID = 1;
|
||||||
protected static final int NEW_FILE_ID = 2;
|
protected static final int NEW_FILE_ID = 2;
|
||||||
private static final int ALL_FIELDS = SOURCE_FOLDER_ID | NEW_FILE_ID;
|
private static final int ALL_FIELDS = SOURCE_FOLDER_ID | NEW_FILE_ID;
|
||||||
private int fLastFocusedField = 0;
|
int fLastFocusedField = 0;
|
||||||
private StringButtonDialogField fSourceFolderDialogField;
|
private StringButtonDialogField fSourceFolderDialogField;
|
||||||
private IStatus fSourceFolderStatus;
|
private IStatus fSourceFolderStatus;
|
||||||
private IStatus fNewFileStatus;
|
private IStatus fNewFileStatus;
|
||||||
|
@ -380,9 +380,8 @@ public abstract class AbstractFileCreationWizardPage extends NewElementWizardPag
|
||||||
if (resType == IResource.PROJECT) {
|
if (resType == IResource.PROJECT) {
|
||||||
status.setError(NewFileWizardMessages.getString("AbstractFileCreationWizardPage.warning.NotACProject")); //$NON-NLS-1$
|
status.setError(NewFileWizardMessages.getString("AbstractFileCreationWizardPage.warning.NotACProject")); //$NON-NLS-1$
|
||||||
return status;
|
return status;
|
||||||
} else {
|
|
||||||
status.setWarning(NewFileWizardMessages.getString("AbstractFileCreationWizardPage.warning.NotInACProject")); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
|
status.setWarning(NewFileWizardMessages.getString("AbstractFileCreationWizardPage.warning.NotInACProject")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
ICElement e = CoreModel.getDefault().create(res.getFullPath());
|
ICElement e = CoreModel.getDefault().create(res.getFullPath());
|
||||||
if (CModelUtil.getSourceFolder(e) == null) {
|
if (CModelUtil.getSourceFolder(e) == null) {
|
||||||
|
@ -496,7 +495,7 @@ public abstract class AbstractFileCreationWizardPage extends NewElementWizardPag
|
||||||
*/
|
*/
|
||||||
protected abstract void setFocus();
|
protected abstract void setFocus();
|
||||||
|
|
||||||
private IPath chooseSourceFolder(IPath initialPath) {
|
IPath chooseSourceFolder(IPath initialPath) {
|
||||||
ICElement initElement = getSourceFolderFromPath(initialPath);
|
ICElement initElement = getSourceFolderFromPath(initialPath);
|
||||||
if (initElement instanceof ISourceRoot) {
|
if (initElement instanceof ISourceRoot) {
|
||||||
ICProject cProject = initElement.getCProject();
|
ICProject cProject = initElement.getCProject();
|
||||||
|
|
|
@ -67,8 +67,8 @@ public class CElementWorkingSetPage extends WizardPage implements IWorkingSetPag
|
||||||
private final static int SIZING_SELECTION_WIDGET_HEIGHT = 200;
|
private final static int SIZING_SELECTION_WIDGET_HEIGHT = 200;
|
||||||
|
|
||||||
private Text text;
|
private Text text;
|
||||||
private CheckboxTreeViewer tree;
|
CheckboxTreeViewer tree;
|
||||||
private IWorkingSet workingSet;
|
IWorkingSet workingSet;
|
||||||
private boolean firstCheck = false; // set to true if selection is set in setSelection
|
private boolean firstCheck = false; // set to true if selection is set in setSelection
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -245,7 +245,7 @@ public class CElementWorkingSetPage extends WizardPage implements IWorkingSetPag
|
||||||
*
|
*
|
||||||
* @param event the checked state change event.
|
* @param event the checked state change event.
|
||||||
*/
|
*/
|
||||||
private void handleCheckStateChange(final CheckStateChangedEvent event) {
|
void handleCheckStateChange(final CheckStateChangedEvent event) {
|
||||||
BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
|
BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
IResource resource = (IResource) event.getElement();
|
IResource resource = (IResource) event.getElement();
|
||||||
|
@ -343,7 +343,7 @@ public class CElementWorkingSetPage extends WizardPage implements IWorkingSetPag
|
||||||
* @param checkExpandedState true=recurse into sub-containers and set the
|
* @param checkExpandedState true=recurse into sub-containers and set the
|
||||||
* checked state. false=only set checked state of members of this container
|
* checked state. false=only set checked state of members of this container
|
||||||
*/
|
*/
|
||||||
private void setSubtreeChecked(IContainer container, boolean state, boolean checkExpandedState) {
|
void setSubtreeChecked(IContainer container, boolean state, boolean checkExpandedState) {
|
||||||
// checked state is set lazily on expand, don't set it if container is collapsed
|
// checked state is set lazily on expand, don't set it if container is collapsed
|
||||||
if (container.isAccessible() == false || (tree.getExpandedState(container) == false && state && checkExpandedState)) {
|
if (container.isAccessible() == false || (tree.getExpandedState(container) == false && state && checkExpandedState)) {
|
||||||
return;
|
return;
|
||||||
|
@ -379,7 +379,7 @@ public class CElementWorkingSetPage extends WizardPage implements IWorkingSetPag
|
||||||
* @param child the resource whose parent checked state should
|
* @param child the resource whose parent checked state should
|
||||||
* be set.
|
* be set.
|
||||||
*/
|
*/
|
||||||
private void updateParentState(IResource child) {
|
void updateParentState(IResource child) {
|
||||||
if (child == null || child.getParent() == null)
|
if (child == null || child.getParent() == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -405,7 +405,7 @@ public class CElementWorkingSetPage extends WizardPage implements IWorkingSetPag
|
||||||
* Validates the working set name and the checked state of the
|
* Validates the working set name and the checked state of the
|
||||||
* resource tree.
|
* resource tree.
|
||||||
*/
|
*/
|
||||||
private void validateInput() {
|
void validateInput() {
|
||||||
String errorMessage = null;
|
String errorMessage = null;
|
||||||
String newText = text.getText();
|
String newText = text.getText();
|
||||||
|
|
||||||
|
|
|
@ -136,28 +136,26 @@ public class WorkingSetFilter extends ViewerFilter {
|
||||||
// compare Java elements
|
// compare Java elements
|
||||||
ICElement searchedElement= element;
|
ICElement searchedElement= element;
|
||||||
while (scopeElement != null && searchedElement != null) {
|
while (scopeElement != null && searchedElement != null) {
|
||||||
if (searchedElement.equals(scopeElement))
|
if (searchedElement.equals(scopeElement)) {
|
||||||
return true;
|
return true;
|
||||||
else {
|
}
|
||||||
if (scopeElement instanceof ICProject && searchedElement instanceof ISourceRoot) {
|
if (scopeElement instanceof ICProject && searchedElement instanceof ISourceRoot) {
|
||||||
// ISourceRoot pkgRoot= (ISourceRoot)searchedElement;
|
// ISourceRoot pkgRoot= (ISourceRoot)searchedElement;
|
||||||
// if (pkgRoot.isExternal() && pkgRoot.isArchive()) {
|
// if (pkgRoot.isExternal() && pkgRoot.isArchive()) {
|
||||||
// if (((ICProject)scopeElement).isOnClasspath(searchedElement))
|
// if (((ICProject)scopeElement).isOnClasspath(searchedElement))
|
||||||
// return true;
|
// return true;
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
searchedElement= searchedElement.getParent();
|
searchedElement= searchedElement.getParent();
|
||||||
if (searchedElement != null && searchedElement.getElementType() == ICElement.C_UNIT) {
|
if (searchedElement != null && searchedElement.getElementType() == ICElement.C_UNIT) {
|
||||||
ITranslationUnit cu= (ITranslationUnit)searchedElement;
|
ITranslationUnit cu= (ITranslationUnit)searchedElement;
|
||||||
cu= CModelUtil.toOriginal(cu);
|
cu= CModelUtil.toOriginal(cu);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (scopeElement != null && element != null) {
|
while (scopeElement != null && element != null) {
|
||||||
if (element.equals(scopeElement))
|
if (element.equals(scopeElement))
|
||||||
return true;
|
return true;
|
||||||
else
|
scopeElement= scopeElement.getParent();
|
||||||
scopeElement= scopeElement.getParent();
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// compare resource paths
|
// compare resource paths
|
||||||
|
|
|
@ -192,12 +192,12 @@ public class WorkingSetFilterActionGroup extends ActionGroup {
|
||||||
fMenuManager.addMenuListener(fMenuListener);
|
fMenuManager.addMenuListener(fMenuListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removePreviousLRUWorkingSetActions(IMenuManager mm) {
|
void removePreviousLRUWorkingSetActions(IMenuManager mm) {
|
||||||
for (int i= 1; i <= fLRUMenuCount; i++)
|
for (int i= 1; i <= fLRUMenuCount; i++)
|
||||||
mm.remove(WorkingSetMenuContributionItem.getId(i));
|
mm.remove(WorkingSetMenuContributionItem.getId(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addLRUWorkingSetActions(IMenuManager mm) {
|
void addLRUWorkingSetActions(IMenuManager mm) {
|
||||||
IWorkingSet[] workingSets= PlatformUI.getWorkbench().getWorkingSetManager().getRecentWorkingSets();
|
IWorkingSet[] workingSets= PlatformUI.getWorkbench().getWorkingSetManager().getRecentWorkingSets();
|
||||||
List sortedWorkingSets= Arrays.asList(workingSets);
|
List sortedWorkingSets= Arrays.asList(workingSets);
|
||||||
Collections.sort(sortedWorkingSets, new WorkingSetComparator());
|
Collections.sort(sortedWorkingSets, new WorkingSetComparator());
|
||||||
|
@ -240,7 +240,7 @@ public class WorkingSetFilterActionGroup extends ActionGroup {
|
||||||
/*
|
/*
|
||||||
* Called by the working set change listener
|
* Called by the working set change listener
|
||||||
*/
|
*/
|
||||||
private void doPropertyChange(PropertyChangeEvent event) {
|
void doPropertyChange(PropertyChangeEvent event) {
|
||||||
String property= event.getProperty();
|
String property= event.getProperty();
|
||||||
if (IWorkingSetManager.CHANGE_WORKING_SET_NAME_CHANGE.equals(property)) {
|
if (IWorkingSetManager.CHANGE_WORKING_SET_NAME_CHANGE.equals(property)) {
|
||||||
fChangeListener.propertyChange(event);
|
fChangeListener.propertyChange(event);
|
||||||
|
|
|
@ -32,8 +32,8 @@ import org.eclipse.ui.PlatformUI;
|
||||||
public class WorkingSetMenuContributionItem extends ContributionItem {
|
public class WorkingSetMenuContributionItem extends ContributionItem {
|
||||||
|
|
||||||
private int fId;
|
private int fId;
|
||||||
private IWorkingSet fWorkingSet;
|
IWorkingSet fWorkingSet;
|
||||||
private WorkingSetFilterActionGroup fActionGroup;
|
WorkingSetFilterActionGroup fActionGroup;
|
||||||
private Image fImage;
|
private Image fImage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -225,9 +225,8 @@ public class CElementSorter extends ViewerSorter {
|
||||||
if (root1 == null) {
|
if (root1 == null) {
|
||||||
if (root2 == null) {
|
if (root2 == null) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
return 1;
|
||||||
} else if (root2 == null) {
|
} else if (root2 == null) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,10 +86,10 @@ public class CustomFiltersActionGroup extends ActionGroup {
|
||||||
class FilterActionMenuContributionItem extends ContributionItem {
|
class FilterActionMenuContributionItem extends ContributionItem {
|
||||||
|
|
||||||
private int fItemNumber;
|
private int fItemNumber;
|
||||||
private boolean fState;
|
boolean fState;
|
||||||
private String fFilterId;
|
String fFilterId;
|
||||||
private String fFilterName;
|
private String fFilterName;
|
||||||
private CustomFiltersActionGroup fActionGroup;
|
CustomFiltersActionGroup fActionGroup;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for FilterActionMenuContributionItem.
|
* Constructor for FilterActionMenuContributionItem.
|
||||||
|
@ -272,7 +272,7 @@ public class CustomFiltersActionGroup extends ActionGroup {
|
||||||
* @param filterId the id of the filter
|
* @param filterId the id of the filter
|
||||||
* @param state the filter state
|
* @param state the filter state
|
||||||
*/
|
*/
|
||||||
private void setFilter(String filterId, boolean state) {
|
void setFilter(String filterId, boolean state) {
|
||||||
// Renew filter id in LRU stack
|
// Renew filter id in LRU stack
|
||||||
fLRUFilterIdsStack.remove(filterId);
|
fLRUFilterIdsStack.remove(filterId);
|
||||||
fLRUFilterIdsStack.add(0, filterId);
|
fLRUFilterIdsStack.add(0, filterId);
|
||||||
|
@ -366,7 +366,7 @@ public class CustomFiltersActionGroup extends ActionGroup {
|
||||||
fMenuManager.addMenuListener(fMenuListener);
|
fMenuManager.addMenuListener(fMenuListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removePreviousLRUFilterActions(IMenuManager mm) {
|
void removePreviousLRUFilterActions(IMenuManager mm) {
|
||||||
if (fFilterIdsUsedInLastViewMenu == null)
|
if (fFilterIdsUsedInLastViewMenu == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -374,7 +374,7 @@ public class CustomFiltersActionGroup extends ActionGroup {
|
||||||
mm.remove(fFilterIdsUsedInLastViewMenu[i]);
|
mm.remove(fFilterIdsUsedInLastViewMenu[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addLRUFilterActions(IMenuManager mm) {
|
void addLRUFilterActions(IMenuManager mm) {
|
||||||
if (fLRUFilterIdsStack.isEmpty()) {
|
if (fLRUFilterIdsStack.isEmpty()) {
|
||||||
fFilterIdsUsedInLastViewMenu= null;
|
fFilterIdsUsedInLastViewMenu= null;
|
||||||
return;
|
return;
|
||||||
|
@ -704,7 +704,7 @@ public class CustomFiltersActionGroup extends ActionGroup {
|
||||||
|
|
||||||
// ---------- dialog related code ----------
|
// ---------- dialog related code ----------
|
||||||
|
|
||||||
private void openDialog() {
|
void openDialog() {
|
||||||
CustomFiltersDialog dialog= new CustomFiltersDialog(
|
CustomFiltersDialog dialog= new CustomFiltersDialog(
|
||||||
fViewer.getControl().getShell(),
|
fViewer.getControl().getShell(),
|
||||||
fTargetId,
|
fTargetId,
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class MemberFilterActionGroup extends ActionGroup {
|
||||||
private MemberFilterAction[] fFilterActions;
|
private MemberFilterAction[] fFilterActions;
|
||||||
private MemberFilter fFilter;
|
private MemberFilter fFilter;
|
||||||
|
|
||||||
private StructuredViewer fViewer;
|
StructuredViewer fViewer;
|
||||||
private String fViewerId;
|
private String fViewerId;
|
||||||
private boolean fInViewMenu;
|
private boolean fInViewMenu;
|
||||||
|
|
||||||
|
|
|
@ -205,9 +205,8 @@ public class OpenViewActionGroup extends ActionGroup {
|
||||||
public static boolean canActionBeAdded(ISelection selection) {
|
public static boolean canActionBeAdded(ISelection selection) {
|
||||||
if(selection instanceof ITextSelection) {
|
if(selection instanceof ITextSelection) {
|
||||||
return (((ITextSelection)selection).getLength() > 0);
|
return (((ITextSelection)selection).getLength() > 0);
|
||||||
} else {
|
|
||||||
return getElement(selection) != null;
|
|
||||||
}
|
}
|
||||||
|
return getElement(selection) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ICElement getElement(ISelection sel) {
|
private static ICElement getElement(ISelection sel) {
|
||||||
|
|
|
@ -14,7 +14,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.ICElement;
|
|
||||||
import org.eclipse.cdt.internal.ui.IContextMenuConstants;
|
import org.eclipse.cdt.internal.ui.IContextMenuConstants;
|
||||||
import org.eclipse.cdt.internal.ui.actions.ActionMessages;
|
import org.eclipse.cdt.internal.ui.actions.ActionMessages;
|
||||||
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
||||||
|
@ -22,13 +21,11 @@ import org.eclipse.cdt.internal.ui.refactoring.RefactoringMessages;
|
||||||
import org.eclipse.cdt.internal.ui.refactoring.actions.RedoRefactoringAction;
|
import org.eclipse.cdt.internal.ui.refactoring.actions.RedoRefactoringAction;
|
||||||
import org.eclipse.cdt.internal.ui.refactoring.actions.RenameRefactoringAction;
|
import org.eclipse.cdt.internal.ui.refactoring.actions.RenameRefactoringAction;
|
||||||
import org.eclipse.cdt.internal.ui.refactoring.actions.UndoRefactoringAction;
|
import org.eclipse.cdt.internal.ui.refactoring.actions.UndoRefactoringAction;
|
||||||
import org.eclipse.cdt.ui.CUIPlugin;
|
|
||||||
import org.eclipse.jface.action.Action;
|
import org.eclipse.jface.action.Action;
|
||||||
import org.eclipse.jface.action.IAction;
|
import org.eclipse.jface.action.IAction;
|
||||||
import org.eclipse.jface.action.IMenuManager;
|
import org.eclipse.jface.action.IMenuManager;
|
||||||
import org.eclipse.jface.action.MenuManager;
|
import org.eclipse.jface.action.MenuManager;
|
||||||
import org.eclipse.jface.action.Separator;
|
import org.eclipse.jface.action.Separator;
|
||||||
import org.eclipse.jface.text.IDocument;
|
|
||||||
import org.eclipse.jface.text.ITextSelection;
|
import org.eclipse.jface.text.ITextSelection;
|
||||||
import org.eclipse.jface.viewers.ISelection;
|
import org.eclipse.jface.viewers.ISelection;
|
||||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||||
|
@ -278,13 +275,4 @@ public class RefactoringActionGroup extends ActionGroup {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICElement getEditorInput() {
|
|
||||||
return CUIPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(
|
|
||||||
fEditor.getEditorInput());
|
|
||||||
}
|
|
||||||
|
|
||||||
private IDocument getDocument() {
|
|
||||||
return CUIPlugin.getDefault().getDocumentProvider().
|
|
||||||
getDocument(fEditor.getEditorInput());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.Preferences;
|
import org.eclipse.core.runtime.Preferences;
|
||||||
import org.eclipse.jface.preference.IPreferenceStore;
|
|
||||||
import org.eclipse.jface.resource.ImageDescriptor;
|
import org.eclipse.jface.resource.ImageDescriptor;
|
||||||
import org.eclipse.jface.wizard.WizardPage;
|
import org.eclipse.jface.wizard.WizardPage;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
@ -23,7 +22,6 @@ import org.eclipse.swt.widgets.Composite;
|
||||||
public abstract class NewCProjectWizardOptionPage extends WizardPage implements ICOptionContainer {
|
public abstract class NewCProjectWizardOptionPage extends WizardPage implements ICOptionContainer {
|
||||||
|
|
||||||
private TabFolderOptionBlock fOptionBlock;
|
private TabFolderOptionBlock fOptionBlock;
|
||||||
private IPreferenceStore preferenceStore;
|
|
||||||
|
|
||||||
public NewCProjectWizardOptionPage(String pageName) {
|
public NewCProjectWizardOptionPage(String pageName) {
|
||||||
this(pageName, null, null);
|
this(pageName, null, null);
|
||||||
|
|
Loading…
Add table
Reference in a new issue