Skip to content
Closed
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
73 changes: 73 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Documentation and Eclipse update site

on:
push:
branches: [master]
paths:
- 'README.md'
- 'docs/**'
- 'tools/docs/**'
- 'updatesite/**'
- 'mkdocs.yml'
- '.github/workflows/docs.yml'
pull_request:
paths:
- 'README.md'
- 'docs/**'
- 'tools/docs/**'
- 'updatesite/**'
- 'mkdocs.yml'
- '.github/workflows/docs.yml'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: docs-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
pages: read
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: '3.13'
cache: pip
cache-dependency-path: tools/docs/requirements.txt
- name: Install documentation dependencies
run: python -m pip install -r tools/docs/requirements.txt
- name: Test homepage and published resources
run: python -m unittest discover -s tools/docs -p 'test_*.py'
- name: Build documentation and validate Eclipse update site
run: python -m mkdocs build --strict
- name: Configure Pages
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
uses: actions/configure-pages@v6
- name: Upload Pages artifact
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v5
with:
path: site

deploy:
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
!docs/dev/import-and-junit-verification.md
.metals
.vscode
/site/
/.venv-docs/
__pycache__/
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ package:
clean:
$(MVN) clean

# REUSE license check
# REUSE license check. If missing, install using `pipx install reuse`
reuse:
pipx run reuse lint
reuse lint
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ Features

Requirements
------------
It is required to install latest Eclipse IDE for plugin. Plugin is backward compatible with IDE at least 6 months old since plugin version release date.
Use the latest Eclipse IDE. The current development version requires Java 21 to run Eclipse.
Plugin releases are backward compatible with IDE versions at least 6 months old at the time of release.

Documentation
-------------

Read the [project documentation](https://sap.github.io/hybris-commerce-eclipse-plugin/)
for user guides, troubleshooting, and developer documentation. The documentation sources are maintained in this README and [docs/](docs/).

Contributing & Code of Conduct
--------------
Expand All @@ -39,7 +46,11 @@ Download & Installation
----------
This GitHub repository is for managing the source code of the plugin.

To install the plugin visit the [Eclipse Marketplace](https://marketplace.eclipse.org/content/sap-hybris-commerce-development-tools-eclipse) and for up to date documentation, the Application Lifecycle Framework for Commerce: [SAP Commerce development tools for Eclipse](https://wiki.hybris.com/display/hybrisALF/SAP+Hybris+Commerce+development+tools+for+Eclipse).
To install the plugin visit the [Eclipse Marketplace](https://marketplace.eclipse.org/content/sap-hybris-commerce-development-tools-eclipse).
Alternatively, add `https://sap.github.io/hybris-commerce-eclipse-plugin/updates/latest/`
in Eclipse under **Help → Install New Software…**. See the [installation guide](docs/installation.md)
for details and the hosted release policy.
For usage and development guidance, see the [project documentation](https://sap.github.io/hybris-commerce-eclipse-plugin/).

Compile and Install From Source
-------------------------------
Expand All @@ -60,4 +71,3 @@ Deprecated Features
-------------------

Some features have been already deprecated as there are currently supported by Eclipse functionality, little usage, or just no time to maintenance. More details can be found on [Deprecation List](docs/deprecation/deprecation.md) page.

2 changes: 1 addition & 1 deletion REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ SPDX-FileCopyrightText = "2006 SAP SE or an SAP affiliate company and *Eclipse P
SPDX-License-Identifier = "Apache-2.0"

[[annotations]]
path = ["docs/**", ".github/**", "com.hybris.hyeclipse.site/**", ".gitignore", ".project", ".settings/**", ".travis", "CHANGELOG.md", "CODE_OF_CONDUCT.md", "README.md", "docs.code-workspace", "pom.xml", "CONTRIBUTING.md", "CONTRIBUTING_USING_GENAI.md", "REUSE.toml", ".travis.yml"]
path = ["docs/**", ".github/**", "com.hybris.hyeclipse.site/**", ".gitignore", ".project", ".settings/**", ".travis", "CHANGELOG.md", "CODE_OF_CONDUCT.md", "README.md", "docs.code-workspace", "pom.xml", "CONTRIBUTING.md", "CONTRIBUTING_USING_GENAI.md", "REUSE.toml", ".travis.yml", "mkdocs.yml"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2006 SAP SE or an SAP affiliate company and *Eclipse Plugin for SAP Commerce* contributors"
SPDX-License-Identifier = "Apache-2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ public TypeSystemSnapshot scan(final IProject platform, final IProgressMonitor m
final Map<String, SourceModel> models = new TreeMap<>();
folder.accept(resource -> {
checkCanceled(monitor);
if (resource instanceof IFile && "java".equals(resource.getFileExtension())) {
final IFile file = (IFile) resource;
if (resource instanceof IFile file && "java".equals(resource.getFileExtension())) {
try (final InputStream input = file.getContents(true)) {
addSource(file.getFullPath().toPortableString(),
new String(input.readAllBytes(), Charset.forName(file.getCharset())), models, monitor);
Expand Down Expand Up @@ -137,8 +136,8 @@ private static void addSource(final String path, final String source, final Map<
}
}
for (final Object declaration : unit.types()) {
if (declaration instanceof TypeDeclaration) {
addDeclaration((TypeDeclaration) declaration, unit, path, models);
if (declaration instanceof TypeDeclaration typeDeclaration) {
addDeclaration(typeDeclaration, unit, path, models);
}
}
}
Expand Down Expand Up @@ -247,8 +246,7 @@ private static YAttributeDescriptor descriptor(final String name, final String t
private static void addAccessor(final List<?> modifiers, final String javaType, final boolean getter,
final int line, final List<AccessorSource> accessors) {
for (final Object modifier : modifiers) {
if (modifier instanceof NormalAnnotation) {
final NormalAnnotation annotation = (NormalAnnotation) modifier;
if (modifier instanceof NormalAnnotation annotation) {
for (final Object value : annotation.values()) {
final MemberValuePair pair = (MemberValuePair) value;
if (TypeSystemConstants.QUALIFIER_MEMBER.equals(pair.getName().getIdentifier())) {
Expand Down Expand Up @@ -404,7 +402,7 @@ private SourceModel(final TypeDeclaration declaration, final CompilationUnit uni
&& !"void".equals(method.getReturnType2().toString());
if (getter || method.parameters().size() == 1) {
final String javaType = getter ? method.getReturnType2().toString()
: ((SingleVariableDeclaration) method.parameters().get(0)).getType().toString();
: ((SingleVariableDeclaration) method.parameters().getFirst()).getType().toString();
addAccessor(method.modifiers(), javaType, getter,
unit.getLineNumber(method.getStartPosition()), accessors);
}
Expand Down Expand Up @@ -442,17 +440,16 @@ private ConstantValue(final String literal, final String reference, final List<C
}

private static ConstantValue from(final Expression expression) {
if (expression instanceof StringLiteral) {
return new ConstantValue(((StringLiteral) expression).getLiteralValue(), null, null);
if (expression instanceof StringLiteral stringLiteral) {
return new ConstantValue(stringLiteral.getLiteralValue(), null, null);
}
if (expression instanceof Name) {
return new ConstantValue(null, ((Name) expression).getFullyQualifiedName(), null);
if (expression instanceof Name name) {
return new ConstantValue(null, name.getFullyQualifiedName(), null);
}
if (expression instanceof ParenthesizedExpression) {
return from(((ParenthesizedExpression) expression).getExpression());
if (expression instanceof ParenthesizedExpression parenthesizedExpression) {
return from(parenthesizedExpression.getExpression());
}
if (expression instanceof InfixExpression) {
final InfixExpression infix = (InfixExpression) expression;
if (expression instanceof InfixExpression infix) {
if (infix.getOperator() == InfixExpression.Operator.PLUS) {
final List<ConstantValue> parts = new ArrayList<>();
parts.add(from(infix.getLeftOperand()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ public static IFile getActiveEditorFile() {
public static IFile getSelectedFile(final ISelection selection) {
IFile file = null;

if (selection instanceof IStructuredSelection) {
final IStructuredSelection ssel = (IStructuredSelection) selection;
if (selection instanceof IStructuredSelection ssel) {
final Object obj = ssel.getFirstElement();
file = Platform.getAdapterManager().getAdapter(obj, IFile.class);
} else if (selection instanceof TextSelection) {
Expand All @@ -90,8 +89,7 @@ public static IFile getSelectedFile(final ISelection selection) {
public static Set<IFile> getSelectedFiles(final ISelection selection) {
final Set<IFile> files = new HashSet<>();

if (selection instanceof IStructuredSelection) {
final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
if (selection instanceof IStructuredSelection structuredSelection) {

structuredSelection.toList().forEach(
file -> files.add(Platform.getAdapterManager().getAdapter(file, IFile.class)));
Expand All @@ -114,11 +112,10 @@ public static Optional<TextSelection> getCurrentTextSelection() {
final IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActiveEditor();

if (editorPart instanceof ITextEditor) {
final ITextEditor editor = (ITextEditor) editorPart;
if (editorPart instanceof ITextEditor editor) {
final ISelection selection = editor.getSelectionProvider().getSelection();
if (selection instanceof TextSelection) {
currentTextSelection = Optional.of((TextSelection) selection);
if (selection instanceof TextSelection textSelection) {
currentTextSelection = Optional.of(textSelection);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ private ValidationResult error(final File file, final Exception failure) {
int line = 1;
Throwable cause = failure;
while (cause != null) {
if (cause instanceof SAXParseException) {
line = ((SAXParseException) cause).getLineNumber();
if (cause instanceof SAXParseException exception) {
line = exception.getLineNumber();
}
cause = cause.getCause();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,22 +110,22 @@ public void characters(final char[] chars, final int offset, final int length) {
*/
public static int line(final Node node) {
final Object line = node.getUserData(LINE_KEY);
return line instanceof Integer ? ((Integer) line).intValue() : 1;
return line instanceof Integer i ? i.intValue() : 1;
}

static List<Element> children(final Element parent, final String name) {
final List<Element> result = new ArrayList<>();
for (Node node = parent.getFirstChild(); node != null; node = node.getNextSibling()) {
if (node instanceof Element && name.equals(node.getNodeName())) {
result.add((Element) node);
if (node instanceof Element element && name.equals(node.getNodeName())) {
result.add(element);
}
}
return result;
}

static Element child(final Element parent, final String name) {
final List<Element> values = children(parent, name);
return values.isEmpty() ? null : values.get(0);
return values.isEmpty() ? null : values.getFirst();
}

static void checkCanceled(final IProgressMonitor monitor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ public boolean isEnabled() {

@Override
public void run() {
if (activeEditorPart instanceof IViewerProvider) {
Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
if (activeEditorPart instanceof IViewerProvider provider) {
Viewer viewer = provider.getViewer();
if (viewer != null) {
viewer.refresh();
}
Expand Down Expand Up @@ -272,8 +272,8 @@ public void selectionChanged(SelectionChangedEvent event) {
Collection<?> newSiblingDescriptors = null;

ISelection selection = event.getSelection();
if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
Object object = ((IStructuredSelection)selection).getFirstElement();
if (selection instanceof IStructuredSelection structuredSelection && structuredSelection.size() == 1) {
Object object = structuredSelection.getFirstElement();

EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();

Expand Down Expand Up @@ -372,8 +372,8 @@ protected void depopulateManager(IContributionManager manager, Collection<? exte

// Delete the ActionContributionItems with matching action.
//
if (contributionItem instanceof ActionContributionItem) {
IAction action = ((ActionContributionItem)contributionItem).getAction();
if (contributionItem instanceof ActionContributionItem item) {
IAction action = item.getAction();
if (actions.contains(action)) {
manager.remove(contributionItem);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,15 @@ public class BeansEditor
protected IPartListener partListener =
new IPartListener() {
public void partActivated(IWorkbenchPart p) {
if (p instanceof ContentOutline) {
if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
if (p instanceof ContentOutline outline) {
if (outline.getCurrentPage() == contentOutlinePage) {
getActionBarContributor().setActiveEditor(BeansEditor.this);

setCurrentViewer(contentOutlineViewer);
}
}
else if (p instanceof PropertySheet) {
if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
else if (p instanceof PropertySheet sheet) {
if (propertySheetPages.contains(sheet.getCurrentPage())) {
getActionBarContributor().setActiveEditor(BeansEditor.this);
handleActivate();
}
Expand Down Expand Up @@ -1019,7 +1019,7 @@ public void requestActivation() {

selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
selectionViewer.setInput(editingDomain.getResourceSet());
selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().getFirst()), true);
viewerPane.setTitle(editingDomain.getResourceSet());

new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
Expand Down Expand Up @@ -1332,7 +1332,7 @@ public void createControl(Composite parent) {
if (!editingDomain.getResourceSet().getResources().isEmpty()) {
// Select the root object in the view.
//
contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().getFirst()), true);
}
}

Expand Down Expand Up @@ -1400,8 +1400,8 @@ public void setActionBars(IActionBars actionBars) {
* @generated
*/
public void handleContentOutlineSelection(ISelection selection) {
if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection structuredSelection) {
Iterator<?> selectedElements = structuredSelection.iterator();
if (selectedElements.hasNext()) {
// Get the first selected element.
//
Expand Down Expand Up @@ -1564,7 +1564,7 @@ public void doSaveAs() {
* @generated
*/
protected void doSaveAs(URI uri, IEditorInput editorInput) {
(editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
(editingDomain.getResourceSet().getResources().getFirst()).setURI(uri);
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
IProgressMonitor progressMonitor =
Expand Down Expand Up @@ -1673,8 +1673,8 @@ public void setStatusLineManager(ISelection selection) {
contentOutlineStatusLineManager : getActionBars().getStatusLineManager();

if (statusLineManager != null) {
if (selection instanceof IStructuredSelection) {
Collection<?> collection = ((IStructuredSelection)selection).toList();
if (selection instanceof IStructuredSelection structuredSelection) {
Collection<?> collection = structuredSelection.toList();
switch (collection.size()) {
case 0: {
statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
Expand Down
Loading
Loading