mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 12:55:40 +02:00
[244035] - applied patch for class cast exception
This commit is contained in:
parent
513bac33e5
commit
4eb977ee74
2 changed files with 31 additions and 27 deletions
|
@ -909,6 +909,8 @@ implements
|
|||
if (!isNewOpening)
|
||||
handleResize(false); // save page size
|
||||
isNewOpening = true;
|
||||
// Remove this page from the property manager
|
||||
CDTPropertyManager.remove(this);
|
||||
// clear static variables
|
||||
if (CDTPropertyManager.getPagesCount() == 0) {
|
||||
resd = null;
|
||||
|
|
|
@ -39,6 +39,9 @@ import org.eclipse.cdt.ui.CUIPlugin;
|
|||
* manager's method
|
||||
* performOk()
|
||||
*
|
||||
* Registered pages can call {@link CDTPropertyManager#remove(Object)}
|
||||
* to explicitly remove themselves from this manager.
|
||||
*
|
||||
* In addition, there are utility methods for pages:
|
||||
* getPagesCount()
|
||||
* getPage()
|
||||
|
@ -118,6 +121,15 @@ public class CDTPropertyManager {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Explicitly remove the page from this CDTPropertyManager
|
||||
* @param p
|
||||
* @since 5.1
|
||||
*/
|
||||
public static void remove(Object p) {
|
||||
DListener.dispose(p);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs mandatory saving
|
||||
* @param p
|
||||
|
@ -144,14 +156,11 @@ public class CDTPropertyManager {
|
|||
|
||||
// Removes disposed items from list
|
||||
static class DListener implements DisposeListener {
|
||||
public void widgetDisposed(DisposeEvent e) {
|
||||
Widget w = e.widget;
|
||||
public static void dispose (Object w) {
|
||||
if (pages.contains(w)) { // Widget ?
|
||||
pages.remove(w);
|
||||
} else { // Property Page ?
|
||||
Iterator<Object> it = pages.iterator();
|
||||
while (it.hasNext()) {
|
||||
Object ob = it.next();
|
||||
for (Object ob : pages) {
|
||||
if (ob != null && ob instanceof PropertyPage) {
|
||||
if (((PropertyPage)ob).getControl().equals(w)) {
|
||||
pages.remove(ob);
|
||||
|
@ -161,23 +170,16 @@ public class CDTPropertyManager {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if (pages.size() == 0) {
|
||||
// if(!saveDone){
|
||||
// if(prjd != null){
|
||||
// saveDone = !prjd.isModified();
|
||||
// }
|
||||
// }
|
||||
|
||||
if (pages.isEmpty()) {
|
||||
saveDone = true;
|
||||
|
||||
// if(saveDone){
|
||||
project = null;
|
||||
prjd = null;
|
||||
saveDone = false;
|
||||
// }
|
||||
}
|
||||
}
|
||||
public void widgetDisposed(DisposeEvent e) {
|
||||
dispose(e.widget);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue