Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 Google, Inc. and others.
* Copyright (c) 2011, 2026 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -47,7 +47,7 @@ private EditPartFactory2() {
//
////////////////////////////////////////////////////////////////////////////
@Override
public org.eclipse.wb.gef.core.EditPart createEditPart(EditPart context, Object model) {
public EditPart createEditPart(EditPart context, Object model) {
if (model == null) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 Google, Inc. and others.
* Copyright (c) 2011, 2026 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -47,7 +47,7 @@ private EditPartFactory2() {
//
////////////////////////////////////////////////////////////////////////////
@Override
public org.eclipse.wb.gef.core.EditPart createEditPart(EditPart context, Object model) {
public EditPart createEditPart(EditPart context, Object model) {
if (model == null) {
return null;
}
Expand Down
34 changes: 34 additions & 0 deletions org.eclipse.wb.core/.settings/.api_filters
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,40 @@
</message_arguments>
</filter>
</resource>
<resource path="src/org/eclipse/wb/core/gef/MatchingEditPartFactory.java" type="org.eclipse.wb.core.gef.MatchingEditPartFactory">
<filter comment="Restructuring of internal EditPart" id="338792546">
<message_arguments>
<message_argument value="org.eclipse.wb.core.gef.MatchingEditPartFactory"/>
<message_argument value="createEditPart(EditPart, Object)"/>
</message_arguments>
</filter>
</resource>
<resource path="src/org/eclipse/wb/core/gef/part/menu/MenuEditPartFactory.java" type="org.eclipse.wb.core.gef.part.menu.MenuEditPartFactory">
<filter comment="Restructuring of internal EditPart" id="338792546">
<message_arguments>
<message_argument value="org.eclipse.wb.core.gef.part.menu.MenuEditPartFactory"/>
<message_argument value="createMenu(Object, IMenuInfo)"/>
</message_arguments>
</filter>
<filter comment="Restructuring of internal EditPart" id="338792546">
<message_arguments>
<message_argument value="org.eclipse.wb.core.gef.part.menu.MenuEditPartFactory"/>
<message_argument value="createMenuItem(Object, IMenuItemInfo)"/>
</message_arguments>
</filter>
<filter comment="Restructuring of internal EditPart" id="338792546">
<message_arguments>
<message_argument value="org.eclipse.wb.core.gef.part.menu.MenuEditPartFactory"/>
<message_argument value="createMenuMac(Object, IMenuInfo)"/>
</message_arguments>
</filter>
<filter comment="Restructuring of internal EditPart" id="338792546">
<message_arguments>
<message_argument value="org.eclipse.wb.core.gef.part.menu.MenuEditPartFactory"/>
<message_argument value="createPopupMenu(Object, IMenuPopupInfo)"/>
</message_arguments>
</filter>
</resource>
<resource path="src/org/eclipse/wb/core/gef/policy/PolicyUtils.java" type="org.eclipse.wb.core.gef.policy.PolicyUtils">
<filter comment="Restructuring of internal GraphicalEditPart" id="338792546">
<message_arguments>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
*
* @author lobas_av
* @coverage gef.core
* @deprecated Cast to {@link org.eclipse.gef.EditPart EditPart} directly or
* extend {@link AbstractEditPart}.
*/
@Deprecated(forRemoval = true, since = "2026-06")
public abstract class EditPart extends org.eclipse.gef.editparts.AbstractEditPart {

////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 Google, Inc. and others.
* Copyright (c) 2011, 2026 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -12,6 +12,7 @@
*******************************************************************************/
package org.eclipse.wb.gef.core;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartViewer;

/**
Expand All @@ -28,5 +29,5 @@ public interface IEditPartFactory extends org.eclipse.gef.EditPartFactory {
* Creates a new {@link EditPart} given the specified <i>context</i> and <i>model</i>.
*/
@Override
EditPart createEditPart(org.eclipse.gef.EditPart context, Object model);
EditPart createEditPart(EditPart context, Object model);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 Google, Inc. and others.
* Copyright (c) 2011, 2026 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -30,7 +30,7 @@ public class ParentTargetDragEditPartTracker extends DragEditPartTracker {
// Constructor
//
////////////////////////////////////////////////////////////////////////////
public ParentTargetDragEditPartTracker(org.eclipse.wb.gef.core.EditPart sourceEditPart) {
public ParentTargetDragEditPartTracker(EditPart sourceEditPart) {
super(sourceEditPart);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* @deprecated Extend {@link AbstractGraphicalEditPart} directly or cast to
* {@link org.eclipse.gef.GraphicalEditPart GraphicalEditPart}.
*/
@SuppressWarnings("removal")
@Deprecated(since = "2026-06", forRemoval = true)
public abstract class GraphicalEditPart extends org.eclipse.wb.gef.core.EditPart implements org.eclipse.gef.GraphicalEditPart {
private IFigure m_figure;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* @author lobas_av
* @coverage gef.tree
*/
@SuppressWarnings("removal")
public abstract class TreeEditPart extends org.eclipse.wb.gef.core.EditPart implements org.eclipse.gef.TreeEditPart {
private TreeItem m_widget;
private boolean m_expandedShouldRestore;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2025 Google, Inc. and others.
* Copyright (c) 2011, 2026 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -60,10 +60,10 @@ public MatchingEditPartFactory(List<String> modelPackages, List<String> partPack
//
////////////////////////////////////////////////////////////////////////////
@Override
public org.eclipse.wb.gef.core.EditPart createEditPart(EditPart context, Object model) {
public EditPart createEditPart(EditPart context, Object model) {
Class<?> modelClass = model.getClass();
for (; modelClass != null; modelClass = modelClass.getSuperclass()) {
org.eclipse.wb.gef.core.EditPart editPart = createEditPart(model, modelClass);
EditPart editPart = createEditPart(model, modelClass);
if (editPart != null) {
return editPart;
}
Expand All @@ -86,17 +86,17 @@ public org.eclipse.wb.gef.core.EditPart createEditPart(EditPart context, Object
* @return the {@link EditPart} corresponding to <code>modelClass</code>, may be <code>null</code>
* , if no match found.
*/
private org.eclipse.wb.gef.core.EditPart createEditPart(Object model, Class<?> modelClass) {
private EditPart createEditPart(Object model, Class<?> modelClass) {
// "Info" suffix
{
org.eclipse.wb.gef.core.EditPart editPart = createEditPart(model, modelClass, "Info");
EditPart editPart = createEditPart(model, modelClass, "Info");
if (editPart != null) {
return editPart;
}
}
// no suffix
{
org.eclipse.wb.gef.core.EditPart editPart = createEditPart(model, modelClass, "");
EditPart editPart = createEditPart(model, modelClass, "");
if (editPart != null) {
return editPart;
}
Expand All @@ -107,7 +107,7 @@ private org.eclipse.wb.gef.core.EditPart createEditPart(Object model, Class<?> m
if (modelClassName.contains("$")) {
modelClassName = StringUtils.remove(modelClassName, "Info");
modelClassName = StringUtils.remove(modelClassName, "$");
org.eclipse.wb.gef.core.EditPart editPart = createEditPart(model, modelClass, modelClassName, "");
EditPart editPart = createEditPart(model, modelClass, modelClassName, "");
if (editPart != null) {
return editPart;
}
Expand All @@ -120,15 +120,15 @@ private org.eclipse.wb.gef.core.EditPart createEditPart(Object model, Class<?> m
/**
* Implementation for {@link #createEditPart(Object, Class)}, with single model suffix.
*/
private org.eclipse.wb.gef.core.EditPart createEditPart(Object model, Class<?> modelClass, String modelSuffix) {
private EditPart createEditPart(Object model, Class<?> modelClass, String modelSuffix) {
String modelClassName = modelClass.getName();
return createEditPart(model, modelClass, modelClassName, modelSuffix);
}

/**
* Implementation for {@link #createEditPart(Object, Class)}, with single model suffix.
*/
private org.eclipse.wb.gef.core.EditPart createEditPart(Object model,
private EditPart createEditPart(Object model,
Class<?> modelClass,
String modelClassName,
String modelSuffix) {
Expand All @@ -144,7 +144,7 @@ private org.eclipse.wb.gef.core.EditPart createEditPart(Object model,
// create corresponding EditPart, use "EditPart" prefix
{
String partClassName = partPackage + componentName + "EditPart";
org.eclipse.wb.gef.core.EditPart editPart = createEditPart0(model, modelClass, partClassName);
EditPart editPart = createEditPart0(model, modelClass, partClassName);
if (editPart != null) {
return editPart;
}
Expand All @@ -155,14 +155,14 @@ private org.eclipse.wb.gef.core.EditPart createEditPart(Object model,
return null;
}

private static org.eclipse.wb.gef.core.EditPart createEditPart0(Object model, Class<?> modelClass, String partClassName) {
private static EditPart createEditPart0(Object model, Class<?> modelClass, String partClassName) {
try {
ClassLoader classLoader = modelClass.getClassLoader();
Class<?> partClass = classLoader.loadClass(partClassName);
// try all constructors
for (Constructor<?> constructor : partClass.getConstructors()) {
try {
return (org.eclipse.wb.gef.core.EditPart) constructor.newInstance(model);
return (EditPart) constructor.newInstance(model);
} catch (Throwable e) {
// ignore
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011 Google, Inc.
* Copyright (c) 2011, 2026 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -12,7 +12,6 @@
*******************************************************************************/
package org.eclipse.wb.core.gef.part.menu;

import org.eclipse.wb.gef.core.EditPart;
import org.eclipse.wb.internal.core.gef.part.menu.MacMenuEditPart;
import org.eclipse.wb.internal.core.gef.part.menu.MenuEditPart;
import org.eclipse.wb.internal.core.gef.part.menu.MenuItemEditPart;
Expand All @@ -21,6 +20,8 @@
import org.eclipse.wb.internal.core.model.menu.IMenuItemInfo;
import org.eclipse.wb.internal.core.model.menu.IMenuPopupInfo;

import org.eclipse.gef.EditPart;

/**
* Factory for "menu" {@link EditPart}s.
*
Expand All @@ -30,27 +31,31 @@
public final class MenuEditPartFactory {
/**
* @return the {@link EditPart} for {@link IMenuInfo}.
* @since 1.24
*/
public static EditPart createPopupMenu(Object toolkitModel, IMenuPopupInfo popup) {
return new MenuPopupEditPart(toolkitModel, popup);
}

/**
* @return the {@link EditPart} for {@link IMenuInfo}.
* @since 1.24
*/
public static EditPart createMenu(Object toolkitModel, IMenuInfo menu) {
return new MenuEditPart(toolkitModel, menu);
}

/**
* @return the {@link EditPart} for {@link IMenuInfo}, used on Mac.
* @since 1.24
*/
public static EditPart createMenuMac(Object toolkitModel, IMenuInfo menu) {
return new MacMenuEditPart(toolkitModel, menu);
}

/**
* @return the {@link EditPart} for {@link IMenuItemInfo}.
* @since 1.24
*/
public static EditPart createMenuItem(Object toolkitModel, IMenuItemInfo item) {
return new MenuItemEditPart(toolkitModel, item);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2025 Google, Inc. and others.
* Copyright (c) 2011, 2026 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -33,8 +33,19 @@ public class LayoutPolicyUtils {
////////////////////////////////////////////////////////////////////////////
/**
* @return the {@link LayoutEditPolicy} for given model.
* @deprecated Use {@link #createLayoutEditPolicy(EditPart, Object)} instead.
* Will be removed after the 2028-06 release.
*/
public static LayoutEditPolicy createLayoutEditPolicy(org.eclipse.wb.gef.core.EditPart context, Object model) {
@Deprecated(forRemoval = true, since = "2026-06")
public static LayoutEditPolicy createLayoutEditPolicy(@SuppressWarnings("removal") org.eclipse.wb.gef.core.EditPart context, Object model) {
return createLayoutEditPolicy((EditPart) context, model);
}

/**
* @return the {@link LayoutEditPolicy} for given model.
* @since 1.24
*/
public static LayoutEditPolicy createLayoutEditPolicy(EditPart context, Object model) {
// try to create policy
List<ILayoutEditPolicyFactory> factories =
ExternalFactoriesHelper.getElementsInstances(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 Google, Inc. and others.
* Copyright (c) 2011, 2026 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -44,7 +44,7 @@ private EditPartFactory() {
//
////////////////////////////////////////////////////////////////////////////
@Override
public org.eclipse.wb.gef.core.EditPart createEditPart(EditPart context, Object model) {
public EditPart createEditPart(EditPart context, Object model) {
if (model == null) {
return null;
}
Expand All @@ -70,7 +70,7 @@ public org.eclipse.wb.gef.core.EditPart createEditPart(EditPart context, Object
// }
// check each external factory
for (IEditPartFactory factory : getFactories()) {
org.eclipse.wb.gef.core.EditPart editPart = factory.createEditPart(context, model);
EditPart editPart = factory.createEditPart(context, model);
if (editPart != null) {
configureEditPart(context, editPart);
return editPart;
Expand Down Expand Up @@ -104,7 +104,7 @@ private static List<IEditPartFactory> getFactories() {
/**
* Configures given {@link EditPart} using externally contributed {@link IEditPartConfigurator}'s.
*/
public static void configureEditPart(EditPart context, org.eclipse.wb.gef.core.EditPart editPart) {
public static void configureEditPart(EditPart context, EditPart editPart) {
List<IEditPartConfigurator> configurators =
ExternalFactoriesHelper.getElementsInstances(
IEditPartConfigurator.class,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 Google, Inc. and others.
* Copyright (c) 2011, 2026 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -24,7 +24,7 @@
*/
public final class HeadersEditPartFactory implements IEditPartFactory {
@Override
public org.eclipse.wb.gef.core.EditPart createEditPart(EditPart context, Object model) {
return (org.eclipse.wb.gef.core.EditPart) model;
public EditPart createEditPart(EditPart context, Object model) {
return (EditPart) model;
}
}
Loading
Loading