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 Google, Inc.
* Copyright (c) 2011, 2025 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,12 +12,13 @@
*******************************************************************************/
package org.eclipse.wb.internal.core.model.property.editor;

import org.eclipse.wb.core.controls.CCombo3;
import org.eclipse.wb.internal.core.model.clipboard.IClipboardSourceProvider;
import org.eclipse.wb.internal.core.model.property.GenericProperty;
import org.eclipse.wb.internal.core.model.property.Property;
import org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils;

import org.eclipse.swt.custom.CCombo;

/**
* The base {@link PropertyEditor} for selecting single value of type {@link Enum}.
*
Expand Down Expand Up @@ -62,20 +63,20 @@ public void setText(Property property, String text) throws Exception {
//
////////////////////////////////////////////////////////////////////////////
@Override
protected void addItems(Property property, CCombo3 combo) throws Exception {
protected void addItems(Property property, CCombo combo) throws Exception {
Enum<?>[] elements = getElements(property);
for (Enum<?> element : elements) {
combo.add(element.toString());
}
}

@Override
protected void selectItem(Property property, CCombo3 combo) throws Exception {
protected void selectItem(Property property, CCombo combo) throws Exception {
combo.setText(getText(property));
}

@Override
protected void toPropertyEx(Property property, CCombo3 combo, int index) throws Exception {
protected void toPropertyEx(Property property, CCombo combo, int index) throws Exception {
Enum<?>[] elements = getElements(property);
Enum<?> element = elements[index];
setPropertyValue(property, element);
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, 2025 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.internal.core.model.property.editor;

import org.eclipse.wb.core.controls.CCombo3;
import org.eclipse.wb.core.model.JavaInfo;
import org.eclipse.wb.internal.core.model.JavaInfoUtils;
import org.eclipse.wb.internal.core.model.clipboard.IClipboardSourceProvider;
Expand All @@ -23,6 +22,8 @@
import org.eclipse.wb.internal.core.utils.check.Assert;
import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils;

import org.eclipse.swt.custom.CCombo;

import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -95,19 +96,19 @@ public String getClipboardSource(GenericProperty property) throws Exception {
//
////////////////////////////////////////////////////////////////////////////
@Override
protected void addItems(Property property, CCombo3 combo) throws Exception {
protected void addItems(Property property, CCombo combo) throws Exception {
for (int i = 0; i < getCount(); i++) {
combo.add(getTitle(i));
}
}

@Override
protected void selectItem(Property property, CCombo3 combo) throws Exception {
protected void selectItem(Property property, CCombo combo) throws Exception {
combo.setText(getText(property));
}

@Override
protected void toPropertyEx(Property property, CCombo3 combo, int index) throws Exception {
protected void toPropertyEx(Property property, CCombo combo, int index) throws Exception {
if (property instanceof GenericProperty genericProperty) {
String expression = getExpression(index);
Object evaluatedExpression = evaluateExpression(genericProperty, expression);
Expand All @@ -130,7 +131,7 @@ private static Object evaluateExpression(final GenericProperty genericProperty,
/**
* Sets value of simple {@link Property}, not {@link GenericProperty}.
*/
protected void toPropertyEx_simpleProperty(Property property, CCombo3 combo, int index)
protected void toPropertyEx_simpleProperty(Property property, CCombo combo, int index)
throws Exception {
}

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, 2025 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.internal.core.model.property.editor;

import org.eclipse.wb.core.controls.CCombo3;
import org.eclipse.wb.core.model.JavaInfo;
import org.eclipse.wb.internal.core.DesignerPlugin;
import org.eclipse.wb.internal.core.model.JavaInfoUtils;
Expand Down Expand Up @@ -65,6 +64,7 @@
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.widgets.Composite;
Expand Down Expand Up @@ -127,7 +127,7 @@ protected String getText(Property _property) throws Exception {
//
////////////////////////////////////////////////////////////////////////////
@Override
protected void addItems(Property _property, CCombo3 combo) throws Exception {
protected void addItems(Property _property, CCombo combo) throws Exception {
GenericProperty property = (GenericProperty) _property;
IType type = getType(property);
List<IField> fields = getFields(type);
Expand All @@ -139,7 +139,7 @@ protected void addItems(Property _property, CCombo3 combo) throws Exception {
}

@Override
protected void selectItem(Property _property, CCombo3 combo) throws Exception {
protected void selectItem(Property _property, CCombo combo) throws Exception {
GenericProperty property = (GenericProperty) _property;
combo.select(-1);
// try to find current field
Expand All @@ -153,7 +153,7 @@ protected void selectItem(Property _property, CCombo3 combo) throws Exception {
}

@Override
protected void toPropertyEx(Property _property, CCombo3 combo, int index) throws Exception {
protected void toPropertyEx(Property _property, CCombo combo, int index) throws Exception {
GenericProperty property = (GenericProperty) _property;
IField field = (IField) combo.getData("" + index);
setField(property, field);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
*******************************************************************************/
package org.eclipse.wb.internal.core.model.property.editor;

import org.eclipse.wb.core.controls.CCombo3;
import org.eclipse.wb.internal.core.model.clipboard.IClipboardSourceProvider;
import org.eclipse.wb.internal.core.model.property.GenericProperty;
import org.eclipse.wb.internal.core.model.property.Property;

import org.eclipse.swt.custom.CCombo;

import java.beans.PropertyDescriptor;
import java.util.Objects;

Expand Down Expand Up @@ -109,19 +110,19 @@ public String getClipboardSource(GenericProperty property) throws Exception {
//
////////////////////////////////////////////////////////////////////////////
@Override
protected void addItems(Property property, CCombo3 combo) throws Exception {
protected void addItems(Property property, CCombo combo) throws Exception {
for (String title : m_names) {
combo.add(title);
}
}

@Override
protected void selectItem(Property property, CCombo3 combo) throws Exception {
protected void selectItem(Property property, CCombo combo) throws Exception {
combo.setText(getText(property));
}

@Override
protected void toPropertyEx(Property property, CCombo3 combo, int index) throws Exception {
protected void toPropertyEx(Property property, CCombo combo, int index) throws Exception {
Object value = m_values[index];
if (property instanceof GenericProperty genericProperty) {
String source = getValueSource(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*******************************************************************************/
package org.eclipse.wb.internal.core.model.property.editor;

import org.eclipse.wb.core.controls.CCombo3;
import org.eclipse.wb.internal.core.model.clipboard.IClipboardSourceProvider;
import org.eclipse.wb.internal.core.model.property.GenericProperty;
import org.eclipse.wb.internal.core.model.property.IConfigurablePropertyObject;
Expand All @@ -23,6 +22,8 @@
import org.eclipse.wb.internal.core.utils.state.EditorState;
import org.eclipse.wb.internal.core.utils.state.EditorWarning;

import org.eclipse.swt.custom.CCombo;

import org.apache.commons.lang3.StringUtils;

import java.lang.reflect.Field;
Expand Down Expand Up @@ -129,19 +130,19 @@ public String getClipboardSource(GenericProperty property) throws Exception {
//
////////////////////////////////////////////////////////////////////////////
@Override
protected void addItems(Property property, CCombo3 combo) throws Exception {
protected void addItems(Property property, CCombo combo) throws Exception {
for (String title : m_titles) {
combo.add(title);
}
}

@Override
protected void selectItem(Property property, CCombo3 combo) throws Exception {
protected void selectItem(Property property, CCombo combo) throws Exception {
combo.setText(getText(property));
}

@Override
protected void toPropertyEx(Property property, CCombo3 combo, int index) throws Exception {
protected void toPropertyEx(Property property, CCombo combo, int index) throws Exception {
Object value = m_values[index];
if (property instanceof GenericProperty genericProperty) {
String source = getValueSource(value);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011 Google, Inc.
* Copyright (c) 2011, 2025 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,11 +12,12 @@
*******************************************************************************/
package org.eclipse.wb.internal.core.model.property.editor;

import org.eclipse.wb.core.controls.CCombo3;
import org.eclipse.wb.internal.core.model.property.Property;
import org.eclipse.wb.internal.core.model.property.converter.StringConverter;
import org.eclipse.wb.internal.core.utils.state.EditorState;

import org.eclipse.swt.custom.CCombo;

import java.util.Map;

/**
Expand All @@ -35,7 +36,7 @@ public final class StringListPropertyEditor extends AbstractListPropertyEditor {
//
////////////////////////////////////////////////////////////////////////////
@Override
protected void toPropertyEx_simpleProperty(Property property, CCombo3 combo, int index)
protected void toPropertyEx_simpleProperty(Property property, CCombo combo, int index)
throws Exception {
property.setValue(m_strings[index]);
}
Expand Down
Loading
Loading