-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1439] Add support for toolbar actions (buttons) on groups
Bug: #1439 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr> Signed-off-by: Axel RICHARD <axel.richard@obeo.fr>
- Loading branch information
1 parent
8547f95
commit a55f3d2
Showing
13 changed files
with
252 additions
and
8 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
39 changes: 39 additions & 0 deletions
39
...ius-components-forms/src/main/java/org/eclipse/sirius/components/forms/GroupContents.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,39 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 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; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
import org.eclipse.sirius.components.annotations.Immutable; | ||
|
||
/** | ||
* "Virtual" container used only during the rendering process to distinguish toolbar actions from the actual contents of | ||
* a Group. | ||
* | ||
* @author pcdavid | ||
*/ | ||
@Immutable | ||
public final class GroupContents { | ||
public static final String TYPE = "GroupContents"; //$NON-NLS-1$ | ||
|
||
private List<AbstractWidget> widgets; | ||
|
||
public GroupContents(List<AbstractWidget> widgets) { | ||
this.widgets = Objects.requireNonNull(widgets); | ||
} | ||
|
||
public List<AbstractWidget> getWidgets() { | ||
return this.widgets; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...rius-components-forms/src/main/java/org/eclipse/sirius/components/forms/GroupToolbar.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,40 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 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; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
import org.eclipse.sirius.components.annotations.Immutable; | ||
|
||
/** | ||
* "Virtual" container used only during the rendering process to distinguish toolbar actions from the actual contents of | ||
* a Group. | ||
* | ||
* @author pcdavid | ||
*/ | ||
@Immutable | ||
public final class GroupToolbar { | ||
public static final String TYPE = "GroupToolbar"; //$NON-NLS-1$ | ||
|
||
private List<Button> toolbarActions; | ||
|
||
public GroupToolbar(List<Button> toolbarActions) { | ||
this.toolbarActions = Objects.requireNonNull(toolbarActions); | ||
} | ||
|
||
public List<Button> getToolbarActions() { | ||
return this.toolbarActions; | ||
} | ||
|
||
} |
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
39 changes: 39 additions & 0 deletions
39
.../src/main/java/org/eclipse/sirius/components/forms/components/GroupContentsComponent.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,39 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 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.components; | ||
|
||
import java.util.Objects; | ||
|
||
import org.eclipse.sirius.components.forms.GroupContents; | ||
import org.eclipse.sirius.components.representations.Element; | ||
import org.eclipse.sirius.components.representations.FragmentProps; | ||
import org.eclipse.sirius.components.representations.IComponent; | ||
|
||
/** | ||
* Intermediate fragment-like component to distinguish the children of a group which correspond to its actual content. | ||
* | ||
* @author pcdavid | ||
*/ | ||
public class GroupContentsComponent implements IComponent { | ||
private final FragmentProps props; | ||
|
||
public GroupContentsComponent(FragmentProps props) { | ||
this.props = Objects.requireNonNull(props); | ||
} | ||
|
||
@Override | ||
public Element render() { | ||
return new Element(GroupContents.TYPE, this.props); | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...s/src/main/java/org/eclipse/sirius/components/forms/components/GroupToolbarComponent.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,39 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 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.components; | ||
|
||
import java.util.Objects; | ||
|
||
import org.eclipse.sirius.components.forms.GroupToolbar; | ||
import org.eclipse.sirius.components.representations.Element; | ||
import org.eclipse.sirius.components.representations.FragmentProps; | ||
import org.eclipse.sirius.components.representations.IComponent; | ||
|
||
/** | ||
* Intermediate fragment-like component to distinguish the children of a group which correspond to its toolbar. | ||
* | ||
* @author pcdavid | ||
*/ | ||
public class GroupToolbarComponent implements IComponent { | ||
private final FragmentProps props; | ||
|
||
public GroupToolbarComponent(FragmentProps props) { | ||
this.props = Objects.requireNonNull(props); | ||
} | ||
|
||
@Override | ||
public Element render() { | ||
return new Element(GroupToolbar.TYPE, this.props); | ||
} | ||
|
||
} |
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
Oops, something went wrong.