Skip to content

Commit

Permalink
[1439] Add support for FormDescriptionEditor toolbar actions on backend
Browse files Browse the repository at this point in the history
Bug: #1439
Signed-off-by: Axel RICHARD <axel.richard@obeo.fr>
  • Loading branch information
AxelRICHARD committed Nov 18, 2022
1 parent c9f9890 commit 829cfcf
Show file tree
Hide file tree
Showing 29 changed files with 1,628 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*******************************************************************************
* 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.collaborative.formdescriptioneditors.dto;

import java.text.MessageFormat;
import java.util.Objects;
import java.util.UUID;

import org.eclipse.sirius.components.collaborative.formdescriptioneditors.api.IFormDescriptionEditorInput;

/**
* The input for the Form Description Editor add toolbar action mutation.
*
* @author arichard
*/
public class AddToolbarActionInput implements IFormDescriptionEditorInput {

private UUID id;

private String editingContextId;

private String representationId;

private String containerId;

public AddToolbarActionInput() {
// Used by jackson
}

public AddToolbarActionInput(UUID id, String editingContextId, String representationId, String containerId) {
this.id = Objects.requireNonNull(id);
this.editingContextId = Objects.requireNonNull(editingContextId);
this.representationId = Objects.requireNonNull(representationId);
this.containerId = containerId;
}

@Override
public UUID getId() {
return this.id;
}

@Override
public String getRepresentationId() {
return this.representationId;
}

public String getEditingContextId() {
return this.editingContextId;
}

public String getContainerId() {
return this.containerId;
}

@Override
public String toString() {
String pattern = "{0} '{'id: {1}, editingContextId: {2}, representationId: {3}, containerId: {4}}'"; //$NON-NLS-1$
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.id, this.editingContextId, this.representationId, this.containerId);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*******************************************************************************
* 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.collaborative.formdescriptioneditors.dto;

import java.text.MessageFormat;
import java.util.Objects;
import java.util.UUID;

import org.eclipse.sirius.components.core.api.IPayload;

/**
* The payload of the Form Description Editor add toolbar action mutation.
*
* @author arichard
*/
public class AddToolbarActionSuccessPayload implements IPayload {
private final UUID id;

public AddToolbarActionSuccessPayload(UUID id) {
this.id = Objects.requireNonNull(id);
}

@Override
public UUID getId() {
return this.id;
}

@Override
public String toString() {
String pattern = "{0} '{'id: {1}'}'"; //$NON-NLS-1$
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.id);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*******************************************************************************
* 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.collaborative.formdescriptioneditors.dto;

import java.text.MessageFormat;
import java.util.Objects;
import java.util.UUID;

import org.eclipse.sirius.components.collaborative.formdescriptioneditors.api.IFormDescriptionEditorInput;

/**
* The input for the Form Description Editor delete toolbar action mutation.
*
* @author arichard
*/
public class DeleteToolbarActionInput implements IFormDescriptionEditorInput {

private UUID id;

private String editingContextId;

private String representationId;

private String toolbarActionId;

public DeleteToolbarActionInput() {
// Used by jackson
}

public DeleteToolbarActionInput(UUID id, String editingContextId, String representationId, String toolbarActionId) {
this.id = Objects.requireNonNull(id);
this.editingContextId = Objects.requireNonNull(editingContextId);
this.representationId = Objects.requireNonNull(representationId);
this.toolbarActionId = Objects.requireNonNull(toolbarActionId);
}

@Override
public UUID getId() {
return this.id;
}

@Override
public String getRepresentationId() {
return this.representationId;
}

public String getEditingContextId() {
return this.editingContextId;
}

public String getToolbarActionId() {
return this.toolbarActionId;
}

@Override
public String toString() {
String pattern = "{0} '{'id: {1}, editingContextId: {2}, representationId: {3}; toolbarActionId: {4}}'"; //$NON-NLS-1$
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.id, this.editingContextId, this.representationId, this.toolbarActionId);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*******************************************************************************
* 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.collaborative.formdescriptioneditors.dto;

import java.text.MessageFormat;
import java.util.Objects;
import java.util.UUID;

import org.eclipse.sirius.components.core.api.IPayload;

/**
* The payload of the Form Description Editor delete toolbar action mutation.
*
* @author arichard
*/
public class DeleteToolbarActionSuccessPayload implements IPayload {
private final UUID id;

public DeleteToolbarActionSuccessPayload(UUID id) {
this.id = Objects.requireNonNull(id);
}

@Override
public UUID getId() {
return this.id;
}

@Override
public String toString() {
String pattern = "{0} '{'id: {1}'}'"; //$NON-NLS-1$
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.id);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*******************************************************************************
* 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.collaborative.formdescriptioneditors.dto;

import java.text.MessageFormat;
import java.util.Objects;
import java.util.UUID;

import org.eclipse.sirius.components.collaborative.formdescriptioneditors.api.IFormDescriptionEditorInput;

/**
* The input for the Form Description Editor add toolbar action mutation.
*
* @author arichard
*/
public class MoveToolbarActionInput implements IFormDescriptionEditorInput {

private UUID id;

private String editingContextId;

private String representationId;

private String containerId;

private String toolbarActionId;

private int index;

public MoveToolbarActionInput() {
// Used by jackson
}

public MoveToolbarActionInput(UUID id, String editingContextId, String representationId, String containerId, String toolbarActionId, int index) {
this.id = Objects.requireNonNull(id);
this.editingContextId = Objects.requireNonNull(editingContextId);
this.representationId = Objects.requireNonNull(representationId);
this.containerId = containerId;
this.toolbarActionId = Objects.requireNonNull(toolbarActionId);
this.index = Objects.requireNonNull(index);
}

@Override
public UUID getId() {
return this.id;
}

@Override
public String getRepresentationId() {
return this.representationId;
}

public String getEditingContextId() {
return this.editingContextId;
}

public String getContainerId() {
return this.containerId;
}

public String getToolbarActionId() {
return this.toolbarActionId;
}

public int getIndex() {
return this.index;
}

@Override
public String toString() {
String pattern = "{0} '{'id: {1}, editingContextId: {2}, representationId: {3}, containerId: {4}, toolbarActionId: {5}, index: {6}}'"; //$NON-NLS-1$
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.id, this.editingContextId, this.representationId, this.containerId, this.toolbarActionId, this.index);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*******************************************************************************
* 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.collaborative.formdescriptioneditors.dto;

import java.text.MessageFormat;
import java.util.Objects;
import java.util.UUID;

import org.eclipse.sirius.components.core.api.IPayload;

/**
* The payload of the Form Description Editor move toolbar action mutation.
*
* @author arichard
*/
public class MoveToolbarActionSuccessPayload implements IPayload {
private final UUID id;

public MoveToolbarActionSuccessPayload(UUID id) {
this.id = Objects.requireNonNull(id);
}

@Override
public UUID getId() {
return this.id;
}

@Override
public String toString() {
String pattern = "{0} '{'id: {1}'}'"; //$NON-NLS-1$
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.id);
}

}
Loading

0 comments on commit 829cfcf

Please sign in to comment.