-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[3983] Add drag and drop support for explorer
Bug: #3983 Signed-off-by: Florian ROUËNÉ <florian.rouene@obeosoft.com>
- Loading branch information
Showing
21 changed files
with
733 additions
and
28 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
36 changes: 36 additions & 0 deletions
36
...rg/eclipse/sirius/web/application/configuration/SiriusWebMessageServiceConfiguration.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,36 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 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.web.application.configuration; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.support.MessageSourceAccessor; | ||
import org.springframework.context.support.ResourceBundleMessageSource; | ||
|
||
/** | ||
* Configuration used to retrieve the message source accessor for the project. | ||
* | ||
* @author frouene | ||
*/ | ||
@Configuration | ||
public class SiriusWebMessageServiceConfiguration { | ||
|
||
private static final String PATH = "messages/sirius-web-application"; | ||
|
||
@Bean | ||
public MessageSourceAccessor siriusWebApplicationMessageSourceAccessor() { | ||
ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); | ||
messageSource.addBasenames(PATH); | ||
return new MessageSourceAccessor(messageSource); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...n/src/main/java/org/eclipse/sirius/web/application/messages/ISiriusWebMessageService.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,44 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 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.web.application.messages; | ||
|
||
/** | ||
* Interface of the sirius web message service. | ||
* | ||
* @author frouene | ||
*/ | ||
public interface ISiriusWebMessageService { | ||
|
||
String unavailableFeature(); | ||
|
||
String alreadySetFeature(); | ||
|
||
/** | ||
* Implementation which does nothing, used for mocks in unit tests. | ||
* | ||
* @author frouene | ||
*/ | ||
class NoOp implements ISiriusWebMessageService { | ||
|
||
@Override | ||
public String unavailableFeature() { | ||
return ""; | ||
} | ||
|
||
@Override | ||
public String alreadySetFeature() { | ||
return ""; | ||
} | ||
|
||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...plication/src/main/java/org/eclipse/sirius/web/application/messages/MessageConstants.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,29 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 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.web.application.messages; | ||
|
||
/** | ||
* This class is used to hold all the keys of the internationalization messages. | ||
* | ||
* @author frouene | ||
*/ | ||
public final class MessageConstants { | ||
|
||
public static final String UNAVAILABLE_FEATURE = "UNAVAILABLE_FEATURE"; | ||
|
||
public static final String ALREADY_SET_FEATURE = "ALREADY_SET_FEATURE"; | ||
|
||
private MessageConstants() { | ||
// Prevent instantiation | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...on/src/main/java/org/eclipse/sirius/web/application/messages/SiriusWebMessageService.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,44 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 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.web.application.messages; | ||
|
||
import java.util.Objects; | ||
|
||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.context.support.MessageSourceAccessor; | ||
import org.springframework.stereotype.Service; | ||
|
||
/** | ||
* Implementation of the sirius web message service. | ||
* | ||
* @author frouene | ||
*/ | ||
@Service | ||
public class SiriusWebMessageService implements ISiriusWebMessageService { | ||
|
||
private final MessageSourceAccessor messageSourceAccessor; | ||
|
||
public SiriusWebMessageService(@Qualifier("siriusWebApplicationMessageSourceAccessor") MessageSourceAccessor messageSourceAccessor) { | ||
this.messageSourceAccessor = Objects.requireNonNull(messageSourceAccessor); | ||
} | ||
|
||
@Override | ||
public String unavailableFeature() { | ||
return this.messageSourceAccessor.getMessage(MessageConstants.UNAVAILABLE_FEATURE, new Object[] {}); | ||
} | ||
|
||
@Override | ||
public String alreadySetFeature() { | ||
return this.messageSourceAccessor.getMessage(MessageConstants.ALREADY_SET_FEATURE, new Object[] {}); | ||
} | ||
} |
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.