Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 Google, Inc.
* Copyright (c) 2011, 2026 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -138,7 +138,11 @@ private boolean canDesignInput() {
void activated() {
if (m_firstActivation) {
m_firstActivation = false;
m_multiMode.editorActivatedFirstTime();
getRootControl().getDisplay().asyncExec(() -> {
if (!m_multiMode.isDisposed()) {
m_multiMode.editorActivatedFirstTime();
}
});
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011 Google, Inc.
* Copyright (c) 2011, 2026 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -35,6 +35,7 @@ public abstract class MultiMode implements IMultiMode {
protected final SourcePage m_sourcePage;
protected final DesignPage m_designPage;
protected final List<IEditorPage> m_additionalPages = new ArrayList<>();
private boolean m_disposed;

////////////////////////////////////////////////////////////////////////////
//
Expand Down Expand Up @@ -136,13 +137,18 @@ void create(Composite parent) {
* Disposes this {@link MultiMode}.
*/
void dispose() {
m_disposed = true;
m_sourcePage.dispose();
m_designPage.dispose();
for (IEditorPage page : m_additionalPages) {
page.dispose();
}
}

boolean isDisposed() {
return m_disposed;
}

/**
* Notifies that {@link DesignerEditor} has now new input, so new {@link ICompilationUnit} to
* parse.
Expand Down
Loading