Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

FormEditor does not cleanup pages on tab disposal

オープン
#3,766 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
46/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java
領域
desktop, testing

調査の方向性

Start by reproducing the failure using the test code in the issue and the linked pull request #3765, then trace how FormEditor handles tab disposal and page removal. The tests identify the expected behavior: after the tab is disposed or closed, findPage("page1") should return null. Update or add regression coverage for both disposal paths and run the relevant UI tests.

索引モデルが issue の本文から書いたものです。

説明

bug
	@Test
	public void disposeTab() throws PartInitException {
		FormEditorMock.hook = FormEditorMock.DEFAULT_HOOK;
		FormEditorMock subject = (FormEditorMock) WORKBENCH.getActiveWorkbenchWindow().getActivePage().openEditor(input,
				FormEditorMock.ID);
		dispatch(subject);
		CTabItem[] tabs = subject.leakContainer().getItems();
		assertEquals(1, tabs.length);
		FormPage page1 = addPage(subject, "page1");
		assertSame(page1, subject.findPage("page1"));
		tabs = subject.leakContainer().getItems();
		assertEquals(2, tabs.length);
		tabs[tabs.length - 1].dispose();
		dispatch(subject);
		tabs = subject.leakContainer().getItems();
		assertEquals(1, tabs.length);
		// BUG
		// assertNull(subject.findPage("page1"));
	}

	@Test
	public void maintainIntegrityOnPageClose() throws PartInitException {
		FormEditorMock.hook = new Hook() {
			@Override
			public void createContainer(FormEditorMock subject, CTabFolder container) {
				Hook.super.createContainer(subject, container);
				container.setUnselectedCloseVisible(true);
			}

			@Override
			public void createItem(FormEditorMock subject, CTabItem item) {
				Hook.super.createItem(subject, item);
				item.setShowClose(true);
			}
		};
		FormEditorMock subject = (FormEditorMock) WORKBENCH.getActiveWorkbenchWindow().getActivePage().openEditor(input,
				FormEditorMock.ID);
		FormPage page1 = addPage(subject, "page1");
		CTabFolder tabFolder = subject.leakContainer();
		CTabItem tab = tabFolder.getItem(1);
		assertTrue(tab.getShowClose());
		assertSame(page1, subject.findPage("page1"));
		Event event = new Event();
		event.type = SWT.MouseDown;
		event.button = 1;
		event.x = tab.getBounds().x + tab.getBounds().width - 9;
		event.y = tab.getBounds().y + tab.getBounds().height/2;
		tabFolder.notifyListeners(event.type, event);
		dispatch(subject);
		event.type = SWT.MouseUp;
		tabFolder.notifyListeners(event.type, event);
		dispatch(subject);
		assertEquals(1, tabFolder.getItems().length);
		// BUG
		// assertNull(subject.findPage("page1"));
	}

To reproduce, pull from https://github.com/eclipse-platform/eclipse.platform.ui/pull/3765 and uncomment BUG lines.

主要言語
Java
スター
124
フォーク
269
平均マージ
2日 11時間
マージ済み PR(30日)
72

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

eclipse-platform/eclipse.platform.ui のほかの issue

eclipse-platform/eclipse.platform.ui の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。