Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1914] Add support for custom widgets
Bug: #1914 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
- Loading branch information
Showing
72 changed files
with
1,042 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...sirius/components/collaborative/api/RepresentationEventProcessorFactoryConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 Obeo. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Obeo - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.sirius.components.collaborative.api; | ||
|
||
import java.util.Objects; | ||
|
||
import org.eclipse.sirius.components.core.api.IRepresentationDescriptionSearchService; | ||
import org.springframework.stereotype.Service; | ||
|
||
/** | ||
* Bundles the common dependencies that most {@link IRepresentationEventProcessorFactory} implementations need into a | ||
* single object for convenience. | ||
* | ||
* @author pcdavid | ||
*/ | ||
@Service | ||
public class RepresentationEventProcessorFactoryConfiguration { | ||
|
||
private final IRepresentationDescriptionSearchService representationDescriptionSearchService; | ||
|
||
private final IRepresentationSearchService representationSearchService; | ||
|
||
private final IRepresentationRefreshPolicyRegistry representationRefreshPolicyRegistry; | ||
|
||
private final ISubscriptionManagerFactory subscriptionManagerFactory; | ||
|
||
public RepresentationEventProcessorFactoryConfiguration(IRepresentationDescriptionSearchService representationDescriptionSearchService, IRepresentationSearchService representationSearchService, | ||
IRepresentationRefreshPolicyRegistry representationRefreshPolicyRegistry, ISubscriptionManagerFactory subscriptionManagerFactory) { | ||
this.representationDescriptionSearchService = Objects.requireNonNull(representationDescriptionSearchService); | ||
this.representationSearchService = Objects.requireNonNull(representationSearchService); | ||
this.representationRefreshPolicyRegistry = Objects.requireNonNull(representationRefreshPolicyRegistry); | ||
this.subscriptionManagerFactory = Objects.requireNonNull(subscriptionManagerFactory); | ||
} | ||
|
||
public IRepresentationDescriptionSearchService getRepresentationDescriptionSearchService() { | ||
return this.representationDescriptionSearchService; | ||
} | ||
|
||
public IRepresentationSearchService getRepresentationSearchService() { | ||
return this.representationSearchService; | ||
} | ||
|
||
public IRepresentationRefreshPolicyRegistry getRepresentationRefreshPolicyRegistry() { | ||
return this.representationRefreshPolicyRegistry; | ||
} | ||
|
||
public ISubscriptionManagerFactory getSubscriptionManagerFactory() { | ||
return this.subscriptionManagerFactory; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...java/org/eclipse/sirius/components/formdescriptioneditors/IWidgetDescriptionProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 Obeo. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Obeo - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.sirius.components.formdescriptioneditors; | ||
|
||
import java.util.Optional; | ||
|
||
import org.eclipse.emf.ecore.EClass; | ||
|
||
/** | ||
* Provides the EClass to use to represent a given kind of widget in a Form Description Editor. | ||
* | ||
* @author pcdavid | ||
*/ | ||
public interface IWidgetDescriptionProvider { | ||
Optional<EClass> getWidgetDescriptionType(String widgetKind); | ||
} |
27 changes: 27 additions & 0 deletions
27
...org/eclipse/sirius/components/formdescriptioneditors/IWidgetPreviewConverterProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 Obeo. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Obeo - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.sirius.components.formdescriptioneditors; | ||
|
||
import org.eclipse.emf.ecore.util.Switch; | ||
import org.eclipse.sirius.components.formdescriptioneditors.description.FormDescriptionEditorDescription; | ||
import org.eclipse.sirius.components.forms.description.AbstractWidgetDescription; | ||
import org.eclipse.sirius.components.representations.VariableManager; | ||
|
||
/** | ||
* Provides a switch to convert View-based custom widget descriptions into their API equivalent "preview widget" in a Form Description Editor. | ||
* | ||
* @author pcdavid | ||
*/ | ||
public interface IWidgetPreviewConverterProvider { | ||
Switch<AbstractWidgetDescription> getWidgetConverter(FormDescriptionEditorDescription formDescriptionEditorDescription, VariableManager variableManager); | ||
} |
Oops, something went wrong.