diff --git a/org.eclipse.wb.core.java/META-INF/MANIFEST.MF b/org.eclipse.wb.core.java/META-INF/MANIFEST.MF
index 0fcf863be..1094d612e 100755
--- a/org.eclipse.wb.core.java/META-INF/MANIFEST.MF
+++ b/org.eclipse.wb.core.java/META-INF/MANIFEST.MF
@@ -12,7 +12,7 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.206.0,4.0.0)",
org.eclipse.debug.ui;bundle-version="[3.18.400,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.20.200,4.0.0)",
org.eclipse.ui.editors;bundle-version="[3.17.300,4.0.0)",
- org.eclipse.wb.core;bundle-version="[1.22.0,2.0.0)",
+ org.eclipse.wb.core;bundle-version="[1.24.0,2.0.0)",
org.eclipse.wb.core.databinding.xsd;bundle-version="[1.0.300,2.0.0)",
org.eclipse.compare;bundle-version="[3.11.0,4.0.0)",
org.eclipse.jdt.core;bundle-version="[3.38.0,4.0.0)";visibility:=reexport,
diff --git a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/layout/LayoutNameSupport.java b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/layout/LayoutNameSupport.java
index 8b9902473..ad62e7080 100644
--- a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/layout/LayoutNameSupport.java
+++ b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/layout/LayoutNameSupport.java
@@ -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
@@ -14,6 +14,12 @@
import org.eclipse.wb.core.model.JavaInfo;
import org.eclipse.wb.internal.core.model.variable.SyncParentChildVariableNameSupport;
+import org.eclipse.wb.internal.core.preferences.IPreferenceConstants;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+
+import java.util.Map;
+import java.util.TreeMap;
/**
* Support for managing name of Layout, so that it corresponds to the name of its
@@ -22,9 +28,7 @@
* @author sablin_aa
* @coverage core.model.layout
*/
-public abstract class LayoutNameSupport
-extends
-SyncParentChildVariableNameSupport {
+public abstract class LayoutNameSupport extends SyncParentChildVariableNameSupport {
////////////////////////////////////////////////////////////////////////////
//
// Constructor
@@ -33,4 +37,30 @@ public abstract class LayoutNameSupport
public LayoutNameSupport(T layout) {
super(layout);
}
+
+ /**
+ * @return All supported layout patterns.
+ */
+ protected abstract String[] getTemplates();
+
+ @Override
+ protected Map getValueMap() {
+ // prepare variables
+ Map valueMap = new TreeMap<>();
+ {
+ valueMap.put("layoutAcronym", getAcronym());
+ valueMap.put("layoutClassName", getClassName());
+ }
+ return valueMap;
+ }
+
+ @Override
+ protected String getTemplate() {
+ IPreferenceStore preferences = m_childInfo.getDescription().getToolkit().getPreferences();
+ String template = preferences.getString(IPreferenceConstants.P_LAYOUT_NAME_TEMPLATE);
+ if (!isValidTemplate(getTemplates(), template)) {
+ template = getTemplateForDefault();
+ }
+ return template;
+ }
}
\ No newline at end of file
diff --git a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/preferences/IPreferenceConstants.java b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/preferences/IPreferenceConstants.java
deleted file mode 100644
index 41002d6f8..000000000
--- a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/preferences/IPreferenceConstants.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Google, Inc.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * https://www.eclipse.org/legal/epl-2.0.
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Google, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wb.internal.core.preferences;
-
-import org.eclipse.wb.core.editor.palette.model.entry.ChooseComponentEntryInfo;
-import org.eclipse.wb.core.editor.palette.model.entry.ComponentEntryInfo;
-import org.eclipse.wb.internal.core.model.description.LayoutDescription;
-import org.eclipse.wb.internal.core.nls.model.AbstractSource;
-
-import org.eclipse.swt.graphics.Color;
-
-/**
- * Contains various preference constants.
- *
- * @author scheglov_ke
- * @coverage core.preferences
- */
-public interface IPreferenceConstants {
- String TOOLKIT_ID = "org.eclipse.wb.core";
- ////////////////////////////////////////////////////////////////////////////
- //
- // Common
- //
- ////////////////////////////////////////////////////////////////////////////
- /**
- * When true, we should add {@link ComponentEntryInfo} for any component chosen using
- * {@link ChooseComponentEntryInfo}.
- */
- String P_COMMON_PALETTE_ADD_CHOSEN = "common.addChosenComponentsToPalette";
- /**
- * When true, we should accept drop non-visual beans to design canvas.
- */
- String P_COMMON_ACCEPT_NON_VISUAL_BEANS = "common.acceptNonVisualBeans";
- /**
- * When true, we can show debug information on console.
- */
- String P_COMMON_SHOW_DEBUG_INFO = "common.showDebugInfo";
- /**
- * When true, we should show warning if version of Eclipse does not corresponds to
- * the version of Designer.
- */
- String P_COMMON_SHOW_VERSION_WARNING = "common.showVersionWarning";
- /**
- * Linux only. Troubleshooting option. When enabled, all of the flickering prevention tricks we do
- * would be disabled.
- */
- String P_COMMON_LINUX_DISABLE_SCREENSHOT_WORKAROUNDS =
- "common.linux.disableScreenshotWorkarounds";
- ////////////////////////////////////////////////////////////////////////////
- //
- // General
- //
- ////////////////////////////////////////////////////////////////////////////
- /**
- * When true, we should highlight containers without borders.
- */
- String P_GENERAL_HIGHLIGHT_CONTAINERS = "general.highlightContainersWithoutBorders";
- /**
- * When true, we should add "text" property value as suffix for presentation text.
- */
- String P_GENERAL_TEXT_SUFFIX = "general.showTextPropertySuffix";
- /**
- * When true, we should show property table with important properties after adding
- * new component.
- */
- String P_GENERAL_IMPORTANT_PROPERTIES_AFTER_ADD = "general.importantPropertiesAfterAdd";
- /**
- * When true, we automatically activate direct edit after adding new component.
- */
- String P_GENERAL_DIRECT_EDIT_AFTER_ADD = "general.directEditAfterAdd";
- /**
- * The default width for top level component.
- */
- String P_GENERAL_DEFAULT_TOP_WIDTH = "general.topBoundsDefaultWidth";
- /**
- * The default height for top level component.
- */
- String P_GENERAL_DEFAULT_TOP_HEIGHT = "general.topBoundsDefaultHeight";
- ////////////////////////////////////////////////////////////////////////////
- //
- // Editor layout
- //
- ////////////////////////////////////////////////////////////////////////////
- /**
- * Style of editor layout.
- */
- String P_EDITOR_LAYOUT = "editor.layout";
- /**
- * Pages mode, "Source" first.
- */
- int V_EDITOR_LAYOUT_PAGES_SOURCE = 0;
- /**
- * Pages mode, "Design" first.
- */
- int V_EDITOR_LAYOUT_PAGES_DESIGN = 1;
- /**
- * Split mode, above each other, "Design" first.
- */
- int V_EDITOR_LAYOUT_SPLIT_VERTICAL_DESIGN = 2;
- /**
- * Split mode, side by side, "Design" first.
- */
- int V_EDITOR_LAYOUT_SPLIT_HORIZONTAL_DESIGN = 3;
- /**
- * Split mode, above each other, "Source" first.
- */
- int V_EDITOR_LAYOUT_SPLIT_VERTICAL_SOURCE = 4;
- /**
- * Split mode, side by side, "Source" first.
- */
- int V_EDITOR_LAYOUT_SPLIT_HORIZONTAL_SOURCE = 5;
- /**
- * Delay (in milliseconds) to refresh design canvas on source change in split mode.
- */
- String P_EDITOR_LAYOUT_SYNC_DELAY = "editor.layout.syncDelay";
- /**
- * When true, Designer will try to determine if Java file contains GUI source code.
- */
- String P_EDITOR_RECOGNIZE_GUI = "editor.recognizeSourceGUI";
- /**
- * When true, editor should be maximized when switch to "Design" page.
- */
- String P_EDITOR_MAX_DESIGN = "editor.maximizeOnDesignPage";
- /**
- * When true, source code should be formatted on editor save.
- */
- String P_EDITOR_FORMAT_ON_SAVE = "editor.formatOnSave";
- /**
- * When true, automatically go to the component definition in source on component
- * selection.
- */
- String P_EDITOR_GOTO_DEFINITION_ON_SELECTION = "editor.gotoComponentDefinitionOnSelection";
- /**
- * Action to be performed by double-clicking on widget in widget tree.
- */
- String P_EDITOR_TREE_DBL_CLICK_ACTION = "editor.dblClickOnWidgetInTreeAction";
- /**
- * Option of action to be performed by double-clicking on widget in widget tree. Open editor for
- * selected widget at line of widget creation.
- */
- int V_EDITOR_TREE_OPEN_WIDGET_IN_EDITOR = 0;
- /**
- * Option of action to be performed by double-clicking on widget in widget tree. Creates
- * selection/action listener for selected widget if applicable.
- */
- int V_EDITOR_TREE_CREATE_LISTENER = 1;
- /**
- * Option of action to be performed by double-clicking on widget in widget tree. Initiate variable
- * rename of widget.
- */
- int V_EDITOR_TREE_INITIATE_RENAME = 2;
- ////////////////////////////////////////////////////////////////////////////
- //
- // Highlight visited lines
- //
- ////////////////////////////////////////////////////////////////////////////
- /**
- * When true, editor will highlight visited/executed lines.
- */
- String P_HIGHLIGHT_VISITED = "editor.highlightVisitedLines";
- /**
- * The {@link Color} for highlighting visited/executed lines.
- */
- String P_HIGHLIGHT_VISITED_COLOR = "editor.highlightVisitedLines.color";
- ////////////////////////////////////////////////////////////////////////////
- //
- // Code parsing
- //
- ////////////////////////////////////////////////////////////////////////////
- /**
- * Comment that begins hidden/ignored code block.
- */
- String P_CODE_HIDE_BEGIN = "hiddenCode.begin";
- /**
- * Comment that ends hidden/ignored code block.
- */
- String P_CODE_HIDE_END = "hiddenCode.end";
- /**
- * Comment that specifies that this line of code should be ignored.
- */
- String P_CODE_HIDE_LINE = "hiddenCode.singleLine";
- /**
- * Strict evaluation mode - if some required parameter is missing, exceptions will be shown. If
- * not strict, then we will silently use default value.
- */
- String P_CODE_STRICT_EVALUATE = "evaluation.strictMode";
- ////////////////////////////////////////////////////////////////////////////
- //
- // Variables: auto rename
- //
- ////////////////////////////////////////////////////////////////////////////
- /**
- * The mode that describes how variable should be renamed on "text" property change.
- */
- String P_VARIABLE_TEXT_MODE = "textVariable.mode";
- /**
- * Always rename variable on "text" property change.
- */
- int V_VARIABLE_TEXT_MODE_ALWAYS = 0;
- /**
- * Rename variable on "text" property change only if variable has default name.
- */
- int V_VARIABLE_TEXT_MODE_DEFAULT = 1;
- /**
- * Never rename variable on "text" property change.
- */
- int V_VARIABLE_TEXT_MODE_NEVER = 2;
- /**
- * The the template for variable name on "text" property change.
- */
- String P_VARIABLE_TEXT_TEMPLATE = "textVariable.template";
- /**
- * The maximal count of words from "text" property that should be used in template.
- */
- String P_VARIABLE_TEXT_WORDS_LIMIT = "textVariable.wordsLimit";
- ////////////////////////////////////////////////////////////////////////////
- //
- // Variables: type specific
- //
- ////////////////////////////////////////////////////////////////////////////
- /**
- * The id of preferences for type specific variables information.
- */
- String P_VARIABLE_TYPE_SPECIFIC = "typeSpecificVariable.store";
- ////////////////////////////////////////////////////////////////////////////
- //
- // Variables: mark component
- //
- ////////////////////////////////////////////////////////////////////////////
- /**
- * If this preference is true, variable name should be placed in component, in GUI
- * toolkit specific way, if supported at all.
- */
- String P_VARIABLE_IN_COMPONENT = "putNameIntoComponent";
- ////////////////////////////////////////////////////////////////////////////
- //
- // NLS
- //
- ////////////////////////////////////////////////////////////////////////////
- /**
- * When true and there are existing {@link AbstractSource}, then when we set value
- * for {@link String} property, it should be automatically externalized.
- */
- String P_NLS_AUTO_EXTERNALIZE = "nls.automaticallyExternalize";
- /**
- * When true, then the string's value should be used ONLY for generating a key,
- * ignoring any other set format on it.
- */
- String P_NLS_KEY_AS_STRING_VALUE_ONLY = "nls.useStringValueForKeyOnly";
- /**
- * When true, then qualified type name should be used for generating key.
- */
- String P_NLS_KEY_QUALIFIED_TYPE_NAME = "nls.useQualifiedTypeNameForKey";
- /**
- * When true, then the string's value should be appended in the end of the key.
- */
- String P_NLS_KEY_HAS_STRING_VALUE = "nls.useStringValueForKey";
- /**
- * Use can enter into property value with this prefix, this should mean that NLS key from some
- * source should be used instead.
- */
- String P_NLS_KEY_AS_VALUE_PREFIX = "nls.prefixOfPropertyValueToSpecifyThatItIsKey";
- /**
- * When true, then changes of variable name will cause rename of NLS keys which have
- * this name inside.
- */
- String P_NLS_KEY_RENAME_WITH_VARIABLE = "nls.renameKeysWithVariables";
- /**
- * Comma separated list of locale names, such as "en, de, ru_RU", which should be always displayed
- * in NLS drop-down.
- */
- String P_NLS_ALWAYS_VISIBLE_LOCALES = "nls.alwaysVisibleLocales";
- ////////////////////////////////////////////////////////////////////////////
- //
- // Layouts
- //
- ////////////////////////////////////////////////////////////////////////////
- /**
- * The id of default {@link LayoutDescription}.
- */
- String P_LAYOUT_DEFAULT = "layout.default";
- /**
- * If this preference is true, newly dropped container (if it supports layout) will
- * use layout manager of its parent.
- */
- String P_LAYOUT_OF_PARENT = "layout.inheritLayoutOfParent";
- ////////////////////////////////////////////////////////////////////////////
- //
- // Style
- //
- ////////////////////////////////////////////////////////////////////////////
- /**
- * When true, we use separate sub-menu for each sub-property (select, enum, macro).
- * When false, we generate plain "Style" menu with separators between sub-property
- * items.
- */
- String P_STYLE_PROPERTY_CASCADE_POPUP = "styleProperty.cascadePopup";
-}
diff --git a/org.eclipse.wb.core/META-INF/MANIFEST.MF b/org.eclipse.wb.core/META-INF/MANIFEST.MF
index 81f025aa1..47b1fb498 100644
--- a/org.eclipse.wb.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.wb.core/META-INF/MANIFEST.MF
@@ -342,7 +342,8 @@ Export-Package: org.eclipse.wb.core.branding,
org.eclipse.wb.tests,
org.eclipse.wb.swing,
org.eclipse.wb.swt,
- org.eclipse.wb.rcp",
+ org.eclipse.wb.rcp,
+ org.eclipse.wb.core.java",
org.eclipse.wb.internal.core.preferences.bind;
x-friends:="org.eclipse.wb.swing.FormLayout,
org.eclipse.wb.swing.MigLayout,
diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/preferences/IPreferenceConstants.java b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/preferences/IPreferenceConstants.java
index 5a25f784f..bbe5564b4 100644
--- a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/preferences/IPreferenceConstants.java
+++ b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/preferences/IPreferenceConstants.java
@@ -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
@@ -284,6 +284,10 @@ public interface IPreferenceConstants {
* The id of default {@link LayoutDescription}.
*/
String P_LAYOUT_DEFAULT = "layout.default";
+ /**
+ * The template for Layout variable name.
+ */
+ String P_LAYOUT_NAME_TEMPLATE = "templateLayoutName";
/**
* If this preference is true, newly dropped container (if it supports layout) will
* use layout manager of its parent.
diff --git a/org.eclipse.wb.swing/META-INF/MANIFEST.MF b/org.eclipse.wb.swing/META-INF/MANIFEST.MF
index eaa152120..92a16535e 100644
--- a/org.eclipse.wb.swing/META-INF/MANIFEST.MF
+++ b/org.eclipse.wb.swing/META-INF/MANIFEST.MF
@@ -106,9 +106,9 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.206.0,4.0.0)",
org.eclipse.core.databinding.observable;bundle-version="[1.13.300,2.0.0)",
org.eclipse.core.runtime;bundle-version="[3.31.100,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.20.200,4.0.0)",
- org.eclipse.wb.core;bundle-version="[1.21.0,2.0.0)";visibility:=reexport,
+ org.eclipse.wb.core;bundle-version="[1.24.0,2.0.0)";visibility:=reexport,
org.eclipse.wb.core.ui;bundle-version="[1.10.800,2.0.0)";visibility:=reexport,
- org.eclipse.wb.core.java;bundle-version="[1.13.100,2.0.0)";visibility:=reexport,
+ org.eclipse.wb.core.java;bundle-version="[1.15.0,2.0.0)";visibility:=reexport,
org.eclipse.draw2d;bundle-version="[3.20.0,4.0.0)",
org.eclipse.gef;bundle-version="[3.21.100,4.0.0)",
org.eclipse.nebula.widgets.cdatetime;bundle-version="[1.5.0,2.0.0)"
diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/LayoutNameSupport.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/LayoutNameSupport.java
index d0871c00c..8867cf401 100644
--- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/LayoutNameSupport.java
+++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/LayoutNameSupport.java
@@ -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
@@ -13,12 +13,8 @@
package org.eclipse.wb.internal.swing.model.layout;
import org.eclipse.wb.internal.swing.model.component.ContainerInfo;
-import org.eclipse.wb.internal.swing.preferences.IPreferenceConstants;
-
-import org.eclipse.jface.preference.IPreferenceStore;
import java.util.Map;
-import java.util.TreeMap;
/**
* Support for managing name of {@link LayoutInfo}, so that it corresponds to the name of its parent
@@ -27,14 +23,12 @@
* @author sablin_aa
* @coverage swing.model.layout
*/
-public final class LayoutNameSupport
-extends
-org.eclipse.wb.internal.core.model.layout.LayoutNameSupport {
- public final static String[] TEMPLATES = new String[]{
- "${layoutAcronym}_${containerName}",
- "${layoutAcronym}${containerName-cap}",
- "${containerName}${layoutClassName}",
- "${defaultName}"};
+public final class LayoutNameSupport extends org.eclipse.wb.internal.core.model.layout.LayoutNameSupport {
+ public final static String[] TEMPLATES = new String[] { //
+ "${layoutAcronym}_${containerName}", //
+ "${layoutAcronym}${containerName-cap}", //
+ "${containerName}${layoutClassName}", //
+ "${defaultName}" };
////////////////////////////////////////////////////////////////////////////
//
@@ -51,22 +45,15 @@ public LayoutNameSupport(LayoutInfo layout) {
//
////////////////////////////////////////////////////////////////////////////
@Override
- protected String getTemplate() {
- IPreferenceStore preferences = m_childInfo.getDescription().getToolkit().getPreferences();
- String template = preferences.getString(IPreferenceConstants.P_LAYOUT_NAME_TEMPLATE);
- if (!isValidTemplate(TEMPLATES, template)) {
- template = getTemplateForDefault();
- }
- return template;
+ protected String[] getTemplates() {
+ return TEMPLATES;
}
@Override
protected Map getValueMap() {
// prepare variables
- Map valueMap = new TreeMap<>();
+ Map valueMap = super.getValueMap();
{
- valueMap.put("layoutAcronym", getAcronym());
- valueMap.put("layoutClassName", getClassName());
valueMap.put("containerName", getParentName());
valueMap.put("containerName-cap", getParentNameCap());
}
diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/preferences/IPreferenceConstants.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/preferences/IPreferenceConstants.java
index 730371040..f792d13e8 100644
--- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/preferences/IPreferenceConstants.java
+++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/preferences/IPreferenceConstants.java
@@ -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
@@ -18,12 +18,6 @@
* @author scheglov_ke
* @coverage swing.preferences
*/
-public interface IPreferenceConstants
-extends
-org.eclipse.wb.internal.core.preferences.IPreferenceConstants {
+public interface IPreferenceConstants extends org.eclipse.wb.internal.core.preferences.IPreferenceConstants {
String TOOLKIT_ID = "org.eclipse.wb.swing";
- /**
- * The template for Layout variable name.
- */
- String P_LAYOUT_NAME_TEMPLATE = "templateLayoutName";
}
diff --git a/org.eclipse.wb.swt/.settings/.api_filters b/org.eclipse.wb.swt/.settings/.api_filters
new file mode 100644
index 000000000..b04f441c9
--- /dev/null
+++ b/org.eclipse.wb.swt/.settings/.api_filters
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/org.eclipse.wb.swt/META-INF/MANIFEST.MF b/org.eclipse.wb.swt/META-INF/MANIFEST.MF
index 1b94e2f71..9846f2e67 100644
--- a/org.eclipse.wb.swt/META-INF/MANIFEST.MF
+++ b/org.eclipse.wb.swt/META-INF/MANIFEST.MF
@@ -54,14 +54,14 @@ Export-Package: org.eclipse.wb.internal.swt;x-friends:="org.eclipse.wb.os.linux,
org.eclipse.wb.internal.swt.model.widgets.menu;x-friends:="org.eclipse.wb.tests",
org.eclipse.wb.internal.swt.palette;x-friends:="org.eclipse.wb.tests",
org.eclipse.wb.internal.swt.parser,
- org.eclipse.wb.internal.swt.preferences,
+ org.eclipse.wb.internal.swt.preferences;x-friends:="org.eclipse.wb.tests,org.eclipse.wb.rcp",
org.eclipse.wb.internal.swt.preferences.layout,
org.eclipse.wb.internal.swt.support,
org.eclipse.wb.internal.swt.utils
Require-Bundle: org.eclipse.ui;bundle-version="[3.206.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.31.100,4.0.0)",
- org.eclipse.wb.core;bundle-version="[1.22.0,2.0.0)",
- org.eclipse.wb.core.java;bundle-version="[1.13.100,2.0.0)",
+ org.eclipse.wb.core;bundle-version="[1.24.0,2.0.0)",
+ org.eclipse.wb.core.java;bundle-version="[1.15.0,2.0.0)",
org.eclipse.pde.core;bundle-version="[3.18.100,4.0.0)",
org.eclipse.draw2d;bundle-version="[3.20.0,4.0.0)",
org.eclipse.gef;bundle-version="[3.21.100,4.0.0)",
diff --git a/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/model/layout/LayoutNameSupport.java b/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/model/layout/LayoutNameSupport.java
index 4880d8289..b866bbdc5 100644
--- a/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/model/layout/LayoutNameSupport.java
+++ b/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/model/layout/LayoutNameSupport.java
@@ -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
@@ -13,12 +13,7 @@
package org.eclipse.wb.internal.swt.model.layout;
import org.eclipse.wb.internal.swt.model.widgets.CompositeInfo;
-import org.eclipse.wb.internal.swt.preferences.IPreferenceConstants;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-
import java.util.Map;
-import java.util.TreeMap;
/**
* Support for managing name of {@link LayoutInfo}, so that it corresponds to the name of its parent
@@ -27,14 +22,12 @@
* @author sablin_aa
* @coverage swt.model.layout
*/
-public final class LayoutNameSupport
-extends
-org.eclipse.wb.internal.core.model.layout.LayoutNameSupport {
- public final static String[] TEMPLATES = new String[]{
- "${layoutAcronym}_${compositeName}",
- "${layoutAcronym}${compositeName-cap}",
- "${compositeName}${layoutClassName}",
- "${defaultName}"};
+public final class LayoutNameSupport extends org.eclipse.wb.internal.core.model.layout.LayoutNameSupport {
+ public final static String[] TEMPLATES = new String[] { //
+ "${layoutAcronym}_${compositeName}", //
+ "${layoutAcronym}${compositeName-cap}", //
+ "${compositeName}${layoutClassName}", //
+ "${defaultName}" };
////////////////////////////////////////////////////////////////////////////
//
@@ -51,22 +44,15 @@ public LayoutNameSupport(LayoutInfo layout) {
//
////////////////////////////////////////////////////////////////////////////
@Override
- protected String getTemplate() {
- IPreferenceStore preferences = m_childInfo.getDescription().getToolkit().getPreferences();
- String template = preferences.getString(IPreferenceConstants.P_LAYOUT_NAME_TEMPLATE);
- if (!isValidTemplate(TEMPLATES, template)) {
- template = getTemplateForDefault();
- }
- return template;
+ protected String[] getTemplates() {
+ return TEMPLATES;
}
@Override
protected Map getValueMap() {
// prepare variables
- Map valueMap = new TreeMap<>();
+ Map valueMap = super.getValueMap();
{
- valueMap.put("layoutAcronym", getAcronym());
- valueMap.put("layoutClassName", getClassName());
valueMap.put("compositeName", getParentName());
valueMap.put("compositeName-cap", getParentNameCap());
}
diff --git a/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/preferences/IPreferenceConstants.java b/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/preferences/IPreferenceConstants.java
index be2e9b91e..349cfb034 100644
--- a/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/preferences/IPreferenceConstants.java
+++ b/org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/preferences/IPreferenceConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2023 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
@@ -13,7 +13,6 @@
package org.eclipse.wb.internal.swt.preferences;
import org.eclipse.wb.internal.swt.model.layout.LayoutDataInfo;
-import org.eclipse.wb.internal.swt.model.layout.LayoutInfo;
import org.eclipse.jface.resource.LocalResourceManager;
@@ -24,7 +23,7 @@
* @author lobas_av
* @coverage swt.preferences
*/
-public interface IPreferenceConstants {
+public interface IPreferenceConstants extends org.eclipse.wb.internal.core.preferences.IPreferenceConstants {
////////////////////////////////////////////////////////////////////////////
//
// Preferences
@@ -35,10 +34,6 @@ public interface IPreferenceConstants {
* use it for color/font/image access. This allows use resources sharing.
*/
String P_USE_RESOURCE_MANAGER = "useResourceManager";
- /**
- * The template for {@link LayoutInfo} name.
- */
- String P_LAYOUT_NAME_TEMPLATE = "templateLayoutName";
/**
* The template for {@link LayoutDataInfo} name.
*/