-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now there are two separated concepts: * The node style description concept that tells how the node is represented * The new concept of LayoutStrategyDescription that tells how the children are layouted. * Add new Styles - RectangularNodeStyleDescription - ImageNodeStyleDescription - IconLabelNodeStyleDescription * Add a "childrenLayoutStrategy" feature to NodeDescription. There are two implementations - FreeFormLayoutStrategyDescription - ListLayoutStrategyDescription Bug: #1316 Bug: #1339 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
- Loading branch information
Showing
44 changed files
with
5,585 additions
and
1,940 deletions.
There are no files selected for viewing
216 changes: 28 additions & 188 deletions
216
...in/java/org/eclipse/sirius/components/view/provider/ConditionalNodeStyleItemProvider.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
124 changes: 124 additions & 0 deletions
124
...clipse/sirius/components/view/provider/FreeFormLayoutStrategyDescriptionItemProvider.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,124 @@ | ||
/** | ||
* Copyright (c) 2021, 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.view.provider; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
import org.eclipse.emf.common.notify.AdapterFactory; | ||
import org.eclipse.emf.common.notify.Notification; | ||
import org.eclipse.emf.common.util.ResourceLocator; | ||
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; | ||
import org.eclipse.emf.edit.provider.IItemLabelProvider; | ||
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; | ||
import org.eclipse.emf.edit.provider.IItemPropertySource; | ||
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; | ||
import org.eclipse.emf.edit.provider.ITreeItemContentProvider; | ||
import org.eclipse.emf.edit.provider.ItemProviderAdapter; | ||
|
||
/** | ||
* This is the item provider adapter for a {@link org.eclipse.sirius.components.view.FreeFormLayoutStrategyDescription} | ||
* object. <!-- begin-user-doc --> <!-- end-user-doc --> | ||
* | ||
* @generated | ||
*/ | ||
public class FreeFormLayoutStrategyDescriptionItemProvider extends ItemProviderAdapter | ||
implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { | ||
/** | ||
* This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- end-user-doc --> | ||
* | ||
* @generated | ||
*/ | ||
public FreeFormLayoutStrategyDescriptionItemProvider(AdapterFactory adapterFactory) { | ||
super(adapterFactory); | ||
} | ||
|
||
/** | ||
* This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc --> | ||
* | ||
* @generated | ||
*/ | ||
@Override | ||
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { | ||
if (this.itemPropertyDescriptors == null) { | ||
super.getPropertyDescriptors(object); | ||
|
||
} | ||
return this.itemPropertyDescriptors; | ||
} | ||
|
||
/** | ||
* This returns FreeFormLayoutStrategyDescription.gif. <!-- begin-user-doc --> <!-- end-user-doc --> | ||
* | ||
* @generated | ||
*/ | ||
@Override | ||
public Object getImage(Object object) { | ||
return this.overlayImage(object, this.getResourceLocator().getImage("full/obj16/FreeFormLayoutStrategyDescription")); //$NON-NLS-1$ | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> <!-- end-user-doc --> | ||
* | ||
* @generated | ||
*/ | ||
@Override | ||
protected boolean shouldComposeCreationImage() { | ||
return true; | ||
} | ||
|
||
/** | ||
* This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc --> | ||
* | ||
* @generated | ||
*/ | ||
@Override | ||
public String getText(Object object) { | ||
return this.getString("_UI_FreeFormLayoutStrategyDescription_type"); //$NON-NLS-1$ | ||
} | ||
|
||
/** | ||
* This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating | ||
* a viewer notification, which it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc | ||
* --> | ||
* | ||
* @generated | ||
*/ | ||
@Override | ||
public void notifyChanged(Notification notification) { | ||
this.updateChildren(notification); | ||
super.notifyChanged(notification); | ||
} | ||
|
||
/** | ||
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created | ||
* under this object. <!-- begin-user-doc --> <!-- end-user-doc --> | ||
* | ||
* @generated | ||
*/ | ||
@Override | ||
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { | ||
super.collectNewChildDescriptors(newChildDescriptors, object); | ||
} | ||
|
||
/** | ||
* Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- end-user-doc --> | ||
* | ||
* @generated | ||
*/ | ||
@Override | ||
public ResourceLocator getResourceLocator() { | ||
return ViewEditPlugin.INSTANCE; | ||
} | ||
|
||
} |
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.