This file provides guidance to AI Agents.
Eclipse Platform UI provides the building blocks for Eclipse IDE and Eclipse Rich Client Platform (RCP). This includes JFace, workbench, commands framework, data binding, dialogs, editors, views, perspectives, and more. Built on top of SWT (Eclipse Standard Widget Toolkit).
Key Facts:
- Language: Java 21
- Build System: Maven 3.9.12 with Tycho (OSGi/Eclipse plugin build)
- Architecture: OSGi bundles, E4 application model
eclipse.platform.ui/
├── bundles/ # OSGi bundles (production code)
│ ├── org.eclipse.ui.workbench # Main workbench implementation
│ ├── org.eclipse.jface # JFace toolkit (viewers, dialogs, etc.)
│ ├── org.eclipse.jface.databinding # Data binding framework
│ ├── org.eclipse.jface.text # Text editing framework
│ ├── org.eclipse.core.commands # Commands framework
│ ├── org.eclipse.core.databinding* # Core data binding
│ ├── org.eclipse.e4.ui.* # E4 workbench, CSS, DI, model
│ └── org.eclipse.ui.* # UI components (IDE, editors, views, etc.)
├── tests/ # Test bundles (mirror structure of bundles/)
├── examples/ # Example bundles
├── features/ # Eclipse feature definitions
├── releng/ # Release engineering artifacts
├── docs/ # Documentation (JFace, RCP, Commands, etc.)
└── .github/ # GitHub workflows and CI configuration
E4 Platform (Modern):
org.eclipse.e4.ui.model.workbench- E4 application modelorg.eclipse.e4.ui.workbench*- E4 workbench implementationorg.eclipse.e4.ui.di- Dependency injectionorg.eclipse.e4.ui.css.*- CSS styling engineorg.eclipse.e4.core.commands- Command framework
JFace Toolkit:
org.eclipse.jface- Viewers, dialogs, resources, actionsorg.eclipse.jface.databinding- Data binding for UIorg.eclipse.jface.text- Text editing infrastructure
Legacy Workbench (3.x compatibility):
org.eclipse.ui.workbench- Workbench implementationorg.eclipse.ui.ide- IDE-specific componentsorg.eclipse.ui.editors- Editor framework
Each bundle contains:
META-INF/MANIFEST.MF- Bundle metadata and dependenciesbuild.properties- Build configuration (what to include in binary)plugin.xml- Extension point declarations and contributions (optional)src/oreclipseui/- Java source code.settings/- Eclipse compiler settings
Use the -Pbuild-individual-bundles profile:
# Compile single bundle
mvn clean compile -pl :bundle-artifact-id -Pbuild-individual-bundles -q
# Example for building a single bundle
mvn clean verify -Pbuild-individual-bundles mvn clean verify -pl bundles/org.eclipse.ui -DskipTests
### Test Properties
From `pom.xml`:
- `tycho.surefire.useUIHarness=true` - Use Eclipse UI test harness
- `tycho.surefire.useUIThread=true` - Run tests on UI thread
- `failOnJavadocErrors=true` - Fail build on Javadoc errors
## Testing
### Running Tests
**⚠️ IMPORTANT:** Use `mvn verify` (NOT `mvn test`) for Tycho projects.
Due to Maven Tycho lifecycle binding, tests run in the `integration-test` phase, not the `test` phase. Running `mvn test` will NOT execute tests.
```bash
# Run tests for a specific test bundle from repository root
mvn clean verify -pl :org.eclipse.ui.tests -Pbuild-individual-bundles
# Run specific test class within a bundle
mvn clean verify -pl :org.eclipse.ui.tests -Pbuild-individual-bundles -Dtest=StructuredViewerTest
# Skip tests during compilation
mvn clean compile -Pbuild-individual-bundles -DskipTestsFinding test bundles: Test bundles mirror production bundles:
- Production:
bundles/org.eclipse.jface - Tests:
tests/org.eclipse.jface.tests
- Prefer JUnit 5 (
org.junit.jupiter.api.*) for new tests
mvn clean test -pl :bundle-artifact-id -Pbuild-individual-bundles
### Finding Code
```bash
# Find test files for a bundle
ls tests/org.eclipse.jface.tests/src
# Find bundle MANIFEST
cat bundles/org.eclipse.jface/META-INF/MANIFEST.MF
# Search for specific code pattern
grep -r "pattern" bundles/org.eclipse.jface/src
Do NOT add Co-Authored-By or similar AI attribution trailers to commits. This fails the Eclipse license check.
Always check META-INF/MANIFEST.MF before adding imports. If a package is not in Import-Package or Require-Bundle, the import will fail at runtime.
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.swt,
org.eclipse.jface
Import-Package: org.osgi.service.event
Must dispose SWT resources (except colors and system fonts):
All SWT/JFace UI code must run on the Display thread:
// Run asynchronously on UI thread
Display.getDefault().asyncExec(() -> {
label.setText("Updated");
});
// Check if on UI thread
if (Display.getCurrent() != null) {
// Already on UI thread
} else {
// Need to use asyncExec/syncExec
}Do not break API compatibility. The build includes API tools that verify:
- No removal of public API
- No changes to method signatures
- No changes to class hierarchies
Breaking changes will fail CI with errors in **/target/apianalysis/*.xml.
When adding new files or packages, update build.properties:
# Include in binary build
bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/
# Source folders
source.. = src/
# Output folder
output.. = bin/- CI definition:
.github/workflows/ci.yml(runs full aggregator build) - PRs are gated by: compiler checks, API compatibility, Javadoc, and unit/UI tests
- UI tests run with the Eclipse UI harness in headless mode
Expected when running mvn verify at root. Use -Pbuild-individual-bundles for individual bundles.
Check META-INF/MANIFEST.MF - add missing package to Import-Package or bundle to Require-Bundle.
You've broken API compatibility. Revert the breaking change or mark it appropriately.
UI tests must run on Display thread. Use Display.asyncExec() or ensure useUIHarness=true.
Attempting to access disposed SWT widget. Check disposal order and lifecycle.
Key docs in docs/ directory:
JFace.md- JFace framework overviewJFaceDataBinding.md- Data binding guideEclipse4_RCP_FAQ.md- E4 RCP frequently asked questionsPlatformCommandFramework.md- Command frameworkCSS.md- CSS styling for E4
External links: