forked from eclipse-sirius/sirius-web
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug: eclipse-sirius#2077 Signed-off-by: Florian Rouëné <florian.rouene@obeosoft.com>
- Loading branch information
Showing
65 changed files
with
3,768 additions
and
108 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
51 changes: 51 additions & 0 deletions
51
...pse/sirius/components/formdescriptioneditors/components/ContainerBorderStyleProvider.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,51 @@ | ||
/******************************************************************************* | ||
* 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.components; | ||
|
||
import java.util.Objects; | ||
|
||
import org.eclipse.sirius.components.forms.ContainerBorderLineStyle; | ||
import org.eclipse.sirius.components.forms.ContainerBorderStyle; | ||
import org.eclipse.sirius.components.view.FixedColor; | ||
|
||
/** | ||
* The style provider for the Border Style of the View DSL. This only handles "static" or "preview" styles. | ||
* | ||
* @author frouene | ||
*/ | ||
public class ContainerBorderStyleProvider { | ||
|
||
private final org.eclipse.sirius.components.view.form.ContainerBorderStyle viewStyle; | ||
|
||
public ContainerBorderStyleProvider(org.eclipse.sirius.components.view.form.ContainerBorderStyle viewStyle) { | ||
this.viewStyle = Objects.requireNonNull(viewStyle); | ||
} | ||
|
||
public ContainerBorderStyle build() { | ||
ContainerBorderStyle.Builder containerBorderStyle = ContainerBorderStyle | ||
.newContainerBorderStyle() | ||
.size(this.viewStyle.getBorderSize()) | ||
.radius(this.viewStyle.getBorderRadius()) | ||
.lineStyle(ContainerBorderLineStyle.valueOf(this.viewStyle.getBorderLineStyle().getLiteral())); | ||
|
||
if (this.viewStyle.getBorderColor() instanceof FixedColor fixedColor) { | ||
String color = fixedColor.getValue(); | ||
if (color != null && !color.isBlank()) { | ||
containerBorderStyle.color(color); | ||
} | ||
} | ||
|
||
|
||
return containerBorderStyle.build(); | ||
} | ||
} |
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
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
22 changes: 22 additions & 0 deletions
22
...nts-forms/src/main/java/org/eclipse/sirius/components/forms/ContainerBorderLineStyle.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,22 @@ | ||
/******************************************************************************* | ||
* 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.forms; | ||
|
||
/** | ||
* Line style possibility for the border of a container. | ||
* | ||
* @author frouene | ||
*/ | ||
public enum ContainerBorderLineStyle { | ||
Solid, Dashed, Dotted | ||
} |
Oops, something went wrong.