Skip to content
Open
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 @@ -33,7 +33,7 @@
*/
public final class CoreEditPartConfigurator implements IEditPartConfigurator {
@Override
public void configure(EditPart context, org.eclipse.wb.gef.core.EditPart editPart) {
public void configure(EditPart context, EditPart editPart) {
Object model = editPart.getModel();
// double click
if (GlobalState.isComponent(model)) {
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 @@ -39,7 +39,7 @@ public final class GenericContainersConfigurator implements IEditPartConfigurato
//
////////////////////////////////////////////////////////////////////////////
@Override
public void configure(EditPart context, org.eclipse.wb.gef.core.EditPart editPart) {
public void configure(EditPart context, EditPart editPart) {
if (editPart.getModel() instanceof JavaInfo) {
JavaInfo component = (JavaInfo) editPart.getModel();
configureComponent(editPart, component);
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 @@ -45,7 +45,7 @@ public final class GenericContainersConfigurator implements IEditPartConfigurato
//
////////////////////////////////////////////////////////////////////////////
@Override
public void configure(EditPart context, org.eclipse.wb.gef.core.EditPart editPart) {
public void configure(EditPart context, EditPart editPart) {
if (editPart.getModel() instanceof JavaInfo) {
JavaInfo component = (JavaInfo) editPart.getModel();
configureComponent(editPart, component);
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 @@ -31,5 +31,5 @@ public interface IEditPartConfigurator {
/**
* Configures given {@link EditPart}.
*/
void configure(EditPart context, org.eclipse.wb.gef.core.EditPart editPart);
void configure(EditPart context, EditPart editPart);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.eclipse.wb.internal.swt.model.widgets.ControlInfo;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;

/**
* Configures RCP related {@link EditPart}'s.
Expand All @@ -31,7 +32,7 @@
*/
public final class RcpPolicyConfigurator implements IEditPartConfigurator {
@Override
public void configure(EditPart context, org.eclipse.wb.gef.core.EditPart editPart) {
public void configure(EditPart context, EditPart editPart) {
((DesignEditPart) editPart).addRequestProcessor(FieldEditorDropRequestProcessor.INSTANCE);
// allow drop Action on MenuManager
if (editPart instanceof IMenuObjectEditPart menuEditPart) {
Expand All @@ -40,9 +41,9 @@ public void configure(EditPart context, org.eclipse.wb.gef.core.EditPart editPar
}
}
// allow drop ControlDecoration on ControlInfo
if (editPart.getModel() instanceof ControlInfo) {
ControlInfo control = (ControlInfo) editPart.getModel();
editPart.installEditPolicy(new ControlDecorationDropLayoutEditPolicy(control));
if (editPart.getModel() instanceof ControlInfo control) {
EditPolicy editPolicy = new ControlDecorationDropLayoutEditPolicy(control);
editPart.installEditPolicy(editPolicy.getClass(), editPolicy);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.eclipse.wb.internal.swt.model.widgets.ControlInfo;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;

/**
* Configures RCP related {@link EditPart}'s.
Expand All @@ -29,15 +30,15 @@
*/
public final class RcpPolicyConfigurator implements IEditPartConfigurator {
@Override
public void configure(EditPart context, org.eclipse.wb.gef.core.EditPart editPart) {
public void configure(EditPart context, EditPart editPart) {
// allow drop Action on MenuManager
if (editPart.getModel() instanceof MenuManagerInfo) {
((DesignTreeEditPart) editPart).addRequestProcessor(ActionDropRequestProcessor.INSTANCE);
}
// allow drop ControlDecoration on ControlInfo
if (editPart.getModel() instanceof ControlInfo) {
ControlInfo control = (ControlInfo) editPart.getModel();
editPart.installEditPolicy(new ControlDecorationDropLayoutEditPolicy(control));
if (editPart.getModel() instanceof ControlInfo control) {
EditPolicy editPolicy = new ControlDecorationDropLayoutEditPolicy(control);
editPart.installEditPolicy(editPolicy.getClass(), editPolicy);
}
}
}
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 @@ -29,12 +29,13 @@
*/
public final class ActionDropPolicyConfigurator implements IEditPartConfigurator {
@Override
public void configure(EditPart context, org.eclipse.wb.gef.core.EditPart editPart) {
public void configure(EditPart context, EditPart editPart) {
// drop ActionInfo on javax.swing.AbstractButton
if (editPart.getModel() instanceof ComponentInfo) {
ComponentInfo component = (ComponentInfo) editPart.getModel();
if (AbstractButton.class.isAssignableFrom(component.getDescription().getComponentClass())) {
editPart.installEditPolicy(new ActionDropButtonLayoutEditPolicy(component));
EditPolicy editPolicy = new ActionDropButtonLayoutEditPolicy(component);
editPart.installEditPolicy(editPolicy.getClass(), editPolicy);
}
}
}
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 @@ -32,7 +32,7 @@
*/
public final class MenuDropPolicyConfigurator implements IEditPartConfigurator {
@Override
public void configure(EditPart context, org.eclipse.wb.gef.core.EditPart editPart) {
public void configure(EditPart context, EditPart editPart) {
// drop JMenuBar on JFrame, JDialog and JApply
if (editPart.getModel() instanceof ContainerInfo) {
ContainerInfo container = (ContainerInfo) editPart.getModel();
Expand All @@ -41,13 +41,15 @@ public void configure(EditPart context, org.eclipse.wb.gef.core.EditPart editPar
|| JInternalFrame.class.isAssignableFrom(componentClass)
|| JDialog.class.isAssignableFrom(componentClass)
|| Activator.isAssignableFromJApplet(componentClass)) {
editPart.installEditPolicy(new MenuBarDropLayoutEditPolicy(container));
EditPolicy editPolicy = new MenuBarDropLayoutEditPolicy(container);
editPart.installEditPolicy(editPolicy.getClass(), editPolicy);
}
}
// drop JPopupMenu on any java.awt.Component
if (editPart.getModel() instanceof ComponentInfo) {
ComponentInfo component = (ComponentInfo) editPart.getModel();
editPart.installEditPolicy(new MenuPopupDropLayoutEditPolicy(component));
EditPolicy editPolicy = new MenuPopupDropLayoutEditPolicy(component);
editPart.installEditPolicy(editPolicy.getClass(), editPolicy);
}
}
}
Loading