JBoss Tools SVN: r18403 - in trunk/hibernatetools/plugins: org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-11-04 07:04:51 -0500 (Wed, 04 Nov 2009)
New Revision: 18403
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage2.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFilePage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5095
Removed "Create Empty" button.
Messages moved to right plugin.
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java 2009-11-04 03:11:34 UTC (rev 18402)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java 2009-11-04 12:04:51 UTC (rev 18403)
@@ -200,19 +200,6 @@
public static String NewConfigurationWizardPage_user_name;
public static String NewHibernateMappingElementsSelectionPage_select;
- public static String NewHibernateMappingFilePage_class_name_column;
- public static String NewHibernateMappingFilePage_file_name_column;
- public static String NewHibernateMappingFilePage_hibernate_xml_mapping_file;
-
- public static String NewHibernateMappingFilePage_project_name_column;
-
- public static String NewHibernateMappingFilePage_this_wizard_creates;
- public static String NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file;
- public static String NewHibernateMappingFileWizard_create_new_xml_mapping_file;
-
- public static String NewHibernateMappingFileWizard_finding_dependent_cu;
-
- public static String NewHibernateMappingFileWizard_selection_cant_be_empty;
public static String NewReverseEngineeringFileWizard_create_hibernate_reverse_engineering_file;
public static String NewReverseEngineeringFileWizard_create_new_hibernate_reveng_xml;
public static String NewReverseEngineeringFileWizard_creating;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2009-11-04 03:11:34 UTC (rev 18402)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2009-11-04 12:04:51 UTC (rev 18403)
@@ -194,16 +194,7 @@
NewConfigurationWizardPage_session_factory_name=&Session factory name:
NewConfigurationWizardPage_this_wizard_creates=This wizard creates a new configuration file to use with Hibernate.
NewConfigurationWizardPage_user_name=User&name:
-NewHibernateMappingElementsSelectionPage_select=Select compilation units or containers.
-NewHibernateMappingFilePage_class_name_column=Class name
-NewHibernateMappingFilePage_file_name_column=File name
-NewHibernateMappingFilePage_hibernate_xml_mapping_file=Hibernate XML Mapping file
-NewHibernateMappingFilePage_project_name_column=Project name
-NewHibernateMappingFilePage_this_wizard_creates=This wizard creates a new Hibernate XML Mapping file skeletons
-NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file=Create Hibernate XML Mapping file (hbm.xml)
-NewHibernateMappingFileWizard_create_new_xml_mapping_file=Create new XML Mapping files.
-NewHibernateMappingFileWizard_finding_dependent_cu=Search for dependent compilation units...
-NewHibernateMappingFileWizard_selection_cant_be_empty=Selection can't be empty
+
NewReverseEngineeringFileWizard_create_hibernate_reverse_engineering_file=Create Hibernate Reverse Engineering file (reveng.xml)
NewReverseEngineeringFileWizard_create_new_hibernate_reveng_xml=Create a new hibernate.reveng.xml.
NewReverseEngineeringFileWizard_creating=Creating
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.java 2009-11-04 03:11:34 UTC (rev 18402)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.java 2009-11-04 12:04:51 UTC (rev 18403)
@@ -41,9 +41,19 @@
public static String AddRemoveTableComposite_java_packages_title;
public static String AddRemoveTableComposite_java_select_types;
public static String AddRemoveTableComposite_java_select_packages;
+
public static String NewHibernateMappingElementsSelectionPage2_description;
- public static String NewHibernateMappingElementsSelectionPage2_createEmpty;
+ public static String NewHibernateMappingFilePage_class_name_column;
+ public static String NewHibernateMappingFilePage_file_name_column;
+ public static String NewHibernateMappingFilePage_hibernate_xml_mapping_file;
+ public static String NewHibernateMappingFilePage_project_name_column;
+ public static String NewHibernateMappingFilePage_this_wizard_creates;
+ public static String NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file;
+ public static String NewHibernateMappingFileWizard_create_empty_xml_mapping_file;
+ public static String NewHibernateMappingFileWizard_look_for_dependent_cu;
+ public static String NewHibernateMappingFileWizard_selection_cant_be_empty;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, JdtUiMessages.class);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.properties 2009-11-04 03:11:34 UTC (rev 18402)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.properties 2009-11-04 12:04:51 UTC (rev 18403)
@@ -45,5 +45,15 @@
AddRemoveTableComposite_java_packages_title=Packages
AddRemoveTableComposite_java_select_types=Select types to be mapped
AddRemoveTableComposite_java_select_packages=Select packages to search for java types
-NewHibernateMappingElementsSelectionPage2_description=Add classes and packages to create mapping files for
-NewHibernateMappingElementsSelectionPage2_createEmpty=Create empty file (hbm.xml)
\ No newline at end of file
+
+NewHibernateMappingElementsSelectionPage_select=Select compilation units or containers
+NewHibernateMappingElementsSelectionPage2_description=Add classes and packages or wizard will create an empty mapping file
+NewHibernateMappingFilePage_class_name_column=Class name
+NewHibernateMappingFilePage_file_name_column=File name
+NewHibernateMappingFilePage_hibernate_xml_mapping_file=Hibernate XML Mapping file
+NewHibernateMappingFilePage_project_name_column=Project name
+NewHibernateMappingFilePage_this_wizard_creates=This wizard creates new Hibernate XML Mapping file skeletons
+NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file=New Hibernate XML Mapping file (hbm.xml)
+NewHibernateMappingFileWizard_create_empty_xml_mapping_file=Create a new empty XML Mapping files
+NewHibernateMappingFileWizard_look_for_dependent_cu=Search for dependent compilation units...
+NewHibernateMappingFileWizard_selection_cant_be_empty=Selection can't be empty
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage2.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage2.java 2009-11-04 03:11:34 UTC (rev 18402)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage2.java 2009-11-04 12:04:51 UTC (rev 18403)
@@ -15,7 +15,6 @@
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.TableItem;
import org.hibernate.eclipse.jdt.ui.internal.JdtUiMessages;
@@ -28,8 +27,6 @@
AddRemoveTableComposite addRemoveTableComposite;
- Button createEmpty;
-
private IStructuredSelection selection;
public NewHibernateMappingElementsSelectionPage2(String pageName, IStructuredSelection selection) {
@@ -39,16 +36,8 @@
}
public void createControl(Composite parent) {
- /*Composite container = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
-
- container.setLayout(layout);
- layout.verticalSpacing = 10;*/
-
addRemoveTableComposite = new AddRemoveTableComposite(parent, SWT.NONE);
addRemoveTableComposite.getTableViewer().setInput(selection.toArray());
- createEmpty = new Button(addRemoveTableComposite, SWT.CHECK);
- createEmpty.setText(JdtUiMessages.NewHibernateMappingElementsSelectionPage2_createEmpty);
setControl(addRemoveTableComposite);
}
@@ -60,9 +49,5 @@
}
return new StructuredSelection(data);
}
-
- public boolean createEmpty(){
- return createEmpty.getSelection();
- }
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFilePage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFilePage.java 2009-11-04 03:11:34 UTC (rev 18402)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFilePage.java 2009-11-04 12:04:51 UTC (rev 18403)
@@ -38,8 +38,8 @@
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.hibernate.console.ImageConstants;
-import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.eclipse.jdt.ui.internal.JdtUiMessages;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.EntityInfo;
/**
@@ -55,8 +55,8 @@
*/
protected NewHibernateMappingFilePage() {
super(""); //$NON-NLS-1$
- setTitle(HibernateConsoleMessages.NewHibernateMappingFilePage_hibernate_xml_mapping_file);
- setMessage(HibernateConsoleMessages.NewHibernateMappingFilePage_this_wizard_creates, WARNING);
+ setTitle(JdtUiMessages.NewHibernateMappingFilePage_hibernate_xml_mapping_file);
+ setMessage(JdtUiMessages.NewHibernateMappingFilePage_this_wizard_creates, WARNING);
}
public void createControl(Composite parent) {
@@ -99,16 +99,16 @@
//if (project_infos.keySet().size() > 1){
column = new TableColumn(table, SWT.LEFT, coulmnIndex++);
- column.setText(HibernateConsoleMessages.NewHibernateMappingFilePage_project_name_column);
+ column.setText(JdtUiMessages.NewHibernateMappingFilePage_project_name_column);
column.setWidth(120);
//}
column = new TableColumn(table, SWT.LEFT, coulmnIndex++);
- column.setText(HibernateConsoleMessages.NewHibernateMappingFilePage_class_name_column);
+ column.setText(JdtUiMessages.NewHibernateMappingFilePage_class_name_column);
column.setWidth(150);
column = new TableColumn(table, SWT.LEFT, coulmnIndex++);
- column.setText(HibernateConsoleMessages.NewHibernateMappingFilePage_file_name_column);
+ column.setText(JdtUiMessages.NewHibernateMappingFilePage_file_name_column);
column.setWidth(150);
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2009-11-04 03:11:34 UTC (rev 18402)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2009-11-04 12:04:51 UTC (rev 18403)
@@ -63,6 +63,7 @@
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.eclipse.jdt.ui.internal.JdtUiMessages;
import org.hibernate.eclipse.jdt.ui.internal.jpa.collect.AllEntitiesInfoCollector;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.EntityInfo;
import org.hibernate.tool.hbm2x.HibernateMappingExporter;
@@ -96,7 +97,7 @@
public NewHibernateMappingFileWizard(){
setDefaultPageImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.NEW_WIZARD) );
setNeedsProgressMonitor(true);
- setWindowTitle(HibernateConsoleMessages.NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file);
+ setWindowTitle(JdtUiMessages.NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file);
}
@Override
@@ -107,7 +108,7 @@
selection = new StructuredSelection();
}
- page0 = new NewHibernateMappingElementsSelectionPage2(HibernateConsoleMessages.NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file, selection);
+ page0 = new NewHibernateMappingElementsSelectionPage2(JdtUiMessages.NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file, selection);
addPage(page0);
//page1 = new NewHibernateMappingElementsSelectionPage(selection);
@@ -116,8 +117,8 @@
//addPage(page1);
cPage = new WizardNewFileCreationPage( "Ccfgxml", selection ); //$NON-NLS-1$
- cPage.setTitle( HibernateConsoleMessages.NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file );
- cPage.setDescription( HibernateConsoleMessages.NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file );
+ cPage.setTitle( JdtUiMessages.NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file );
+ cPage.setDescription( JdtUiMessages.NewHibernateMappingFileWizard_create_empty_xml_mapping_file );
cPage.setFileName("hibernate.hbm.xml"); //$NON-NLS-1$
addPage( cPage );
@@ -127,7 +128,7 @@
@Override
public IWizardPage getNextPage(IWizardPage page) {
- if (page == page0 && !page0.createEmpty()) return page2;
+ if (page == page0 && !page0.getSelection().isEmpty()) return page2;
if (page == cPage) return null;
return super.getNextPage(page);
}
@@ -206,7 +207,7 @@
@Override
public boolean performFinish() {
- if (page0.createEmpty()){
+ if (page0.getSelection().isEmpty()){
final IFile file = cPage.createNewFile();
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
@@ -396,7 +397,7 @@
}
protected void updateCompilationUnits(){
- Assert.isNotNull(page0.getSelection(), HibernateConsoleMessages.NewHibernateMappingFileWizard_selection_cant_be_empty);
+ Assert.isNotNull(page0.getSelection(), JdtUiMessages.NewHibernateMappingFileWizard_selection_cant_be_empty);
if ((selectionCU == null) || !page0.getSelection().equals(selection)) {
selectionCU = new HashSet<ICompilationUnit>();
project_infos.clear();
@@ -407,7 +408,7 @@
public void run(IProgressMonitor monitor)
throws InvocationTargetException,
InterruptedException {
- monitor.beginTask(HibernateConsoleMessages.NewHibernateMappingFileWizard_finding_dependent_cu, selection.size() + 1);
+ monitor.beginTask(JdtUiMessages.NewHibernateMappingFileWizard_look_for_dependent_cu, selection.size() + 1);
Iterator<?> it = selection.iterator();
int done = 1;
while (it.hasNext()) {
15 years, 1 month
JBoss Tools SVN: r18402 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui: icons/full/obj16 and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-11-03 22:11:34 -0500 (Tue, 03 Nov 2009)
New Revision: 18402
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj16/connection16.gif
trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj24/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj24/connection24.gif
trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj32/xsl_task.png
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/FigureHighlightEditPolicy.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/FigureSelectEditPolicy.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/IShowHighlighFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/SmooksRootEditPartLayoutEditPolicy.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/ISelectableFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/XSLMappingAutoLayout.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConfigurationActivator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/GraphicsConstants.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationReaderPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10InputFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeContainerEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeNodeEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/TreeNodeGraphicalNodeEditPolicy.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/TreeContainerFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/TreeNodeFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPaletteRootCreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksXSLTemplateGraphicalEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/TaskTypeManager.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/AbstractResourceConfigEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/InputDataContainerEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksRootEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/InputDataTreeNodeModel.java
Log:
JBIDE-5126
Done.
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj16/connection16.gif
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj16/connection16.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj24/connection24.gif
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj24/connection24.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj32/xsl_task.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj32/xsl_task.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConfigurationActivator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConfigurationActivator.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConfigurationActivator.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -64,12 +64,19 @@
@Override
protected void initializeImageRegistry(ImageRegistry reg) {
super.initializeImageRegistry(reg);
+ // regist palette image
+ reg.put(GraphicsConstants.IMAGE_LINK16, imageDescriptorFromPlugin(PLUGIN_ID,
+ GraphicsConstants.IMAGE_LINK16));
+ reg.put(GraphicsConstants.IMAGE_LINK24, imageDescriptorFromPlugin(PLUGIN_ID,
+ GraphicsConstants.IMAGE_LINK24));
// registe task image
reg.put(GraphicsConstants.IMAGE_APPLY_FREEMARKER_TASK, imageDescriptorFromPlugin(PLUGIN_ID,
GraphicsConstants.IMAGE_APPLY_FREEMARKER_TASK));
reg.put(GraphicsConstants.IMAGE_JAVA_AMPPING_TASK, imageDescriptorFromPlugin(PLUGIN_ID,
GraphicsConstants.IMAGE_JAVA_AMPPING_TASK));
+ reg.put(GraphicsConstants.IMAGE_APPLY_XSL_TASK, imageDescriptorFromPlugin(PLUGIN_ID,
+ GraphicsConstants.IMAGE_APPLY_XSL_TASK));
reg.put(GraphicsConstants.IMAGE_INPUT_TASK, imageDescriptorFromPlugin(PLUGIN_ID,
GraphicsConstants.IMAGE_INPUT_TASK));
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/GraphicsConstants.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/GraphicsConstants.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/GraphicsConstants.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -1,63 +1,84 @@
package org.jboss.tools.smooks.configuration.editors;
import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.FormColors;
+import org.eclipse.ui.forms.IFormColors;
public final class GraphicsConstants {
+
+ public static Color BORDER_CORLOR;
+
+ public static Color TB_BG_CORLOR;
- public static final Color BORDER_CORLOER = new Color(null,128,128,128);
-
+ public static Color FONT_COLOR ;
+
+ static {
+ FormColors toolkit = new FormColors(Display.getDefault());
+ BORDER_CORLOR = toolkit.getBorderColor();
+ TB_BG_CORLOR = toolkit.getColor(IFormColors.TB_BG);
+ FONT_COLOR = toolkit.getColor(IFormColors.TITLE);
+// toolkit.dispose();
+ }
+
public static final String IMAGE_JAVA_AMPPING_TASK = "icons/full/obj32/java_mapping_task.jpg";
-
+
+ public static final String IMAGE_LINK16 = "icons/full/obj16/connection16.gif";
+
+ public static final String IMAGE_LINK24 = "icons/full/obj16/connection24.gif";
+
+ public static final String IMAGE_APPLY_XSL_TASK = "icons/full/obj32/xsl_task.png";
+
public static final String IMAGE_APPLY_FREEMARKER_TASK = "icons/full/obj32/freemarker_task.jpg";
-
+
public static final String IMAGE_INPUT_TASK = "icons/full/obj32/input_task.jpg";
-
+
public static final String IMAGE_JAVA_ATTRIBUTE = "icons/full/obj16/att_obj.gif";
-
+
public static final String IMAGE_VALIDATED_TAG = "icons/full/obj16/validated_tag.gif";
-
+
public static final String IMAGE_PROPERTY_SHEET_PAGE = "icons/full/prop_ps.gif";
-
+
public static final String IMAGE_JAVA_OBJECT = "icons/full/obj16/class_obj.gif";
-
+
public static final String IMAGE_PACKAGE_OBJECT = "icons/full/obj16/package_obj.gif";
-
+
public static final String IMAGE_XSL_CHOICE = "icons/full/obj16/xsl_choice.gif";
-
+
public static final String IMAGE_XSL_TEMPLATE_APPLY = "icons/full/obj16/xsl_template_apply.gif";
-
+
public static final String IMAGE_XSL_FOREACH = "icons/full/obj16/xsl_foreach.gif";
-
+
public static final String IMAGE_XSL_SORT = "icons/full/obj16/xsl_sort.gif";
-
+
public static final String IMAGE_XSL_IF = "icons/full/obj16/xsl_if.gif";
-
- public static final String IMAGE_XSL_STYLESHEET= "icons/full/obj16/xsl_stylesheet.gif";
-
+
+ public static final String IMAGE_XSL_STYLESHEET = "icons/full/obj16/xsl_stylesheet.gif";
+
public static final String IMAGE_XSL_TEMPLATE = "icons/full/obj16/xsl_template.gif";
-
+
public static final String IMAGE_OVR_ERROR = "icons/full/ovr16/error_co.gif";
-
+
public static final String IMAGE_OVR_WARING = "icons/full/ovr16/warning_co.gif";
-
+
public static final String IMAGE_JAVA_INTERFACE = "icons/full/obj16/int_obj.gif";
-
+
public static final String IMAGE_JAVA_COLLECTION = "icons/full/obj16/javalistmodel.gif";
-
+
public static final String IMAGE_JAVA_BEAN = "icons/full/obj16/java_bean.png";
-
+
public static final String IMAGE_INPUT_DATA_HEADER = "icons/full/obj16/input_data_header.gif";
-
+
public static final String IMAGE_JAVA_ARRAY = "icons/full/obj16/javaarraymodel.gif";
-
+
public static final String IMAGE_CHECKBOX_CHECK = "icons/full/obj16/checkbox_checked.gif";
-
+
public static final String IMAGE_CHECKBOX_UNCHECK = "icons/full/obj16/checkbox_uncheck.gif";
-
+
public static final String JAVA_PROPERTY_ICON_PATH = IMAGE_JAVA_ATTRIBUTE;
-
+
public static final String JAVA_PROPERTY_ICON = JAVA_PROPERTY_ICON_PATH;
-
+
public static final String IMAGE_PATH_ERROR = "icons/full/obj16/error_obj.gif";
public static final String IMAGE_PATH_WARNING = "icons/full/obj16/warning_obj.gif";
@@ -69,13 +90,13 @@
public static final String IMAGE_ERROR = IMAGE_PATH_ERROR;
public static final String IMAGE_EMPTY = IMAGE_PATH_BLANK;
-
+
public static final String IMAGE_XML_ELEMENT = "icons/full/obj16/element_obj.gif";
-
+
public static final String IMAGE_XML_ATTRIBUTE = "icons/full/obj16/attribute_obj.gif";
-
+
public static final String IMAGE_MAPPING_LINE = "icons/full/obj16/mapping_line.gif";
-
+
public static final String IMAGE_BINDING_LINE = "icons/full/obj16/binding_line.gif";
public static final String IMAGE_UNKNOWN_OBJ = "icons/full/obj16/unknown_obj.gif";
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationReaderPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationReaderPage.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationReaderPage.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -139,7 +139,7 @@
fillLayout.marginWidth = 1;
gd = new GridData(GridData.FILL_BOTH);
tableComposite.setLayoutData(gd);
- tableComposite.setBackground(GraphicsConstants.BORDER_CORLOER);
+ tableComposite.setBackground(GraphicsConstants.BORDER_CORLOR);
tableComposite.setLayout(fillLayout);
inputDataViewer = CheckboxTableViewer.newCheckList(tableComposite, SWT.MULTI | SWT.FULL_SELECTION);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -225,7 +225,7 @@
FillLayout fillLayout = new FillLayout();
fillLayout.marginHeight = 1;
fillLayout.marginWidth = 1;
- viewerContainer.setBackground(GraphicsConstants.BORDER_CORLOER);
+ viewerContainer.setBackground(GraphicsConstants.BORDER_CORLOR);
viewerContainer.setLayout(fillLayout);
inputModelViewer = new TreeViewer(viewerContainer, SWT.NONE);
inputModelViewer.setContentProvider(new CompoundStructuredDataContentProvider());
@@ -716,7 +716,7 @@
gd = new GridData(GridData.FILL_BOTH);
gd.heightHint = 200;
tableComposite.setLayoutData(gd);
- tableComposite.setBackground(GraphicsConstants.BORDER_CORLOER);
+ tableComposite.setBackground(GraphicsConstants.BORDER_CORLOR);
tableComposite.setLayout(fillLayout);
inputDataViewer = CheckboxTableViewer.newCheckList(tableComposite, SWT.MULTI | SWT.FULL_SELECTION);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10InputFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10InputFormPage.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors_10/Smooks10InputFormPage.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -193,7 +193,7 @@
FillLayout fillLayout = new FillLayout();
fillLayout.marginHeight = 1;
fillLayout.marginWidth = 1;
- viewerContainer.setBackground(GraphicsConstants.BORDER_CORLOER);
+ viewerContainer.setBackground(GraphicsConstants.BORDER_CORLOR);
viewerContainer.setLayout(fillLayout);
inputModelViewer = new TreeViewer(viewerContainer, SWT.NONE);
inputModelViewer.setContentProvider(new CompoundStructuredDataContentProvider());
@@ -558,7 +558,7 @@
gd = new GridData(GridData.FILL_BOTH);
gd.heightHint = 200;
tableComposite.setLayoutData(gd);
- tableComposite.setBackground(GraphicsConstants.BORDER_CORLOER);
+ tableComposite.setBackground(GraphicsConstants.BORDER_CORLOR);
tableComposite.setLayout(fillLayout);
inputDataViewer = CheckboxTableViewer.newCheckList(tableComposite, SWT.MULTI | SWT.FULL_SELECTION);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeContainerEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeContainerEditPart.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeContainerEditPart.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -16,6 +16,7 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IEditorPart;
import org.jboss.tools.smooks.editor.ISmooksModelProvider;
+import org.jboss.tools.smooks.gef.tree.editpolicy.FigureHighlightEditPolicy;
import org.jboss.tools.smooks.gef.tree.editpolicy.TreeNodeGraphicalNodeEditPolicy;
import org.jboss.tools.smooks.gef.tree.figures.IMoveableModel;
import org.jboss.tools.smooks.gef.tree.figures.TreeContainerFigure;
@@ -114,6 +115,7 @@
@Override
protected void createEditPolicies() {
this.installEditPolicy(EditPolicy.NODE_ROLE, new TreeNodeGraphicalNodeEditPolicy());
+ this.installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new FigureHighlightEditPolicy());
}
// @Override
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeNodeEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeNodeEditPart.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeNodeEditPart.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -28,6 +28,7 @@
import org.eclipse.gef.tools.DirectEditManager;
import org.eclipse.jface.viewers.TextCellEditor;
import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.smooks.gef.tree.editpolicy.FigureHighlightEditPolicy;
import org.jboss.tools.smooks.gef.tree.editpolicy.TreeNodeGraphicalNodeEditPolicy;
import org.jboss.tools.smooks.gef.tree.editpolicy.TreeNodeSelectEditPolicy;
import org.jboss.tools.smooks.gef.tree.figures.ITreeFigureListener;
@@ -177,6 +178,7 @@
});
this.installEditPolicy(EditPolicy.NODE_ROLE, new TreeNodeGraphicalNodeEditPolicy());
this.installEditPolicy("SELECTED", new TreeNodeSelectEditPolicy());
+ this.installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new FigureHighlightEditPolicy());
}
@Override
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/FigureHighlightEditPolicy.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/FigureHighlightEditPolicy.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/FigureHighlightEditPolicy.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -0,0 +1,82 @@
+package org.jboss.tools.smooks.gef.tree.editpolicy;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
+import org.eclipse.swt.graphics.Color;
+import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
+
+public class FigureHighlightEditPolicy extends GraphicalEditPolicy {
+
+ private Color revertColor;
+
+ public static Color highLightColor = GraphicsConstants.TB_BG_CORLOR;
+
+ public FigureHighlightEditPolicy() {
+ super();
+ }
+
+ /**
+ * @see org.eclipse.gef.EditPolicy#eraseTargetFeedback(org.eclipse.gef.Request)
+ */
+ public void eraseTargetFeedback(Request request) {
+ if (revertColor != null) {
+ unsetContainerBackgroud(revertColor);
+ revertColor = null;
+ }
+
+ }
+
+ private void unsetContainerBackgroud(Color c) {
+ IFigure figure = getContainerFigure();
+ if (figure instanceof IShowHighlighFigure) {
+ ((IShowHighlighFigure) figure).showbackOldbackgroundColor(c);
+ }
+ getContainerFigure().setBackgroundColor(c);
+ }
+
+ private Color getContainerBackground() {
+ return getContainerFigure().getBackgroundColor();
+ }
+
+ private IFigure getContainerFigure() {
+ return ((GraphicalEditPart) getHost()).getFigure();
+ }
+
+ /**
+ * @see org.eclipse.gef.EditPolicy#getTargetEditPart(org.eclipse.gef.Request)
+ */
+ public EditPart getTargetEditPart(Request request) {
+ return request.getType().equals(RequestConstants.REQ_SELECTION_HOVER) ? getHost() : null;
+ }
+
+ private void setContainerBackground(Color c) {
+ IFigure figure = getContainerFigure();
+ if (figure instanceof IShowHighlighFigure) {
+ ((IShowHighlighFigure) figure).showHighlightBackgroudColor(c);
+ }
+ getContainerFigure().setBackgroundColor(c);
+ }
+
+ /**
+ * Changes the background color of the container to the highlight color
+ */
+ protected void showHighlight() {
+ if (revertColor == null) {
+ revertColor = getContainerBackground();
+ setContainerBackground(highLightColor);
+ }
+ }
+
+ /**
+ * @see org.eclipse.gef.EditPolicy#showTargetFeedback(org.eclipse.gef.Request)
+ */
+ public void showTargetFeedback(Request request) {
+ if (request.getType().equals(RequestConstants.REQ_CREATE) || request.getType().equals(RequestConstants.REQ_ADD))
+ showHighlight();
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/FigureHighlightEditPolicy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/FigureSelectEditPolicy.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/FigureSelectEditPolicy.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/FigureSelectEditPolicy.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.gef.tree.editpolicy;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.jboss.tools.smooks.gef.tree.figures.ISelectableFigure;
+
+/**
+ * @author Dart (dpeng(a)redhat.com)
+ *
+ */
+public class FigureSelectEditPolicy extends NonResizableEditPolicy {
+
+ private ISelectableFigure getSelectableFigure() {
+ AbstractGraphicalEditPart host = (AbstractGraphicalEditPart) getHost();
+ IFigure figure = host.getFigure();
+ if (figure instanceof ISelectableFigure) {
+ return (ISelectableFigure) figure;
+ }
+ return null;
+ }
+
+ protected Rectangle getInitialFeedbackBounds() {
+// try {
+// if (((GraphicalEditPart) getHost()).getFigure() instanceof HandleBounds)
+// return ((HandleBounds) ((GraphicalEditPart) getHost()).getFigure()).getHandleBounds();
+// Rectangle rect = ((GraphicalEditPart) getHost()).getFigure().getBounds();
+// if (getTreeNodeFigure() != null) {
+// rect.height = getTreeNodeFigure().getLabel().getBounds().height;
+// }
+// return rect;
+// } catch (Exception e) {
+// e.printStackTrace();
+// }
+ return super.getInitialFeedbackBounds();
+ }
+
+ /**
+ * @see org.eclipse.gef.editpolicies.NonResizableEditPolicy#hideFocus()
+ */
+ protected void hideFocus() {
+ if (getSelectableFigure() != null) {
+ getSelectableFigure().setFocus(false);
+ }
+ }
+
+ /**
+ * @see org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy#hideSelection()
+ */
+ protected void hideSelection() {
+ if (getSelectableFigure() != null) {
+ getSelectableFigure().setSelected(false);
+ getSelectableFigure().setFocus(false);
+ }
+ }
+
+ /**
+ * @see org.eclipse.gef.editpolicies.NonResizableEditPolicy#showFocus()
+ */
+ protected void showFocus() {
+ if (getSelectableFigure() != null) {
+ getSelectableFigure().setFocus(true);
+ }
+ }
+
+ /**
+ * @see org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy#showSelection()
+ */
+ protected void showPrimarySelection() {
+ if (getSelectableFigure() != null) {
+ getSelectableFigure().setSelected(true);
+ getSelectableFigure().setFocus(true);
+ }
+ }
+
+ /**
+ * @see org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy#showSelection()
+ */
+ protected void showSelection() {
+ if (getSelectableFigure() != null) {
+ getSelectableFigure().setSelected(true);
+ getSelectableFigure().setFocus(false);
+ }
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/FigureSelectEditPolicy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/IShowHighlighFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/IShowHighlighFigure.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/IShowHighlighFigure.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.gef.tree.editpolicy;
+
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * @author Dart
+ *
+ */
+public interface IShowHighlighFigure {
+ void showHighlightBackgroudColor(Color color);
+
+ void showbackOldbackgroundColor(Color color);
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/IShowHighlighFigure.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/SmooksRootEditPartLayoutEditPolicy.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/SmooksRootEditPartLayoutEditPolicy.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/SmooksRootEditPartLayoutEditPolicy.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.gef.tree.editpolicy;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.gef.DefaultEditDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.ui.IEditorPart;
+import org.jboss.tools.smooks.editor.ISmooksModelProvider;
+import org.jboss.tools.smooks.gef.tree.command.GEFAdapterCommand;
+import org.jboss.tools.smooks.gef.tree.editparts.ChangeConstraintCommand;
+import org.jboss.tools.smooks.gef.tree.figures.IMoveableModel;
+import org.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart;
+import org.jboss.tools.smooks.graphical.editors.commands.DefaultSmooksCommandProvider;
+import org.jboss.tools.smooks.graphical.editors.commands.ISmooksCommandProvider;
+
+/**
+ * @author Dart
+ *
+ */
+public class SmooksRootEditPartLayoutEditPolicy extends LayoutEditPolicy {
+ private ISmooksCommandProvider commandProvider = null;
+
+ private GEFAdapterCommand createGEFCommand(EditingDomain domain, org.eclipse.emf.common.command.Command emfCommand,
+ final ISmooksModelProvider provider, Object collections, Object owner, Object feature,
+ IEditorPart editorPart) {
+ GEFAdapterCommand command = (GEFAdapterCommand) getCommandProvider().createSmooksCommand(domain, emfCommand,
+ provider, collections, owner, feature, editorPart);
+ return command;
+ }
+
+ /**
+ * @return the commandProvider
+ */
+ public ISmooksCommandProvider getCommandProvider() {
+ if (commandProvider == null) {
+ commandProvider = new DefaultSmooksCommandProvider();
+ }
+ return commandProvider;
+ }
+
+ @Override
+ protected Command getCreateCommand(CreateRequest request) {
+ Object model = request.getNewObject();
+ Object type = request.getNewObjectType();
+ GraphicalViewer viewer = (GraphicalViewer) ((GraphicalEditPart) getHost()).getViewer();
+ IEditorPart editorPart = ((DefaultEditDomain) viewer.getEditDomain()).getEditorPart();
+ if (editorPart instanceof SmooksGraphicalEditorPart) {
+ EObject owner = ((SmooksGraphicalEditorPart) editorPart).getSmooksResourceList();
+ EditingDomain domain = ((SmooksGraphicalEditorPart) editorPart).getEditingDomain();
+ if (model instanceof FeatureMap.Entry) {
+ EStructuralFeature type1 = ((FeatureMap.Entry) model).getEStructuralFeature();
+ model = ((FeatureMap.Entry) model).getValue();
+ model = EcoreUtil.copy((EObject) model);
+ model = FeatureMapUtil.createEntry(type1, model);
+ }
+ org.eclipse.emf.common.command.Command emfCommand = AddCommand.create(domain, owner, type, model);
+ final ISmooksModelProvider provider = (ISmooksModelProvider) ((SmooksGraphicalEditorPart) editorPart)
+ .getSmooksModelProvider();
+ if (emfCommand.canExecute()) {
+ GEFAdapterCommand command = createGEFCommand(domain, emfCommand, provider, model, owner, type,
+ editorPart);
+ if (command == null) {
+ return null;
+ }
+ command.setCollections(model);
+ command.setOwner(owner);
+ command.setFeature(type);
+ command.setX(request.getLocation().x);
+ command.setY(request.getLocation().y);
+ return command;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+
+ return new FigureSelectEditPolicy() {
+
+ @Override
+ protected Command getMoveCommand(ChangeBoundsRequest request) {
+ Object model = getHost().getModel();
+ if (request instanceof ChangeBoundsRequest && model instanceof IMoveableModel) {
+ Point delta = ((ChangeBoundsRequest) request).getMoveDelta();
+ Rectangle rect = ((IMoveableModel) model).getBounds();
+ rect.setLocation(rect.x + delta.x, rect.y + delta.y);
+ ChangeConstraintCommand command = new ChangeConstraintCommand((Rectangle) rect,
+ (IMoveableModel) model);
+ return command;
+ }
+ return null;
+ }
+
+ };
+ }
+
+ @Override
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/SmooksRootEditPartLayoutEditPolicy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/TreeNodeGraphicalNodeEditPolicy.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/TreeNodeGraphicalNodeEditPolicy.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/TreeNodeGraphicalNodeEditPolicy.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -3,11 +3,16 @@
*/
package org.jboss.tools.smooks.gef.tree.editpolicy;
+import org.eclipse.draw2d.IFigure;
import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy;
import org.eclipse.gef.requests.CreateConnectionRequest;
import org.eclipse.gef.requests.ReconnectRequest;
+import org.eclipse.swt.graphics.Color;
+import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
import org.jboss.tools.smooks.gef.tree.editparts.CreateConnectionCommand;
import org.jboss.tools.smooks.gef.tree.editparts.TreeNodeEditPart;
@@ -18,6 +23,9 @@
*/
public class TreeNodeGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
+ private Color revertColor;
+ private static Color highLightColor = GraphicsConstants.TB_BG_CORLOR;
+
/*
* (non-Javadoc)
*
@@ -27,21 +35,25 @@
*/
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
- Command command = request.getStartCommand();
- if (command != null && command instanceof CreateConnectionCommand) {
- Object targetModel = request.getTargetEditPart().getModel();
- if (targetModel instanceof AbstractSmooksGraphicalModel) {
- if (!((AbstractSmooksGraphicalModel) targetModel).canLinkWithSource(((CreateConnectionCommand) command)
- .getSource()))
- return null;
- Object source = ((CreateConnectionCommand) command).getSource();
- if (source instanceof AbstractSmooksGraphicalModel) {
- if (!((AbstractSmooksGraphicalModel) source).canLinkWithTarget(targetModel))
+ try {
+ Command command = request.getStartCommand();
+ if (command != null && command instanceof CreateConnectionCommand) {
+ Object targetModel = request.getTargetEditPart().getModel();
+ if (targetModel instanceof AbstractSmooksGraphicalModel) {
+ if (!((AbstractSmooksGraphicalModel) targetModel)
+ .canLinkWithSource(((CreateConnectionCommand) command).getSource()))
return null;
+ Object source = ((CreateConnectionCommand) command).getSource();
+ if (source instanceof AbstractSmooksGraphicalModel) {
+ if (!((AbstractSmooksGraphicalModel) source).canLinkWithTarget(targetModel))
+ return null;
+ }
+ ((CreateConnectionCommand) command).setTarget((AbstractSmooksGraphicalModel) targetModel);
+ return command;
}
- ((CreateConnectionCommand) command).setTarget((AbstractSmooksGraphicalModel) targetModel);
- return command;
}
+ } catch (Exception e) {
+ e.printStackTrace();
}
return null;
}
@@ -109,4 +121,71 @@
return null;
}
+ /**
+ * @see org.eclipse.gef.EditPolicy#eraseTargetFeedback(org.eclipse.gef.Request)
+ */
+ public void eraseTargetFeedback(Request request) {
+ super.eraseTargetFeedback(request);
+ if (revertColor != null) {
+ unsetContainerBackgroud(revertColor);
+ revertColor = null;
+ }
+ }
+
+ private void unsetContainerBackgroud(Color c) {
+ IFigure figure = getContainerFigure();
+ if (figure instanceof IShowHighlighFigure) {
+ ((IShowHighlighFigure) figure).showbackOldbackgroundColor(c);
+ }
+ getContainerFigure().setBackgroundColor(c);
+ }
+
+ private Color getContainerBackground() {
+ return getContainerFigure().getBackgroundColor();
+ }
+
+ private IFigure getContainerFigure() {
+ return ((GraphicalEditPart) getHost()).getFigure();
+ }
+
+ /**
+ * @see org.eclipse.gef.EditPolicy#getTargetEditPart(org.eclipse.gef.Request)
+ */
+ public EditPart getTargetEditPart(Request request) {
+ // if (true) {
+ return super.getTargetEditPart(request);
+ // }
+ // return request.getType().equals(RequestConstants.REQ_SELECTION_HOVER)
+ // ? getHost() : null;
+ }
+
+ private void setContainerBackground(Color c) {
+ IFigure figure = getContainerFigure();
+ if (figure instanceof IShowHighlighFigure) {
+ ((IShowHighlighFigure) figure).showHighlightBackgroudColor(c);
+ }
+ getContainerFigure().setBackgroundColor(c);
+ }
+
+ /**
+ * Changes the background color of the container to the highlight color
+ */
+ protected void showHighlight() {
+ if (revertColor == null) {
+ revertColor = getContainerBackground();
+ setContainerBackground(highLightColor);
+ }
+ }
+
+ /**
+ * @see org.eclipse.gef.EditPolicy#showTargetFeedback(org.eclipse.gef.Request)
+ */
+ public void showTargetFeedback(Request request) {
+ super.showTargetFeedback(request);
+ if (REQ_CONNECTION_START.equals(request.getType()) || REQ_CONNECTION_END.equals(request.getType())
+ || REQ_RECONNECT_SOURCE.equals(request.getType()) || REQ_RECONNECT_TARGET.equals(request.getType())) {
+ showHighlight();
+ }
+ }
+
}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/ISelectableFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/ISelectableFigure.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/ISelectableFigure.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.gef.tree.figures;
+
+/**
+ * @author Dart
+ *
+ */
+public interface ISelectableFigure {
+ void setSelected(boolean selected);
+
+ boolean isSelected();
+
+ void setFocus(boolean focus);
+
+ boolean isFocus();
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/ISelectableFigure.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/TreeContainerFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/TreeContainerFigure.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/TreeContainerFigure.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -5,6 +5,7 @@
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FigureUtilities;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
@@ -13,13 +14,15 @@
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
+import org.jboss.tools.smooks.gef.tree.editpolicy.IShowHighlighFigure;
import org.jboss.tools.smooks.gef.tree.model.TreeContainerModel;
/**
* @author DartPeng
*
*/
-public class TreeContainerFigure extends Figure {
+public class TreeContainerFigure extends Figure implements ISelectableFigure, IShowHighlighFigure {
private IFigure headerFigure;
@@ -31,13 +34,23 @@
private Color headerColor = ColorConstants.button;
+ protected Color headerSelectedColor = GraphicsConstants.TB_BG_CORLOR;
+
+ private boolean focus;
+
+ private boolean selected;
+
+ private Color highlightColor = null;
+
+ private boolean showHightlight = false;
+
public TreeContainerFigure(TreeContainerModel model) {
super();
this.model = model;
this.addChildrenFigures();
}
-
- protected void addChildrenFigures(){
+
+ protected void addChildrenFigures() {
headerFigure = new Figure() {
@Override
@@ -70,13 +83,25 @@
}
protected void drawHeaderFigure(Graphics graphics) {
- graphics.pushState();
- graphics.setForegroundColor(headerColor);
- graphics.setBackgroundColor(ColorConstants.white);
- graphics.fillGradient(headerFigure.getBounds().expand(20, 0), true);
- graphics.setForegroundColor(headerColor);
- graphics.drawLine(getBounds().getBottomLeft().translate(0, -1), getBounds().getBottomRight().translate(0, -1));
- graphics.popState();
+ try {
+ graphics.pushState();
+ Color currentColor = headerColor;
+ if (isSelected() || isFocus()) {
+ currentColor = headerSelectedColor;
+ }
+ if (showHightlight && highlightColor != null) {
+ currentColor = highlightColor;
+ }
+ graphics.setForegroundColor(currentColor);
+ graphics.setBackgroundColor(ColorConstants.white);
+ graphics.fillGradient(headerFigure.getBounds().expand(30, 0), true);
+ graphics.setForegroundColor(currentColor);
+ graphics.drawLine(getBounds().getBottomLeft().translate(0, -1), getBounds().getBottomRight().translate(0,
+ -1));
+ graphics.popState();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
/**
@@ -117,10 +142,21 @@
@Override
protected void paintBorder(Graphics graphics) {
- graphics.setForegroundColor(ColorConstants.buttonDarker);
- Rectangle drawnRectangle = new Rectangle(getBounds().x, getBounds().y, getBounds().width - 1,
- getBounds().height - 1);
- graphics.drawRoundRectangle(drawnRectangle, 5, 5);
+ try {
+ graphics.setForegroundColor(ColorConstants.buttonDarkest);
+ if (isSelected() || isFocus()) {
+ graphics.setForegroundColor(GraphicsConstants.BORDER_CORLOR);
+ }
+
+ if (showHightlight && highlightColor != null) {
+ graphics.setForegroundColor(FigureUtilities.darker(highlightColor));
+ }
+ Rectangle drawnRectangle = new Rectangle(getBounds().x, getBounds().y, getBounds().width - 1,
+ getBounds().height - 1);
+ graphics.drawRoundRectangle(drawnRectangle, 5, 5);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
public void setText(String text) {
@@ -152,4 +188,72 @@
label.setIcon(i);
}
}
+
+ /**
+ * @return the headerFigure
+ */
+ public IFigure getHeaderFigure() {
+ return headerFigure;
+ }
+
+ /**
+ * @param headerFigure
+ * the headerFigure to set
+ */
+ public void setHeaderFigure(IFigure headerFigure) {
+ this.headerFigure = headerFigure;
+ }
+
+ /**
+ * @return the focus
+ */
+ public boolean isFocus() {
+ return focus;
+ }
+
+ /**
+ * @param focus
+ * the focus to set
+ */
+ public void setFocus(boolean focus) {
+ this.focus = focus;
+ }
+
+ /**
+ * @return the selected
+ */
+ public boolean isSelected() {
+ return selected;
+ }
+
+ /**
+ * @param selected
+ * the selected to set
+ */
+ public void setSelected(boolean selected) {
+ this.selected = selected;
+ repaint();
+ }
+
+ /**
+ * @param contentFigure
+ * the contentFigure to set
+ */
+ public void setContentFigure(IFigure contentFigure) {
+ this.contentFigure = contentFigure;
+ repaint();
+ }
+
+ public void showbackOldbackgroundColor(Color color) {
+ showHightlight = false;
+ highlightColor = null;
+ repaint();
+ }
+
+ public void showHighlightBackgroudColor(Color color) {
+ showHightlight = true;
+ highlightColor = color;
+ repaint();
+ }
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/TreeNodeFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/TreeNodeFigure.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/TreeNodeFigure.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -25,14 +25,17 @@
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
+import org.jboss.tools.smooks.gef.tree.editpolicy.IShowHighlighFigure;
import org.jboss.tools.smooks.gef.tree.model.TreeNodeModel;
/**
* @author DartPeng
*
*/
-public class TreeNodeFigure extends Figure {
+public class TreeNodeFigure extends Figure implements ISelectableFigure, IShowHighlighFigure {
private List<ITreeFigureListener> treeListener = new ArrayList<ITreeFigureListener>();
private final int SPACE_INT = 14;
@@ -61,6 +64,8 @@
private Image labelImage = null;
+ private boolean showHighlight;
+
public TreeNodeFigure(TreeNodeModel model) {
super();
this.model = model;
@@ -271,7 +276,8 @@
}
/**
- * @param labelImage the labelImage to set
+ * @param labelImage
+ * the labelImage to set
*/
public void setLabelImage(Image labelImage) {
this.labelImage = labelImage;
@@ -282,17 +288,11 @@
}
public void paint(Graphics graphics) {
- if (isFocus()) {
- label.setForegroundColor(ColorConstants.blue);
- } else {
- label.setForegroundColor(ColorConstants.black);
+ label.setForegroundColor(ColorConstants.black);
+ if (isFocus() || isSelected() || showHighlight) {
+ label.setForegroundColor(GraphicsConstants.FONT_COLOR);
}
- if (isSelected()) {
- label.setForegroundColor(ColorConstants.lightBlue);
- } else {
- label.setForegroundColor(ColorConstants.black);
- }
super.paint(graphics);
}
@@ -385,4 +385,14 @@
e.printStackTrace();
}
}
+
+ public void showHighlightBackgroudColor(Color color) {
+ showHighlight = true;
+ repaint();
+ }
+
+ public void showbackOldbackgroundColor(Color color) {
+ showHighlight = false;
+ repaint();
+ }
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPaletteRootCreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPaletteRootCreator.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPaletteRootCreator.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -34,8 +34,10 @@
import org.eclipse.gef.palette.SelectionToolEntry;
import org.eclipse.gef.requests.CreationFactory;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
+import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
import org.jboss.tools.smooks.configuration.editors.actions.ISmooksActionGrouper;
-import org.jboss.tools.smooks.configuration.editors.actions.JavaBean11ActionGrouper;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
import org.jboss.tools.smooks.editor.ISmooksModelProvider;
import org.jboss.tools.smooks.gef.tree.model.TriggerConnection;
@@ -78,7 +80,10 @@
return null;
}
};
- drawer.add(new ConnectionCreationToolEntry("Link", "Connect node", factory, null, null));
+ ImageRegistry imageRegistry = SmooksConfigurationActivator.getDefault().getImageRegistry();
+ drawer.add(new ConnectionCreationToolEntry("Link", "Connect node", factory, imageRegistry
+ .getDescriptor(GraphicsConstants.IMAGE_LINK16), imageRegistry
+ .getDescriptor(GraphicsConstants.IMAGE_LINK16)));
root.add(drawer);
createPaletteDrawer(root);
@@ -101,7 +106,7 @@
PaletteDrawer drawer = new PaletteDrawer(iSmooksActionGrouper.getGroupName());
fillDrawer(drawer, newChildrenDescripter, iSmooksActionGrouper);
root.add(drawer);
-
+
}
}
}
@@ -222,9 +227,9 @@
}
return false;
}
-
- protected void fillActionGrouper(List<ISmooksActionGrouper> grouperList){
-
+
+ protected void fillActionGrouper(List<ISmooksActionGrouper> grouperList) {
+
}
protected List<ISmooksActionGrouper> getSmooksActionGrouper() {
@@ -236,7 +241,7 @@
// grouperList.add(new Datasources11ActionGrouper());
// grouperList.add(new FragmentRouting11ActionGrouper());
// grouperList.add(new Scripting11ActionGrouper());
-// grouperList.add(new Templating11ActionGrouper());
+ // grouperList.add(new Templating11ActionGrouper());
// grouperList.add(new PersistenceActionGrouper());
// grouperList.add(new Validation10ActionGrouper());
return grouperList;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -644,8 +644,8 @@
SmooksJavaMappingGraphicalEditor javaMappingPart = new SmooksJavaMappingGraphicalEditor(smooksModelProvider);
this.registeTaskDetailsPage(javaMappingPart, TaskTypeManager.TASK_ID_JAVA_MAPPING);
- SmooksXSLTemplateGraphicalEditor xsltemplatePart = new SmooksXSLTemplateGraphicalEditor(smooksModelProvider);
- this.registeTaskDetailsPage(xsltemplatePart, TaskTypeManager.TASK_ID_XSL_TEMPLATE);
+// SmooksXSLTemplateGraphicalEditor xsltemplatePart = new SmooksXSLTemplateGraphicalEditor(smooksModelProvider);
+// this.registeTaskDetailsPage(xsltemplatePart, TaskTypeManager.TASK_ID_XSL_TEMPLATE);
ProcessAnalyzer processAnalyzer = new ProcessAnalyzer();
EObject smooksModel = getSmooksResourceList();
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksXSLTemplateGraphicalEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksXSLTemplateGraphicalEditor.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksXSLTemplateGraphicalEditor.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -22,6 +22,9 @@
import org.jboss.tools.smooks.editor.ISmooksModelProvider;
import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
import org.jboss.tools.smooks.gef.tree.model.TreeContainerModel;
+import org.jboss.tools.smooks.graphical.actions.xsltemplate.XSLActionCreator;
+import org.jboss.tools.smooks.graphical.editors.editparts.IAutoLayout;
+import org.jboss.tools.smooks.graphical.editors.editparts.XSLMappingAutoLayout;
import org.jboss.tools.smooks.graphical.editors.model.XSLTemplateContentProvider;
import org.jboss.tools.smooks.graphical.editors.model.XSLTemplateGraphicalModel;
import org.jboss.tools.smooks.model.xsl.Xsl;
@@ -31,13 +34,42 @@
*
*/
public class SmooksXSLTemplateGraphicalEditor extends SmooksGraphicalEditorPart {
+
+ private XSLMappingAutoLayout autoLayout = null;
public SmooksXSLTemplateGraphicalEditor(ISmooksModelProvider provider) {
super(provider);
// TODO Auto-generated constructor stub
}
+
+
/* (non-Javadoc)
+ * @see org.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#getAutoLayout()
+ */
+ @Override
+ public IAutoLayout getAutoLayout() {
+ if(autoLayout == null){
+ autoLayout = new XSLMappingAutoLayout();
+ }
+ return autoLayout;
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#createActions()
+ */
+ @Override
+ protected void createActions() {
+ super.createActions();
+ XSLActionCreator creator = new XSLActionCreator();
+ creator.registXSLActions(getActionRegistry(), getSelectionActions(), this);
+ }
+
+
+
+ /* (non-Javadoc)
* @see org.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#getPaletteRoot()
*/
@Override
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/TaskTypeManager.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/TaskTypeManager.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/TaskTypeManager.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -61,6 +61,8 @@
GraphicsConstants.IMAGE_JAVA_AMPPING_TASK));
allTaskList.add(new TaskTypeDescriptor(TASK_ID_FREEMARKER_TEMPLATE, "Apply Freemaker Template",
GraphicsConstants.IMAGE_APPLY_FREEMARKER_TASK));
+// allTaskList.add(new TaskTypeDescriptor(TASK_ID_XSL_TEMPLATE, "Apply XSL Template",
+// GraphicsConstants.IMAGE_APPLY_XSL_TASK));
}
return allTaskList;
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/AbstractResourceConfigEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/AbstractResourceConfigEditPart.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/AbstractResourceConfigEditPart.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -117,7 +117,6 @@
*/
@Override
protected Command createAddCommand(EditPart child, EditPart after) {
- // TODO Auto-generated method stub
return null;
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/InputDataContainerEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/InputDataContainerEditPart.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/InputDataContainerEditPart.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -14,6 +14,7 @@
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FigureUtilities;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
@@ -110,7 +111,11 @@
@Override
protected void paintBorder(Graphics graphics) {
// super.paintBorder(graphics);
- graphics.setForegroundColor(ColorConstants.black);
+ if (isSelected() || isFocus()) {
+ graphics.setForegroundColor(GraphicsConstants.BORDER_CORLOR);
+ } else {
+ graphics.setForegroundColor(ColorConstants.black);
+ }
Point p2 = new Point();
p2.setLocation(getBounds().getTopLeft().x, getBounds().getTopLeft().y);
@@ -129,7 +134,7 @@
graphics.drawLine(p4, p3);
Point p5 = new Point();
- p5.setLocation(getBounds().getTopRight().x - 1, getBounds().getTopRight().y + zwidth);
+ p5.setLocation(getBounds().getTopRight().x - 1, getBounds().getTopRight().y + zwidth - 1);
graphics.drawLine(p4, p5);
graphics.drawLine(p1, p5);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksRootEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksRootEditPart.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksRootEditPart.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -10,27 +10,12 @@
******************************************************************************/
package org.jboss.tools.smooks.graphical.editors.editparts;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.util.FeatureMap;
-import org.eclipse.emf.ecore.util.FeatureMapUtil;
-import org.eclipse.emf.edit.command.AddCommand;
-import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.gef.DefaultEditDomain;
import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.CreateRequest;
import org.eclipse.ui.IEditorPart;
-import org.jboss.tools.smooks.editor.ISmooksModelProvider;
-import org.jboss.tools.smooks.gef.tree.command.GEFAdapterCommand;
import org.jboss.tools.smooks.gef.tree.editparts.RootEditPart;
-import org.jboss.tools.smooks.gef.tree.editpolicy.RootPanelXYLayoutEditPolicy;
-import org.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart;
-import org.jboss.tools.smooks.graphical.editors.commands.DefaultSmooksCommandProvider;
-import org.jboss.tools.smooks.graphical.editors.commands.ISmooksCommandProvider;
+import org.jboss.tools.smooks.gef.tree.editpolicy.SmooksRootEditPartLayoutEditPolicy;
/**
* @author Dart
@@ -42,26 +27,6 @@
public static final int BINDINGS_TYPE = 1;
- private ISmooksCommandProvider commandProvider = null;
-
- private GEFAdapterCommand createGEFCommand(EditingDomain domain, org.eclipse.emf.common.command.Command emfCommand,
- final ISmooksModelProvider provider, Object collections, Object owner, Object feature,
- IEditorPart editorPart) {
- GEFAdapterCommand command = (GEFAdapterCommand) getCommandProvider().createSmooksCommand(domain, emfCommand,
- provider, collections, owner, feature, editorPart);
- return command;
- }
-
- /**
- * @return the commandProvider
- */
- public ISmooksCommandProvider getCommandProvider() {
- if (commandProvider == null) {
- commandProvider = new DefaultSmooksCommandProvider();
- }
- return commandProvider;
- }
-
/*
* (non-Javadoc)
*
@@ -69,44 +34,7 @@
*/
@Override
protected void createEditPolicies() {
- this.installEditPolicy(EditPolicy.LAYOUT_ROLE, new RootPanelXYLayoutEditPolicy() {
-
- @Override
- protected Command getCreateCommand(CreateRequest request) {
- Object model = request.getNewObject();
- Object type = request.getNewObjectType();
- GraphicalViewer viewer = (GraphicalViewer) ((GraphicalEditPart) getHost()).getViewer();
- IEditorPart editorPart = ((DefaultEditDomain) viewer.getEditDomain()).getEditorPart();
- if (editorPart instanceof SmooksGraphicalEditorPart) {
- EObject owner = ((SmooksGraphicalEditorPart) editorPart).getSmooksResourceList();
- EditingDomain domain = ((SmooksGraphicalEditorPart) editorPart).getEditingDomain();
- if (model instanceof FeatureMap.Entry) {
- EStructuralFeature type1 = ((FeatureMap.Entry) model).getEStructuralFeature();
- model = ((FeatureMap.Entry) model).getValue();
- model = EcoreUtil.copy((EObject) model);
- model = FeatureMapUtil.createEntry(type1, model);
- }
- org.eclipse.emf.common.command.Command emfCommand = AddCommand.create(domain, owner, type, model);
- final ISmooksModelProvider provider = (ISmooksModelProvider) ((SmooksGraphicalEditorPart) editorPart)
- .getSmooksModelProvider();
- if (emfCommand.canExecute()) {
- GEFAdapterCommand command = createGEFCommand(domain, emfCommand, provider, model, owner, type,
- editorPart);
- if (command == null) {
- return null;
- }
- command.setCollections(model);
- command.setOwner(owner);
- command.setFeature(type);
- command.setX(request.getLocation().x);
- command.setY(request.getLocation().y);
- return command;
- }
- }
- return null;
- }
-
- });
+ this.installEditPolicy(EditPolicy.LAYOUT_ROLE, new SmooksRootEditPartLayoutEditPolicy());
}
protected IEditorPart getEditorPart() {
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/XSLMappingAutoLayout.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/XSLMappingAutoLayout.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/XSLMappingAutoLayout.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.graphical.editors.editparts;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.graph.DirectedGraph;
+import org.eclipse.draw2d.graph.Node;
+import org.eclipse.draw2d.graph.NodeList;
+
+/**
+ * @author Dart
+ *
+ */
+public class XSLMappingAutoLayout implements IAutoLayout{
+
+ private int INPUT_JAVA_WIDTH = 200;
+
+ private int SPACE_XSL = 20;
+
+ private int INIT_X = 50;
+
+ private int INIT_Y = 50;
+
+ public void visit(DirectedGraph graph){
+ NodeList nodeList = graph.nodes;
+ // place the java-mapping nodes;
+ int javaHeight = 0;
+ Node inputNode = null;
+ int java_y = INIT_Y;
+ List<Node> javaNodes = new ArrayList<Node>();
+ for (Iterator<?> iterator = nodeList.iterator(); iterator.hasNext();) {
+ Node node = (Node) iterator.next();
+ Object data = node.data;
+ if(data instanceof XSLTemplateEditPart){
+ javaHeight = javaHeight + SPACE_XSL + node.height;
+ node.y = java_y;
+ java_y = java_y + SPACE_XSL + node.height;
+ javaNodes.add(node);
+ }
+ if(data instanceof InputDataContainerEditPart){
+ inputNode = node;
+ }
+ }
+ javaHeight = javaHeight - INIT_Y;
+ int java_x = INIT_X;
+ if(inputNode != null){
+ inputNode.x = INIT_X;
+ int input_y = INIT_Y;
+ if(javaHeight > inputNode.height){
+ int cha = (javaHeight - inputNode.height)/2;
+ input_y = cha;
+ }
+ inputNode.y = input_y;
+ java_x = inputNode.x + inputNode.width + INPUT_JAVA_WIDTH;
+ }
+
+ for (Iterator<?> iterator = javaNodes.iterator(); iterator.hasNext();) {
+ Node node = (Node) iterator.next();
+ node.x = java_x;
+ }
+
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/XSLMappingAutoLayout.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/InputDataTreeNodeModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/InputDataTreeNodeModel.java 2009-11-03 20:16:23 UTC (rev 18401)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/InputDataTreeNodeModel.java 2009-11-04 03:11:34 UTC (rev 18402)
@@ -15,6 +15,9 @@
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
+import org.jboss.tools.smooks.configuration.editors.xml.TagPropertyObject;
+import org.jboss.tools.smooks.configuration.editors.xml.XSLModelAnalyzer;
+import org.jboss.tools.smooks.configuration.editors.xml.XSLTagObject;
import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
import org.jboss.tools.smooks.gef.tree.model.TreeNodeModel;
@@ -68,9 +71,24 @@
*/
@Override
public boolean canLinkWithTarget(Object model) {
- Object data = ((AbstractSmooksGraphicalModel)model).getData();
+ Object data = ((AbstractSmooksGraphicalModel) model).getData();
data = AdapterFactoryEditingDomain.unwrap(data);
- if (SmooksUIUtils.getSelectorFeature((EObject)data) != null) {
+ if (data instanceof EObject) {
+ if (SmooksUIUtils.getSelectorFeature((EObject) data) != null) {
+ return true;
+ }
+ }
+ if (data instanceof XSLTagObject) {
+ if (XSLModelAnalyzer.isXSLTagObject((XSLTagObject) data)) {
+ if (((XSLTagObject) data).isForeachElement() || ((XSLTagObject) data).isTemplateElement()
+ || ((XSLTagObject) data).isSortElement()) {
+ return true;
+ }
+ } else {
+ return true;
+ }
+ }
+ if (data instanceof TagPropertyObject) {
return true;
}
return false;
15 years, 1 month
JBoss Tools SVN: r18401 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core: jbosscore/org/jboss/ide/eclipse/as/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-11-03 15:16:23 -0500 (Tue, 03 Nov 2009)
New Revision: 18401
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBoss4xEarFacetInstallListener.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java
Log:
JBIDE-5018 - found a solution =D
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2009-11-03 18:06:18 UTC (rev 18400)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2009-11-03 20:16:23 UTC (rev 18401)
@@ -14,9 +14,13 @@
org.eclipse.jst.j2ee,
org.eclipse.wst.xml.core,
org.apache.ant,
- org.jboss.tools.jmx.core;bundle-version="0.2.1",
- org.eclipse.core.variables;bundle-version="3.2.200",
- org.jboss.ide.eclipse.as.wtp.core;bundle-version="1.0.0"
+ org.jboss.tools.jmx.core,
+ org.eclipse.core.variables,
+ org.jboss.ide.eclipse.as.wtp.core,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.wst.common.frameworks,
+ org.eclipse.jst.jee,
+ org.eclipse.core.commands
Bundle-ActivationPolicy: lazy
Export-Package: org.jboss.ide.eclipse.as.core,
org.jboss.ide.eclipse.as.core.extensions.descriptors,
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBoss4xEarFacetInstallListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBoss4xEarFacetInstallListener.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBoss4xEarFacetInstallListener.java 2009-11-03 20:16:23 UTC (rev 18401)
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.core;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jst.jee.project.facet.EarCreateDeploymentFilesDataModelProvider;
+import org.eclipse.jst.jee.project.facet.ICreateDeploymentFilesDataModelProperties;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
+import org.eclipse.wst.common.project.facet.core.events.IProjectFacetActionEvent;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.core.util.IWTPConstants;
+
+import static org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants.AS_42;
+import static org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants.EAP_43;
+
+/**
+ * This class is here to deal with the case when a new Ear project is
+ * created but targeted to a JBoss 4.x server. JBoss 4.x servers require
+ * application.xml files in their structure to be deployable.
+ *
+ * @author rob.stryker(a)jboss.com
+ */
+public class JBoss4xEarFacetInstallListener implements IFacetedProjectListener {
+
+ private static JBoss4xEarFacetInstallListener instance;
+ public static JBoss4xEarFacetInstallListener getDefault() {
+ if( instance == null )
+ instance = new JBoss4xEarFacetInstallListener();
+ return instance;
+ }
+
+ JBoss4xEarFacetInstallListener() {
+ // Do nothing
+ }
+
+ public void handleEvent(IFacetedProjectEvent event) {
+ IProjectFacetActionEvent e = (IProjectFacetActionEvent)event;
+ IProjectFacet pf = e.getProjectFacet();
+ if( pf.getId().equals(IWTPConstants.FACET_EAR)) {
+ String rtName = e.getProject().getPrimaryRuntime().getName();
+ IRuntime rt = ServerCore.findRuntime(rtName);
+ if( rt != null ) {
+ String type = rt.getRuntimeType().getId();
+ if( type.equals(AS_42) || type.equals(EAP_43)) {
+ // Launch the op to create the ear application.xml file
+ IVirtualComponent vc = ComponentCore.createComponent(e.getProject().getProject());
+ IDataModel model = DataModelFactory.createDataModel(new EarCreateDeploymentFilesDataModelProvider());
+ model.setProperty(ICreateDeploymentFilesDataModelProperties.GENERATE_DD, vc);
+ model.setProperty(ICreateDeploymentFilesDataModelProperties.TARGET_PROJECT, e.getProject().getProject());
+ IDataModelOperation op = model.getDefaultOperation();
+ try {
+ op.execute(new NullProgressMonitor(), null);
+ } catch (ExecutionException e1) {
+ // Ignore
+ }
+ }
+ }
+ }
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2009-11-03 18:06:18 UTC (rev 18400)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2009-11-03 20:16:23 UTC (rev 18401)
@@ -10,14 +10,15 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core;
-import java.util.ResourceBundle;
-
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
+import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListenerManager;
@@ -59,6 +60,7 @@
UnitedServerListenerManager.getDefault();
UnitedServerListenerManager.getDefault().addListener(XPathModel.getDefault());
UnitedServerListenerManager.getDefault().addListener(ServerListener.getDefault());
+ FacetedProjectFramework.addListener( JBoss4xEarFacetInstallListener.getDefault(), IFacetedProjectEvent.Type.POST_INSTALL);
}
/**
@@ -68,6 +70,7 @@
super.stop(context);
UnitedServerListenerManager.getDefault().removeListener(ServerListener.getDefault());
UnitedServerListenerManager.getDefault().removeListener(XPathModel.getDefault());
+ FacetedProjectFramework.removeListener(JBoss4xEarFacetInstallListener.getDefault());
}
/**
15 years, 1 month
JBoss Tools SVN: r18400 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-11-03 13:06:18 -0500 (Tue, 03 Nov 2009)
New Revision: 18400
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5133
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2009-11-03 17:00:49 UTC (rev 18399)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2009-11-03 18:06:18 UTC (rev 18400)
@@ -126,9 +126,7 @@
List<TextProposal> completions = new ArrayList<TextProposal>();
ELResolutionImpl status = resolveELOperand(file, parseOperand("" + prefix), returnEqualedVariablesOnly, bundles); //$NON-NLS-1$
- if (status.isResolved()) {
- completions.addAll(status.getProposals());
- }
+ completions.addAll(status.getProposals());
return completions;
}
15 years, 1 month
JBoss Tools SVN: r18399 - trunk/seam/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2009-11-03 12:00:49 -0500 (Tue, 03 Nov 2009)
New Revision: 18399
Modified:
trunk/seam/docs/reference/en/modules/creating_new_seam.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-906 Demos update. Update corresponding guides: Seam Reference Guide updated the same way as the seam new project demo
Modified: trunk/seam/docs/reference/en/modules/creating_new_seam.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/creating_new_seam.xml 2009-11-03 17:00:05 UTC (rev 18398)
+++ trunk/seam/docs/reference/en/modules/creating_new_seam.xml 2009-11-03 17:00:49 UTC (rev 18399)
@@ -10,13 +10,12 @@
</chapterinfo>
<title>Creating a New Seam Project via the New Seam Project wizard</title>
<para>In this chapter we provide you with the necessary steps to start working with Seam
- Framework.</para>
-
+ Framework.</para>
<para>At first, we suggest setting the specific Seam perspective that combines a number of
- different views and editors needed for work with resources concerned. For that select <emphasis>
+ different views and editors needed for work with resources concerned. For that select
+ <emphasis>
<property>Window > Open Perspective > Other > Seam</property>
</emphasis> or you can also access it through the button in the right top corner.</para>
-
<figure>
<title>Seam Perspective Icon</title>
<mediaobject>
@@ -25,10 +24,9 @@
</imageobject>
</mediaobject>
</figure>
-
<para>Also the <emphasis>
- <property>Open Web Browser</property></emphasis> action is directly available in the <property>Seam perspective</property>.</para>
-
+ <property>Open Web Browser</property></emphasis> action is directly available in the
+ <property>Seam perspective</property>.</para>
<figure>
<title>Embedded Web Browser Button</title>
<mediaobject>
@@ -37,7 +35,6 @@
</imageobject>
</mediaobject>
</figure>
-
<section id="standaloneSeam" role="updated">
<title>Create standalone Seam Web Project</title>
<para>The best way to get started with Seam is to organise a simple Seam Project and
@@ -50,9 +47,8 @@
<para>Seam Web Project wizard has an option for selecting the actual Server (not just WTP
runtime) that will be used for the project. This allows the wizard to identify correctly
where the required datasource and driver libraries need to go.</para>
- <para>Let's get through the wizard step-by-step. First, you should enter a name and
- a location directory for your new project.</para>
-
+ <para>Let's get through the wizard step-by-step. First, you should enter a name and a
+ location directory for your new project.</para>
<figure id="figure_create_seam1">
<title>New Seam Project Wizard</title>
<mediaobject>
@@ -61,9 +57,7 @@
</imageobject>
</mediaobject>
</figure>
-
<para>On the figure above you can see the runtime and the server already created.</para>
-
<para>If you need to create a new runtime, click on the <emphasis>
<property>New...</property>
</emphasis> button in the <property>Target Runtime</property> section. It brings up the
@@ -72,7 +66,6 @@
Runtime. Hence, after choosing it click on <emphasis>
<property>Next</property>
</emphasis> button.</para>
-
<figure>
<title>Specifying Target Runtime</title>
<mediaobject>
@@ -81,13 +74,11 @@
</imageobject>
</mediaobject>
</figure>
-
<para>All what you need here is to name runtime, type the path to its install directory or
locate it by using <emphasis>
<property>Browse</property>
</emphasis> button, select a Java Runtime Environment, and select which configuration
you want.</para>
-
<figure>
<title>Specifying Target Runtime Configurations</title>
<mediaobject>
@@ -96,24 +87,19 @@
</imageobject>
</mediaobject>
</figure>
-
<para> Clicking on <emphasis>
<property>Finish</property>
</emphasis> returns you to the <link linkend="figure_create_seam1">New Seam Project
- wizard page</link>.</para>
-
- <para>The next step is to define a Server that you can do by clicking
- on <emphasis>
+ wizard page</link>.</para>
+ <para>The next step is to define a Server that you can do by clicking on <emphasis>
<property>New...</property>
</emphasis> button in the <property>Target Server</property> section. In appeared
<property>New Server dialog</property> the last server which matches the runtime
will be selected.</para>
-
<para>All declared runtimes are listed in the combo box under the servers view. Here, you
can indicate a server runtime that you need. Click <emphasis>
<property>Add</property>
</emphasis> if you want to add a new Server Runtime.</para>
-
<figure>
<title>Specifying Target Server</title>
<mediaobject>
@@ -122,12 +108,10 @@
</imageobject>
</mediaobject>
</figure>
-
<para>Next page allows you to verify the information for chosen server. Leave everything as
it is and click on <emphasis>
<property>Next</property>
</emphasis>.</para>
-
<figure>
<title>JBoss Runtime Summary</title>
<mediaobject>
@@ -136,10 +120,8 @@
</imageobject>
</mediaobject>
</figure>
-
<para>On the last wizard step you can modify your projects to configure them on the
Server.</para>
-
<figure>
<title>Project Modification for Configuring on the Server</title>
<mediaobject>
@@ -148,19 +130,15 @@
</imageobject>
</mediaobject>
</figure>
-
-
<para>Once you have the Target Server defined click on <emphasis>
<property>Finish</property>
</emphasis> button to return to the first page of the <property>New Seam Project
wizard</property>.</para>
-
<tip>
<title>Tip:</title>
<para>We suggest that you look through our <ulink url="&aslink;">AS manager
guide</ulink> to find out more about runtimes and servers.</para>
</tip>
-
<figure>
<title>Completion of Runtime and Server Configuration</title>
<mediaobject>
@@ -169,7 +147,6 @@
</imageobject>
</mediaobject>
</figure>
-
<para>The last section on this wizard step is <property>Configuration</property>. Here, you
can select one of the pre-defined project configurations either associated with Seam
1.2, Seam 2.0 or with Seam 2.1. Furthermore, you can create your own configuration by
@@ -177,21 +154,16 @@
<property>Modify...</property>
</emphasis> button. It will open the dialog which allows to configure your own set of
facets for adding extra functionality to your project.</para>
-
<para>Pass to the next section to find out more details on this dialog.</para>
-
</section>
<section id="projectFacets">
<title>Select the Project Facets</title>
-
<para>The <property>Project Facets wizard</property> allows you to enable or disable
specific facets which define necessary characteristics for the project. In time you
switch to this wizard form, all critical facets are already checked for the chosen
Configuration.</para>
-
<para>Notice that this page of the wizard also allows you to set the necessary version for
any facet. </para>
-
<figure>
<title>Project Facets Selection</title>
<mediaobject>
@@ -200,12 +172,10 @@
</imageobject>
</mediaobject>
</figure>
-
<para>Moreover, here you can specify your own preset of selected facets by checking needed
ones in project facets window and clicking on <emphasis>
<property>Save</property>
</emphasis> button.</para>
-
<figure>
<title>Specifying Custom Facet Preset</title>
<mediaobject>
@@ -214,15 +184,13 @@
</imageobject>
</mediaobject>
</figure>
-
<para>To see all available Server runtimes click on <property>Runtimes</property> tab on the
left. You can create a new one using the <emphasis>
<property>New</property>
</emphasis> button. If more than one runtimes are checked here, the <emphasis>
<property>Make Primary</property>
- </emphasis> button won't be dimmed yet. So you can make use of it to mark
- primary runtime.</para>
-
+ </emphasis> button won't be dimmed yet. So you can make use of it to mark primary
+ runtime.</para>
<figure>
<title>Runtime Manipulations</title>
<mediaobject>
@@ -231,22 +199,32 @@
</imageobject>
</mediaobject>
</figure>
-
<para><emphasis>
<property>Ok</property>
</emphasis> button will bring you to the <property>Web Module</property> wizard form
again.</para>
</section>
-
+ <section id="configureJava">
+ <title>Java application building configuration</title>
+ <para>With this wizard you can define Java source directories, which will be generated on
+ build path. Also you can specify default output folder. If you are agree with default
+ values, press <property>Next</property></para>
+ <figure>
+ <title>Java application building Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_new_seam/create_seam_16a.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
<section id="configureWebModule">
<title>How to Configure Web Module Settings</title>
-
<para> As we deal with a Dynamic Web Application we should first specify the top level
directory of our application for deploying it to a server afterwards. You know, this
- kind of application contains both Web and Java code resources. Thus, it's also important
- to indicate the content directory as well as Java source directory. The wizard will put
- all those values itself. So you can leave everything as it is.</para>
-
+ kind of application contains Web resources. Thus, it's important to indicate the content
+ directory. The wizard will put all those values itself. So you can leave everything as
+ it is.</para>
<figure>
<title>Web Module Settings</title>
<mediaobject>
@@ -259,17 +237,14 @@
<property>Next</property>
</emphasis> to switch to the next wizard form.</para>
</section>
-
<section id="addJSFCapab">
<title>Adding JSF Capabilities</title>
-
<para>This wizard helps you to add JSF capabilities into your project for representing
appropriate behaviours associated with JSF. </para>
- <para>Checking <emphasis>
- <property>Server Supplied JSF Implementation</property>
- </emphasis> means that you will have a default JSF implementation given by
- server.</para>
-
+ <para>Choose <emphasis>
+ <property>Library provided by Target Runtime</property>
+ </emphasis> from Library Type list if you want have a default JSF implementation
+ given by the present runtime.</para>
<figure>
<title>Adding JSF Capabilities to Web Project</title>
<mediaobject>
@@ -278,47 +253,66 @@
</imageobject>
</mediaobject>
</figure>
-
- <para>In case when you want to use your custom JSF implementation check a lower radio
- button. You are able to create a library of jars by clicking on <emphasis>
- <property>New</property>
- </emphasis> button.</para>
- <para>Here, it's necessary to type a <property>Library Name</property>, select a
- <property>Version Supported</property> and add proper <property>Library
- jars</property>. Then click on <emphasis>
- <property>Finish</property>
- </emphasis> to complete the choice.</para>
+ <para>In case when you prefer to use your custom JSF implementation choose <property>User
+ Library</property> Item from Library Type list. In User Library list you can check
+ required library.</para>
<figure>
- <title>Create JSF Implementation Library</title>
+ <title>Using Custom JSF implementation Library </title>
<mediaobject>
<imageobject>
<imagedata fileref="images/create_new_seam/create_seam_17.png"/>
</imageobject>
</mediaobject>
</figure>
-
- <para>In the Component Libraries section of the wizard you can also add <property>Component
- Libraries</property> (e.g. <ulink url="http://www.jboss.org/jbossrichfaces"
- >Richfaces</ulink>). Just click on <emphasis>
- <property>New</property>
- </emphasis> button. Appeared dialog will ask you to type the Library name, supported
- version and add necessary jar's. Press <emphasis>
- <property>Finish</property>
- </emphasis> to complete the choice.</para>
-
+ <para> If you want to add new library click <property>Manage libraries...</property> ( <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_new_seam/create_seam_17a.png"/>
+ </imageobject>
+ </inlinemediaobject>) button. Then you should click <property
+ >New</property>.</para>
<figure>
- <title>Create JSF Implementation Component Library</title>
+ <title>Using Custom JSF implementation Library </title>
<mediaobject>
<imageobject>
<imagedata fileref="images/create_new_seam/create_seam_18.png"/>
</imageobject>
</mediaobject>
</figure>
-
+ <para> Here, it's necessary to type a <property>Library Name</property>. </para>
+ <figure>
+ <title>Entering New User Library Name</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_new_seam/create_seam_23.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>To add proper <property>Library JARs</property> click <property>Add JARs...</property>
+ button and select the JARs on your hard drive. </para>
+ <figure>
+ <title>Selection Library JARs</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_new_seam/create_seam_25.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Also you can download necessary JSF implementation libraries provided by Sun and Apache Foundation. For this you need click <property>Download...</property> (<inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_new_seam/create_seam_23a.png"/>
+ </imageobject>
+ </inlinemediaobject>) button and choose one of proposed libraries.</para>
+ <figure>
+ <title>Download JSF Implementation Library</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/create_new_seam/create_seam_24.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
<para>The last wizard options allows to edit a path for <property>JSF Configuration
File</property>, a name for <property>JSF Servlet</property>, <property>JSF Servlet
Classname</property> and change <property>URL Mapping Patterns</property>.</para>
-
<figure>
<title>JSF Capabilities Wizard</title>
<mediaobject>
@@ -327,14 +321,11 @@
</imageobject>
</mediaobject>
</figure>
-
<para>Finally, as we are arranging the Seam Web project, the last step we should do is to
adjust project configurations associated with the Seam.</para>
</section>
-
<section id="seamFacet">
<title>Configure Seam Facet Settings</title>
-
<para>The last wizard step is related to Seam facet and allows you to do the
following:</para>
<figure>
@@ -345,7 +336,6 @@
</imageobject>
</mediaobject>
</figure>
-
<itemizedlist>
<listitem>
<para>Create Seam runtime and define Seam home folder.</para>
@@ -357,7 +347,6 @@
wizard presented below you can create a Seam runtime only for that version which was
selected in the <link linkend="projectFacets">Project Facets</link> wizard (version 1.2
in our case).</para>
-
<figure>
<title>Seam Runtime Creation</title>
<mediaobject>
@@ -366,7 +355,6 @@
</imageobject>
</mediaobject>
</figure>
-
<itemizedlist>
<listitem>
<para>Select EAR or WAR deployment by checking a necessary radio button.</para>
@@ -377,7 +365,6 @@
</emphasis></para>
</listitem>
</itemizedlist>
-
<figure>
<title>Database Type Selecting</title>
<mediaobject>
@@ -386,16 +373,13 @@
</imageobject>
</mediaobject>
</figure>
-
<itemizedlist>
<listitem>
<para>and then specify a <emphasis>
<property>Connection profile</property>
</emphasis> appropriate for your database.</para>
-
</listitem>
</itemizedlist>
-
<figure>
<title>Connection Profile Options</title>
<mediaobject>
@@ -404,7 +388,6 @@
</imageobject>
</mediaobject>
</figure>
-
<para>You can edit chosen profile by using <emphasis>
<property>Edit</property>
</emphasis> button or organise a new one by clicking on <emphasis>
@@ -418,13 +401,11 @@
</imageobject>
</mediaobject>
</figure>
-
- <para>On the other dialog you'll be asked to enter its name and description. And
- then you should select a proper driver and adjust connection details. Press <emphasis>
+ <para>On the other dialog you'll be asked to enter its name and description. And then
+ you should select a proper driver and adjust connection details. Press <emphasis>
<property>Next</property>
</emphasis> to preview all the adjusted settings and complete the creation of the new
profile.</para>
-
<figure>
<title>Connection Details</title>
<mediaobject>
@@ -433,14 +414,12 @@
</imageobject>
</mediaobject>
</figure>
-
<para>The next block of settings in the Seam Facet wizard are describing a Database and a
connection to it.</para>
<para>In the <property>Code Generation</property> section the wizard have already put the
names for your <property>Session Bean</property>, <property>Entity Bean</property> and
<property>Test</property> packages. Of course, you can change them into the others
which you like.</para>
-
<figure>
<title>Code Generation Section</title>
<mediaobject>
@@ -449,11 +428,9 @@
</imageobject>
</mediaobject>
</figure>
-
<para>Click on <emphasis>
<property>Finish</property>
</emphasis> to generate a project.</para>
-
<para/>
</section>
</chapter>
15 years, 1 month
JBoss Tools SVN: r18398 - trunk/seam/docs/reference/en/images/create_new_seam.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2009-11-03 12:00:05 -0500 (Tue, 03 Nov 2009)
New Revision: 18398
Added:
trunk/seam/docs/reference/en/images/create_new_seam/create_seam_16a.png
trunk/seam/docs/reference/en/images/create_new_seam/create_seam_17a.png
trunk/seam/docs/reference/en/images/create_new_seam/create_seam_23.png
trunk/seam/docs/reference/en/images/create_new_seam/create_seam_23a.png
trunk/seam/docs/reference/en/images/create_new_seam/create_seam_24.png
trunk/seam/docs/reference/en/images/create_new_seam/create_seam_25.png
Modified:
trunk/seam/docs/reference/en/images/create_new_seam/create_seam_10.png
trunk/seam/docs/reference/en/images/create_new_seam/create_seam_17.png
trunk/seam/docs/reference/en/images/create_new_seam/create_seam_18.png
trunk/seam/docs/reference/en/images/create_new_seam/create_seam_19.png
trunk/seam/docs/reference/en/images/create_new_seam/create_seam_9.png
Log:
https://jira.jboss.org/jira/browse/JBDS-906 Demos update. Update corresponding guides: Seam Reference Guide updated the same way as the seam new project demo
Modified: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_10.png
===================================================================
(Binary files differ)
Added: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_16a.png
===================================================================
(Binary files differ)
Property changes on: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_16a.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_17.png
===================================================================
(Binary files differ)
Added: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_17a.png
===================================================================
(Binary files differ)
Property changes on: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_17a.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_18.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_19.png
===================================================================
(Binary files differ)
Added: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_23.png
===================================================================
(Binary files differ)
Property changes on: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_23.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_23a.png
===================================================================
(Binary files differ)
Property changes on: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_23a.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_24.png
===================================================================
(Binary files differ)
Property changes on: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_24.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_25.png
===================================================================
(Binary files differ)
Property changes on: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_25.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_9.png
===================================================================
(Binary files differ)
15 years, 1 month
JBoss Tools SVN: r18397 - trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2009-11-03 10:51:26 -0500 (Tue, 03 Nov 2009)
New Revision: 18397
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4022 now default selection border of Mozilla IFlasher is redrawing when we move a window over it.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2009-11-03 14:13:09 UTC (rev 18396)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2009-11-03 15:51:26 UTC (rev 18397)
@@ -17,6 +17,8 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
@@ -53,7 +55,10 @@
* @author Sergey Vasilyev (svasilyev(a)exadel.com)
*
*/
-public class XulRunnerEditor extends XulRunnerBrowser {
+public class XulRunnerEditor extends XulRunnerBrowser{
+
+ private VisualPaintListener paintListener;
+
/** IVpeResizeListener */
private IVpeResizeListener resizeListener;
@@ -153,6 +158,10 @@
// under Mac OS
// getWebBrowser().removeWebBrowserListener(XulRunnerEditor.this,
// nsIWebProgressListener.NS_IWEBPROGRESSLISTENER_IID);
+ if (paintListener != null) {
+ getBrowser().getParent().removePaintListener(paintListener);
+ paintListener = null;
+ }
getWebBrowser().removeWebBrowserListener(XulRunnerEditor.this,
nsITooltipListener.NS_ITOOLTIPLISTENER_IID);
removeSelectionListener();
@@ -167,7 +176,7 @@
removeListener(SWT.Show, eventListenet);
removeListener(SWT.FocusIn, eventListenet);
removeListener(SWT.Selection, eventListenet);
- removeListener(SWT.Paint, eventListenet);
+ removeListener(SWT.Resize, eventListenet);
eventListenet = null;
}
getBrowser().removeDisposeListener(this);
@@ -175,7 +184,9 @@
}
});
-
+ //Part of fix https://jira.jboss.org/jira/browse/JBIDE-4022
+ paintListener = new VisualPaintListener();
+ getBrowser().getParent().addPaintListener(paintListener);
// addListener(SWT.Activate, eventListenet);
addListener(SWT.Paint, eventListenet);
/*
@@ -187,7 +198,6 @@
// when switch from visual to preview selection rectangle doen't
// disappear
addListener(SWT.Resize, eventListenet);
-
addListener(SWT.Show, eventListenet);
addListener(SWT.FocusIn, eventListenet);
// Commented by Max Areshkau (bug on Mac OS X10.4
@@ -196,7 +206,7 @@
// addListener(SWT.FocusOut, eventListenet);
addListener(SWT.Selection, eventListenet);
addListener(SWT.Paint, eventListenet);
-
+
resizeListener = new IVpeResizeListener() {
public void onEndResizing(int usedResizeMarkerHandle, int top,
int left, int width, int height,
@@ -793,4 +803,13 @@
// return hasSelectInParenNodes(domNode.getParentNode());
// }
// }
+
+ private class VisualPaintListener implements PaintListener{
+
+ public void paintControl(PaintEvent e) {
+ showSelectionRectangle();
+ }
+
+ }
+
}
15 years, 1 month
JBoss Tools SVN: r18396 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal: context and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-11-03 09:13:09 -0500 (Tue, 03 Nov 2009)
New Revision: 18396
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/ForeignKey.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/ForeignKeyHolder.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/ForeignKeyImpl.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/ForeignKeyAnnotation.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/ForeignKeyAnnotationImpl.java
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaAnnotationDefinitionProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Messages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Messages.properties
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntityImpl.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyMapping.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneMapping.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneMapping.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4664
Added support of @ForeignKey with name validation for OneToOne, ManToOne, ManyToMany and Entity mappings.
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaAnnotationDefinitionProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaAnnotationDefinitionProvider.java 2009-11-02 23:30:29 UTC (rev 18395)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaAnnotationDefinitionProvider.java 2009-11-03 14:13:09 UTC (rev 18396)
@@ -20,6 +20,7 @@
import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedQueriesAnnotationDefinition;
import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedQueryAnnotationDefinition;
import org.jboss.tools.hibernate.jpt.core.internal.resource.java.DiscriminatorFormulaAnnotationImpl.DiscriminatorFormulaAnnotationDefinition;
+import org.jboss.tools.hibernate.jpt.core.internal.resource.java.ForeignKeyAnnotationImpl.ForeignKeyAnnotationDefinition;
import org.jboss.tools.hibernate.jpt.core.internal.resource.java.GeneratedAnnotationImpl.GeneratedAnnotationDefinition;
import org.jboss.tools.hibernate.jpt.core.internal.resource.java.GenericGeneratorAnnotationImpl.GenericGeneratorAnnotationDefinition;
import org.jboss.tools.hibernate.jpt.core.internal.resource.java.IndexAnnotationImpl.IndexAnnotationDefinition;
@@ -61,6 +62,7 @@
definitions.add(HibernateNamedNativeQueryAnnotationDefinition.instance());
definitions.add(HibernateNamedNativeQueriesAnnotationDefinition.instance());
definitions.add(DiscriminatorFormulaAnnotationDefinition.instance());
+ definitions.add(ForeignKeyAnnotationDefinition.instance());
}
@Override
@@ -72,5 +74,6 @@
definitions.add(GenericGeneratorAnnotationDefinition.instance());
definitions.add(GeneratedAnnotationDefinition.instance());
definitions.add(IndexAnnotationDefinition.instance());
+ definitions.add(ForeignKeyAnnotationDefinition.instance());
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java 2009-11-02 23:30:29 UTC (rev 18395)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java 2009-11-03 14:13:09 UTC (rev 18396)
@@ -58,6 +58,8 @@
import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
+import org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey;
+import org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKeyImpl;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedNativeQuery;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedQuery;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit;
@@ -282,4 +284,8 @@
return new IndexImpl(parent);
}
+ public ForeignKey buildForeignKey(JavaJpaContextNode parent) {
+ return new ForeignKeyImpl(parent);
+ }
+
}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/ForeignKey.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/ForeignKey.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/ForeignKey.java 2009-11-03 14:13:09 UTC (rev 18396)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.hibernate.jpt.core.internal.context;
+
+import org.eclipse.jpt.core.context.JpaContextNode;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.ForeignKeyAnnotation;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public interface ForeignKey extends JpaContextNode {
+
+ String getName();
+ void setName(String name);
+ String FOREIGN_KEY_NAME = "name"; //$NON-NLS-1$
+
+ String getInverseName();
+ void setInverseName(String inverseName);
+ String FOREIGN_KEY_INVERSE_NAME = "inverseName"; //$NON-NLS-1$
+
+ public void initialize(ForeignKeyAnnotation indexResource);
+
+ public void update(ForeignKeyAnnotation indexResource);
+
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/ForeignKey.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/ForeignKeyHolder.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/ForeignKeyHolder.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/ForeignKeyHolder.java 2009-11-03 14:13:09 UTC (rev 18396)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.hibernate.jpt.core.internal.context;
+
+import org.eclipse.jpt.core.context.JpaContextNode;
+import org.eclipse.jpt.db.Table;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public interface ForeignKeyHolder extends JpaContextNode {
+
+ //******************** ForeignKey *****************
+
+ String FOREIGN_KEY_PROPERTY = "foreignKey"; //$NON-NLS-1$
+
+ ForeignKey getForeignKey();
+
+ ForeignKey addForeignKey();
+
+ void removeForeignKey();
+
+ Table getForeignKeyDbTable();
+
+}
\ No newline at end of file
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/ForeignKeyHolder.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/ForeignKeyImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/ForeignKeyImpl.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/ForeignKeyImpl.java 2009-11-03 14:13:09 UTC (rev 18396)
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.hibernate.jpt.core.internal.context;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
+import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.ForeignKeyAnnotation;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class ForeignKeyImpl extends AbstractJavaJpaContextNode implements ForeignKey {
+
+ private ForeignKeyAnnotation foreignKeyResource;
+
+ private String name;
+
+ private String inverseName;
+
+ public ForeignKeyImpl(JavaJpaContextNode parent) {
+ super(parent);
+ }
+
+ public void initialize(ForeignKeyAnnotation foreignKeyResource) {
+ this.foreignKeyResource = foreignKeyResource;
+ this.name = foreignKeyResource.getName();
+ this.inverseName = foreignKeyResource.getInverseName();
+ }
+
+ public void update(ForeignKeyAnnotation foreignKeyResource) {
+ this.foreignKeyResource = foreignKeyResource;
+ this.setName_(foreignKeyResource.getName());
+ this.setInverseName_(foreignKeyResource.getInverseName());
+ }
+
+ private ForeignKeyAnnotation getResourceForeignKey() {
+ return foreignKeyResource;
+ }
+
+ // ***** name
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ String old = this.name;
+ this.name = name;
+ this.getResourceForeignKey().setName(name);
+ this.firePropertyChanged(FOREIGN_KEY_NAME, old, name);
+ }
+
+ public void setName_(String name) {
+ String old = this.name;
+ this.name = name;
+ this.firePropertyChanged(FOREIGN_KEY_NAME, old, name);
+ }
+
+ // ***** inverseName
+
+ public String getInverseName() {
+ return inverseName;
+ }
+
+ public void setInverseName(String inverseName) {
+ String old = this.inverseName;
+ this.inverseName = inverseName;
+ this.getResourceForeignKey().setInverseName(inverseName);
+ this.firePropertyChanged(FOREIGN_KEY_INVERSE_NAME, old, inverseName);
+ }
+
+ public void setInverseName_(String inverseName) {
+ String old = this.inverseName;
+ this.inverseName = inverseName;
+ this.firePropertyChanged(FOREIGN_KEY_INVERSE_NAME, old, inverseName);
+ }
+
+ public TextRange getValidationTextRange(CompilationUnit astRoot) {
+ return this.foreignKeyResource.getTextRange(astRoot);
+ }
+
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/ForeignKeyImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java 2009-11-02 23:30:29 UTC (rev 18395)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java 2009-11-03 14:13:09 UTC (rev 18396)
@@ -93,7 +93,7 @@
static public class LocalMessage extends Message {
public LocalMessage(int severity, String message,
- String[] strings, IResource resource) {
+ String[] strings, Object resource) {
super(Messages.class.getName(), severity, message, strings, resource);
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Messages.java 2009-11-02 23:30:29 UTC (rev 18395)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Messages.java 2009-11-03 14:13:09 UTC (rev 18396)
@@ -27,5 +27,7 @@
String STRATEGY_INTERFACE = "STRATEGY_INTERFACE"; //$NON-NLS-1$
String NAMING_STRATEGY_EXCEPTION = "NAMING_STRATEGY_EXCEPTION"; //$NON-NLS-1$
+
+ String UNRESOLVED_FOREIGN_KEY_NAME = "UNRESOLVED_FOREIGN_KEY_NAME"; //$NON-NLS-1$
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Messages.properties 2009-11-02 23:30:29 UTC (rev 18395)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Messages.properties 2009-11-03 14:13:09 UTC (rev 18396)
@@ -3,4 +3,5 @@
STRATEGY_CLASS_NOT_FOUND = Strategy class \"{0}\" could not be found.
STRATEGY_CANT_BE_EMPTY = Strategy could not be empty.
STRATEGY_INTERFACE = Strategy class \"{0}\" should implement interface \"org.hibernate.id.IdentifierGenerator\".
-NAMING_STRATEGY_EXCEPTION = Exception occurred when calling NamingStrategy:
\ No newline at end of file
+NAMING_STRATEGY_EXCEPTION = Exception occurred when calling NamingStrategy:
+UNRESOLVED_FOREIGN_KEY_NAME = Foreign key \"{0}\" not found in the table \"{1}\".
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java 2009-11-02 23:30:29 UTC (rev 18395)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java 2009-11-03 14:13:09 UTC (rev 18396)
@@ -101,5 +101,8 @@
String INDEX = PACKAGE_ + "Index"; //$NON-NLS-1$
String INDEX__NAME = "name"; //$NON-NLS-1$
String INDEX__COLUMN_NAMES = "columnNames"; //$NON-NLS-1$
-
+
+ String FOREIGN_KEY = PACKAGE_ + "ForeignKey"; //$NON-NLS-1$
+ String FOREIGN_KEY__NAME = "name"; //$NON-NLS-1$
+ String FOREIGN_KEY__INVERSE_NAME = "inverseName"; //$NON-NLS-1$
}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/ForeignKeyAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/ForeignKeyAnnotation.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/ForeignKeyAnnotation.java 2009-11-03 14:13:09 UTC (rev 18396)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.hibernate.jpt.core.internal.context.java;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.resource.java.Annotation;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public interface ForeignKeyAnnotation extends Annotation {
+
+ String ANNOTATION_NAME = Hibernate.FOREIGN_KEY;
+
+ String getName();
+ void setName(String name);
+ String NAME_PROPERTY = Hibernate.FOREIGN_KEY__NAME;
+
+ String getInverseName();
+ void setInverseName(String name);
+ String INVERSE_NAME_PROPERTY = Hibernate.FOREIGN_KEY__INVERSE_NAME;
+
+ TextRange getNameTextRange(CompilationUnit astRoot);
+ TextRange getInverseNameTextRange(CompilationUnit astRoot);
+
+}
\ No newline at end of file
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/ForeignKeyAnnotation.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java 2009-11-02 23:30:29 UTC (rev 18395)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java 2009-11-03 14:13:09 UTC (rev 18396)
@@ -11,13 +11,15 @@
package org.jboss.tools.hibernate.jpt.core.internal.context.java;
import org.eclipse.jpt.core.context.java.JavaEntity;
+import org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKeyHolder;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateEntity;
/**
* @author Dmitry Geraskov
*
*/
-public interface HibernateJavaEntity extends HibernateEntity, JavaEntity {
+public interface HibernateJavaEntity extends JavaEntity,
+HibernateEntity, ForeignKeyHolder{
JavaDiscriminatorFormula getDiscriminatorFormula();
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntityImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntityImpl.java 2009-11-02 23:30:29 UTC (rev 18395)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntityImpl.java 2009-11-03 14:13:09 UTC (rev 18396)
@@ -39,10 +39,13 @@
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaFactory;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
+import org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey;
import org.jboss.tools.hibernate.jpt.core.internal.context.GenericGenerator;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedNativeQuery;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedQuery;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateTable;
+import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
+import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit.LocalMessage;
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
import org.jboss.tools.hibernate.jpt.core.internal.resource.java.DiscriminatorFormulaAnnotation;
import org.jboss.tools.hibernate.jpt.core.internal.resource.java.GenericGeneratorAnnotation;
@@ -67,6 +70,8 @@
protected final List<HibernateNamedNativeQuery> hibernateNamedNativeQueries;
+ protected ForeignKey foreignKey;
+
public HibernateJavaEntityImpl(JavaPersistentType parent) {
super(parent);
this.genericGenerators = new ArrayList<JavaGenericGenerator>();
@@ -81,6 +86,7 @@
this.initializeGenericGenerators();
this.initializeHibernateNamedQueries();
this.initializeHibernateNamedNativeQueries();
+ this.initializeForeignKey();
}
@Override
@@ -90,6 +96,7 @@
this.updateGenericGenerators();
this.updateHibernateNamedQueries();
this.updateHibernateNamedNativeQueries();
+ this.updateForeignKey();
}
protected HibernateJpaFactory getJpaFactory() {
@@ -121,7 +128,8 @@
Hibernate.NAMED_QUERIES,
Hibernate.NAMED_NATIVE_QUERY,
Hibernate.NAMED_NATIVE_QUERIES,
- Hibernate.DISCRIMINATOR_FORMULA),
+ Hibernate.DISCRIMINATOR_FORMULA,
+ Hibernate.FOREIGN_KEY),
super.correspondingAnnotationNames());
}
@@ -440,12 +448,84 @@
this.javaResourcePersistentType.moveSupportingAnnotation(targetIndex, sourceIndex, HibernateNamedNativeQueriesAnnotation.ANNOTATION_NAME);
fireItemMoved(HIBERNATE_NAMED_NATIVE_QUERIES_LIST, targetIndex, sourceIndex);
}
+
+ // ********************* foreignKey **************
+
+ protected void initializeForeignKey() {
+ ForeignKeyAnnotation foreignKeyResource = getResourceForeignKey();
+ if (foreignKeyResource != null) {
+ this.foreignKey = buildForeignKey(foreignKeyResource);
+ }
+ }
+
+ protected void updateForeignKey() {
+ ForeignKeyAnnotation foreignKeyResource = getResourceForeignKey();
+ if (foreignKeyResource == null) {
+ if (getForeignKey() != null) {
+ setForeignKey(null);
+ }
+ }
+ else {
+ if (getForeignKey() == null) {
+ setForeignKey(buildForeignKey(foreignKeyResource));
+ }
+ else {
+ getForeignKey().update(foreignKeyResource);
+ }
+ }
+ }
+
+ public ForeignKey addForeignKey() {
+ if (getForeignKey() != null) {
+ throw new IllegalStateException("foreignKey already exists"); //$NON-NLS-1$
+ }
+ this.foreignKey = getJpaFactory().buildForeignKey(this);
+ ForeignKeyAnnotation foreignKeyResource = (ForeignKeyAnnotation) javaResourcePersistentType.addSupportingAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+ this.foreignKey.initialize(foreignKeyResource);
+ firePropertyChanged(FOREIGN_KEY_PROPERTY, null, this.foreignKey);
+ return this.foreignKey;
+ }
+ public ForeignKey getForeignKey() {
+ return this.foreignKey;
+ }
+
+ protected void setForeignKey(ForeignKey newForeignKey) {
+ ForeignKey oldForeignKey = this.foreignKey;
+ this.foreignKey = newForeignKey;
+ firePropertyChanged(FOREIGN_KEY_PROPERTY, oldForeignKey, newForeignKey);
+ }
+
+ public void removeForeignKey() {
+ if (getForeignKey() == null) {
+ throw new IllegalStateException("foreignKey does not exist, cannot be removed"); //$NON-NLS-1$
+ }
+ ForeignKey oldForeignKey = this.foreignKey;
+ this.foreignKey = null;
+ this.javaResourcePersistentType.removeSupportingAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+ firePropertyChanged(FOREIGN_KEY_PROPERTY, oldForeignKey, null);
+ }
+
+ protected ForeignKey buildForeignKey(ForeignKeyAnnotation foreignKeyResource) {
+ ForeignKey foreignKey = getJpaFactory().buildForeignKey(this);
+ foreignKey.initialize(foreignKeyResource);
+ return foreignKey;
+ }
+
+ protected ForeignKeyAnnotation getResourceForeignKey() {
+ return (ForeignKeyAnnotation) this.javaResourcePersistentType.getSupportingAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+ }
+
+ public org.eclipse.jpt.db.Table getForeignKeyDbTable() {
+ return getPrimaryDbTable();
+ }
+
// ************************* validation ***********************
@Override
public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
super.validate(messages, reporter, astRoot);
validateGenericGenerator(messages, reporter, astRoot);
+ this.validateForeignKey(messages, astRoot);
}
protected void validateGenericGenerator(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
@@ -454,6 +534,28 @@
}
}
+ protected void validateForeignKey(List<IMessage> messages, CompilationUnit astRoot) {
+ org.eclipse.jpt.db.Table table = getForeignKeyDbTable();
+ if (!shouldValidateAgainstDatabase() || foreignKey == null || table == null ){
+ return;
+ }
+ Iterator<org.eclipse.jpt.db.ForeignKey> fks = table.foreignKeys();
+ while (fks.hasNext()) {
+ org.eclipse.jpt.db.ForeignKey fk = (org.eclipse.jpt.db.ForeignKey) fks.next();
+ if (foreignKey.getName().equals(fk.getIdentifier())){
+ return;
+ }
+ }
+ TextRange textRange = this.getResourceForeignKey().getNameTextRange(astRoot);
+ IMessage message = new LocalMessage(IMessage.HIGH_SEVERITY,
+ Messages.UNRESOLVED_FOREIGN_KEY_NAME, new String[] {foreignKey.getName(), getPrimaryTableName()},
+ this.foreignKey);
+ message.setLineNo(textRange.getLineNumber());
+ message.setOffset(textRange.getOffset());
+ message.setLength(textRange.getLength());
+ messages.add(message);
+ }
+
@Override
public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter,
CompilationUnit astRoot) {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyMapping.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyMapping.java 2009-11-02 23:30:29 UTC (rev 18395)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyMapping.java 2009-11-03 14:13:09 UTC (rev 18396)
@@ -11,9 +11,24 @@
package org.jboss.tools.hibernate.jpt.core.internal.context.java;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
import org.eclipse.jpt.core.internal.context.java.GenericJavaManyToManyMapping;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.eclipse.jpt.db.Table;
+import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaFactory;
+import org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey;
+import org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKeyHolder;
+import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
import org.jboss.tools.hibernate.jpt.core.internal.context.NamingStrategyMappingTools;
+import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit.LocalMessage;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
/**
* @author Dmitry Geraskov
@@ -21,7 +36,9 @@
*/
public class HibernateJavaManyToManyMapping extends
- GenericJavaManyToManyMapping {
+ GenericJavaManyToManyMapping implements ForeignKeyHolder{
+
+ protected ForeignKey foreignKey;
public HibernateJavaManyToManyMapping(JavaPersistentAttribute parent) {
super(parent);
@@ -31,5 +48,129 @@
public String getJoinTableDefaultName() {
return NamingStrategyMappingTools.buildJoinTableDefaultName(this);
}
+
+ public Iterator<String> supportingAnnotationNames() {
+ return new CompositeIterator<String>(super.supportingAnnotationNames(),
+ Hibernate.FOREIGN_KEY);
+ }
+
+ @Override
+ protected HibernateJpaFactory getJpaFactory() {
+ return (HibernateJpaFactory) super.getJpaFactory();
+ }
+
+ @Override
+ protected void initialize() {
+ super.initialize();
+ this.initializeForeignKey();
+ }
+
+ @Override
+ protected void update() {
+ super.update();
+ this.updateForeignKey();
+ }
+
+
+ // *** foreignKey
+
+ protected void initializeForeignKey() {
+ ForeignKeyAnnotation foreignKeyResource = getResourceForeignKey();
+ if (foreignKeyResource != null) {
+ this.foreignKey = buildForeignKey(foreignKeyResource);
+ }
+ }
+
+ protected void updateForeignKey() {
+ ForeignKeyAnnotation foreignKeyResource = getResourceForeignKey();
+ if (foreignKeyResource == null) {
+ if (getForeignKey() != null) {
+ setForeignKey(null);
+ }
+ }
+ else {
+ if (getForeignKey() == null) {
+ setForeignKey(buildForeignKey(foreignKeyResource));
+ }
+ else {
+ getForeignKey().update(foreignKeyResource);
+ }
+ }
+ }
+
+ public ForeignKey addForeignKey() {
+ if (getForeignKey() != null) {
+ throw new IllegalStateException("foreignKey already exists"); //$NON-NLS-1$
+ }
+ this.foreignKey = getJpaFactory().buildForeignKey(this);
+ ForeignKeyAnnotation foreignKeyResource = (ForeignKeyAnnotation) getResourcePersistentAttribute().addSupportingAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+ this.foreignKey.initialize(foreignKeyResource);
+ firePropertyChanged(FOREIGN_KEY_PROPERTY, null, this.foreignKey);
+ return this.foreignKey;
+ }
+
+ public ForeignKey getForeignKey() {
+ return this.foreignKey;
+ }
+
+ protected void setForeignKey(ForeignKey newForeignKey) {
+ ForeignKey oldForeignKey = this.foreignKey;
+ this.foreignKey = newForeignKey;
+ firePropertyChanged(FOREIGN_KEY_PROPERTY, oldForeignKey, newForeignKey);
+ }
+
+ public void removeForeignKey() {
+ if (getForeignKey() == null) {
+ throw new IllegalStateException("foreignKey does not exist, cannot be removed"); //$NON-NLS-1$
+ }
+ ForeignKey oldForeignKey = this.foreignKey;
+ this.foreignKey = null;
+ this.getResourcePersistentAttribute().removeSupportingAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+ firePropertyChanged(FOREIGN_KEY_PROPERTY, oldForeignKey, null);
+ }
+
+ protected ForeignKey buildForeignKey(ForeignKeyAnnotation foreignKeyResource) {
+ ForeignKey foreignKey = getJpaFactory().buildForeignKey(this);
+ foreignKey.initialize(foreignKeyResource);
+ return foreignKey;
+ }
+
+ protected ForeignKeyAnnotation getResourceForeignKey() {
+ return (ForeignKeyAnnotation) this.getResourcePersistentAttribute().getSupportingAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+ }
+
+ public Table getForeignKeyDbTable() {
+ return getTypeMapping().getPrimaryDbTable();
+ }
+
+ @Override
+ public void validate(List<IMessage> messages, IReporter reporter,
+ CompilationUnit astRoot) {
+ super.validate(messages, reporter, astRoot);
+ this.validateForeignKey(messages, astRoot);
+ }
+
+ protected void validateForeignKey(List<IMessage> messages, CompilationUnit astRoot) {
+ Table table = getTypeMapping().getPrimaryDbTable();
+ if (!shouldValidateAgainstDatabase() || foreignKey == null || table == null ){
+ return;
+ }
+ Iterator<org.eclipse.jpt.db.ForeignKey> fks = table.foreignKeys();
+ while (fks.hasNext()) {
+ org.eclipse.jpt.db.ForeignKey fk = (org.eclipse.jpt.db.ForeignKey) fks.next();
+ if (foreignKey.getName().equals(fk.getIdentifier())){
+ return;
+ }
+ }
+ TextRange textRange = this.getResourceForeignKey().getNameTextRange(astRoot);
+ IMessage message = new LocalMessage(IMessage.HIGH_SEVERITY,
+ Messages.UNRESOLVED_FOREIGN_KEY_NAME, new String[] {foreignKey.getName(), getTypeMapping().getPrimaryTableName()},
+ this.foreignKey);
+ message.setLineNo(textRange.getLineNumber());
+ message.setOffset(textRange.getOffset());
+ message.setLength(textRange.getLength());
+ messages.add(message);
+ }
+
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneMapping.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneMapping.java 2009-11-02 23:30:29 UTC (rev 18395)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneMapping.java 2009-11-03 14:13:09 UTC (rev 18396)
@@ -11,17 +11,34 @@
package org.jboss.tools.hibernate.jpt.core.internal.context.java;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.context.java.JavaManyToOneRelationshipReference;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
import org.eclipse.jpt.core.internal.context.java.GenericJavaManyToOneMapping;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.eclipse.jpt.db.Table;
+import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaFactory;
+import org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey;
+import org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKeyHolder;
+import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
import org.jboss.tools.hibernate.jpt.core.internal.context.NamingStrategyMappingTools;
+import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit.LocalMessage;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
/**
* @author Dmitry Geraskov
*
*/
-public class HibernateJavaManyToOneMapping extends GenericJavaManyToOneMapping {
+public class HibernateJavaManyToOneMapping extends GenericJavaManyToOneMapping
+implements ForeignKeyHolder {
+ protected ForeignKey foreignKey;
public HibernateJavaManyToOneMapping(JavaPersistentAttribute parent) {
super(parent);
@@ -36,5 +53,129 @@
protected JavaManyToOneRelationshipReference buildRelationshipReference() {
return new HibernateJavaManyToOneRelationshipReference(this);
}
+
+ public Iterator<String> supportingAnnotationNames() {
+ return new CompositeIterator<String>(super.supportingAnnotationNames(),
+ Hibernate.FOREIGN_KEY);
+ }
+
+ @Override
+ protected HibernateJpaFactory getJpaFactory() {
+ return (HibernateJpaFactory) super.getJpaFactory();
+ }
+
+ @Override
+ protected void initialize() {
+ super.initialize();
+ this.initializeForeignKey();
+ }
+
+ @Override
+ protected void update() {
+ super.update();
+ this.updateForeignKey();
+ }
+
+
+ // *** foreignKey
+
+ protected void initializeForeignKey() {
+ ForeignKeyAnnotation foreignKeyResource = getResourceForeignKey();
+ if (foreignKeyResource != null) {
+ this.foreignKey = buildForeignKey(foreignKeyResource);
+ }
+ }
+
+ protected void updateForeignKey() {
+ ForeignKeyAnnotation foreignKeyResource = getResourceForeignKey();
+ if (foreignKeyResource == null) {
+ if (getForeignKey() != null) {
+ setForeignKey(null);
+ }
+ }
+ else {
+ if (getForeignKey() == null) {
+ setForeignKey(buildForeignKey(foreignKeyResource));
+ }
+ else {
+ getForeignKey().update(foreignKeyResource);
+ }
+ }
+ }
+
+ public ForeignKey addForeignKey() {
+ if (getForeignKey() != null) {
+ throw new IllegalStateException("foreignKey already exists"); //$NON-NLS-1$
+ }
+ this.foreignKey = getJpaFactory().buildForeignKey(this);
+ ForeignKeyAnnotation foreignKeyResource = (ForeignKeyAnnotation) getResourcePersistentAttribute().addSupportingAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+ this.foreignKey.initialize(foreignKeyResource);
+ firePropertyChanged(FOREIGN_KEY_PROPERTY, null, this.foreignKey);
+ return this.foreignKey;
+ }
+
+ public ForeignKey getForeignKey() {
+ return this.foreignKey;
+ }
+
+ protected void setForeignKey(ForeignKey newForeignKey) {
+ ForeignKey oldForeignKey = this.foreignKey;
+ this.foreignKey = newForeignKey;
+ firePropertyChanged(FOREIGN_KEY_PROPERTY, oldForeignKey, newForeignKey);
+ }
+
+ public void removeForeignKey() {
+ if (getForeignKey() == null) {
+ throw new IllegalStateException("foreignKey does not exist, cannot be removed"); //$NON-NLS-1$
+ }
+ ForeignKey oldForeignKey = this.foreignKey;
+ this.foreignKey = null;
+ this.getResourcePersistentAttribute().removeSupportingAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+ firePropertyChanged(FOREIGN_KEY_PROPERTY, oldForeignKey, null);
+ }
+
+ protected ForeignKey buildForeignKey(ForeignKeyAnnotation foreignKeyResource) {
+ ForeignKey foreignKey = getJpaFactory().buildForeignKey(this);
+ foreignKey.initialize(foreignKeyResource);
+ return foreignKey;
+ }
+
+ protected ForeignKeyAnnotation getResourceForeignKey() {
+ return (ForeignKeyAnnotation) this.getResourcePersistentAttribute().getSupportingAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+ }
+
+ public Table getForeignKeyDbTable() {
+ return getTypeMapping().getPrimaryDbTable();
+ }
+
+ @Override
+ public void validate(List<IMessage> messages, IReporter reporter,
+ CompilationUnit astRoot) {
+ super.validate(messages, reporter, astRoot);
+ this.validateForeignKey(messages, astRoot);
+ }
+
+ protected void validateForeignKey(List<IMessage> messages, CompilationUnit astRoot) {
+ Table table = getTypeMapping().getPrimaryDbTable();
+ if (!shouldValidateAgainstDatabase() || foreignKey == null || table == null ){
+ return;
+ }
+ Iterator<org.eclipse.jpt.db.ForeignKey> fks = table.foreignKeys();
+ while (fks.hasNext()) {
+ org.eclipse.jpt.db.ForeignKey fk = (org.eclipse.jpt.db.ForeignKey) fks.next();
+ if (foreignKey.getName().equals(fk.getIdentifier())){
+ return;
+ }
+ }
+ TextRange textRange = this.getResourceForeignKey().getNameTextRange(astRoot);
+ IMessage message = new LocalMessage(IMessage.HIGH_SEVERITY,
+ Messages.UNRESOLVED_FOREIGN_KEY_NAME, new String[] {foreignKey.getName(), getTypeMapping().getPrimaryTableName()},
+ this.foreignKey);
+ message.setLineNo(textRange.getLineNumber());
+ message.setOffset(textRange.getOffset());
+ message.setLength(textRange.getLength());
+ messages.add(message);
+ }
+
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneMapping.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneMapping.java 2009-11-02 23:30:29 UTC (rev 18395)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneMapping.java 2009-11-03 14:13:09 UTC (rev 18396)
@@ -11,17 +11,35 @@
package org.jboss.tools.hibernate.jpt.core.internal.context.java;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
import org.eclipse.jpt.core.context.java.JavaRelationshipReference;
import org.eclipse.jpt.core.internal.context.java.GenericJavaOneToOneMapping;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.eclipse.jpt.db.Table;
+import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaFactory;
+import org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey;
+import org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKeyHolder;
+import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
import org.jboss.tools.hibernate.jpt.core.internal.context.NamingStrategyMappingTools;
+import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit.LocalMessage;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
/**
* @author Dmitry Geraskov
*
*/
-public class HibernateJavaOneToOneMapping extends GenericJavaOneToOneMapping {
+public class HibernateJavaOneToOneMapping extends GenericJavaOneToOneMapping
+implements ForeignKeyHolder {
+ protected ForeignKey foreignKey;
+
public HibernateJavaOneToOneMapping(JavaPersistentAttribute parent) {
super(parent);
}
@@ -35,5 +53,130 @@
protected JavaRelationshipReference buildRelationshipReference() {
return new HibernateJavaOneToOneRelationshipReference(this);
}
+
+ public Iterator<String> supportingAnnotationNames() {
+ return new CompositeIterator<String>(super.supportingAnnotationNames(),
+ Hibernate.FOREIGN_KEY);
+ }
+
+ @Override
+ protected HibernateJpaFactory getJpaFactory() {
+ return (HibernateJpaFactory) super.getJpaFactory();
+ }
+
+ @Override
+ protected void initialize() {
+ super.initialize();
+ this.initializeForeignKey();
+ }
+
+ @Override
+ protected void update() {
+ super.update();
+ this.updateForeignKey();
+ }
+
+
+ // *** foreignKey
+
+ protected void initializeForeignKey() {
+ ForeignKeyAnnotation foreignKeyResource = getResourceForeignKey();
+ if (foreignKeyResource != null) {
+ this.foreignKey = buildForeignKey(foreignKeyResource);
+ }
+ }
+
+ protected void updateForeignKey() {
+ ForeignKeyAnnotation foreignKeyResource = getResourceForeignKey();
+ if (foreignKeyResource == null) {
+ if (getForeignKey() != null) {
+ setForeignKey(null);
+ }
+ }
+ else {
+ if (getForeignKey() == null) {
+ setForeignKey(buildForeignKey(foreignKeyResource));
+ }
+ else {
+ getForeignKey().update(foreignKeyResource);
+ }
+ }
+ }
+
+ public ForeignKey addForeignKey() {
+ if (getForeignKey() != null) {
+ throw new IllegalStateException("foreignKey already exists"); //$NON-NLS-1$
+ }
+ this.foreignKey = getJpaFactory().buildForeignKey(this);
+ ForeignKeyAnnotation foreignKeyResource = (ForeignKeyAnnotation) getResourcePersistentAttribute().addSupportingAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+ this.foreignKey.initialize(foreignKeyResource);
+ firePropertyChanged(FOREIGN_KEY_PROPERTY, null, this.foreignKey);
+ return this.foreignKey;
+ }
+
+ public ForeignKey getForeignKey() {
+ return this.foreignKey;
+ }
+
+ protected void setForeignKey(ForeignKey newForeignKey) {
+ ForeignKey oldForeignKey = this.foreignKey;
+ this.foreignKey = newForeignKey;
+ firePropertyChanged(FOREIGN_KEY_PROPERTY, oldForeignKey, newForeignKey);
+ }
+
+ public void removeForeignKey() {
+ if (getForeignKey() == null) {
+ throw new IllegalStateException("foreignKey does not exist, cannot be removed"); //$NON-NLS-1$
+ }
+ ForeignKey oldForeignKey = this.foreignKey;
+ this.foreignKey = null;
+ this.getResourcePersistentAttribute().removeSupportingAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+ firePropertyChanged(FOREIGN_KEY_PROPERTY, oldForeignKey, null);
+ }
+
+ protected ForeignKey buildForeignKey(ForeignKeyAnnotation foreignKeyResource) {
+ ForeignKey foreignKey = getJpaFactory().buildForeignKey(this);
+ foreignKey.initialize(foreignKeyResource);
+ return foreignKey;
+ }
+
+ protected ForeignKeyAnnotation getResourceForeignKey() {
+ return (ForeignKeyAnnotation) this.getResourcePersistentAttribute().getSupportingAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+ }
+
+ public Table getForeignKeyDbTable() {
+ return getTypeMapping().getPrimaryDbTable();
+ }
+
+ @Override
+ public void validate(List<IMessage> messages, IReporter reporter,
+ CompilationUnit astRoot) {
+ super.validate(messages, reporter, astRoot);
+ this.validateForeignKey(messages, astRoot);
+ }
+
+ protected void validateForeignKey(List<IMessage> messages, CompilationUnit astRoot) {
+ Table table = getTypeMapping().getPrimaryDbTable();
+ if (!shouldValidateAgainstDatabase() || foreignKey == null || table == null ){
+ return;
+ }
+ Iterator<org.eclipse.jpt.db.ForeignKey> fks = table.foreignKeys();
+ while (fks.hasNext()) {
+ org.eclipse.jpt.db.ForeignKey fk = (org.eclipse.jpt.db.ForeignKey) fks.next();
+ if (foreignKey.getName().equals(fk.getIdentifier())){
+ return;
+ }
+ }
+ TextRange textRange = this.getResourceForeignKey().getNameTextRange(astRoot);
+ IMessage message = new LocalMessage(IMessage.HIGH_SEVERITY,
+ Messages.UNRESOLVED_FOREIGN_KEY_NAME, new String[] {foreignKey.getName(), getTypeMapping().getPrimaryTableName()},
+ this.foreignKey);
+ message.setLineNo(textRange.getLineNumber());
+ message.setOffset(textRange.getOffset());
+ message.setLength(textRange.getLength());
+ messages.add(message);
+ }
+
}
+
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/ForeignKeyAnnotationImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/ForeignKeyAnnotationImpl.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/ForeignKeyAnnotationImpl.java 2009-11-03 14:13:09 UTC (rev 18396)
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
+
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
+import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
+import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
+import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
+import org.eclipse.jpt.core.resource.java.Annotation;
+import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.core.resource.java.JavaResourceNode;
+import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
+import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
+import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
+import org.eclipse.jpt.core.utility.jdt.Member;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.ForeignKeyAnnotation;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class ForeignKeyAnnotationImpl extends SourceAnnotation<Member> implements
+ ForeignKeyAnnotation {
+
+ public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
+
+ private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildDeclarationAnnotationAdapter(NAME_PROPERTY);
+ private final AnnotationElementAdapter<String> nameAdapter;
+ private String name;
+
+ private static final DeclarationAnnotationElementAdapter<String> INVERSE_NAME_ADAPTER = buildDeclarationAnnotationAdapter(INVERSE_NAME_PROPERTY);
+ private final AnnotationElementAdapter<String> inverseNameAdapter;
+ private String inverseName;
+
+ protected ForeignKeyAnnotationImpl(JavaResourceNode parent, Member member) {
+ super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
+ this.nameAdapter = this.buildElementAdapter(NAME_ADAPTER);
+ this.inverseNameAdapter = this.buildElementAdapter(INVERSE_NAME_ADAPTER);
+ }
+
+
+ public String getAnnotationName() {
+ return ANNOTATION_NAME;
+ }
+
+ public void initialize(CompilationUnit astRoot) {
+ this.name = this.buildName(astRoot);
+ this.inverseName = this.buildInverseName(astRoot);
+ }
+
+ public void update(CompilationUnit astRoot) {
+ this.setName(this.buildName(astRoot));
+ this.setInverseName(this.buildInverseName(astRoot));
+ }
+
+ public String getInverseName() {
+ return inverseName;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String newName) {
+ if (this.attributeValueHasNotChanged(this.name, newName)) {
+ return;
+ }
+ String old = this.name;
+ this.name = newName;
+ this.nameAdapter.setValue(newName);
+ this.firePropertyChanged(NAME_PROPERTY, old, newName);
+ }
+
+ public void setInverseName(String newInverseName) {
+ if (this.attributeValueHasNotChanged(this.inverseName, newInverseName)) {
+ return;
+ }
+ String old = this.inverseName;
+ this.inverseName = newInverseName;
+ this.inverseNameAdapter.setValue(newInverseName);
+ this.firePropertyChanged(INVERSE_NAME_PROPERTY, old, newInverseName);
+ }
+
+ private String buildName(CompilationUnit astRoot) {
+ return this.nameAdapter.getValue(astRoot);
+ }
+
+ private String buildInverseName(CompilationUnit astRoot) {
+ return this.inverseNameAdapter.getValue(astRoot);
+ }
+
+ private static DeclarationAnnotationElementAdapter<String> buildDeclarationAnnotationAdapter(String property) {
+ return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, property, true);
+ }
+
+ AnnotationElementAdapter<String> buildElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
+ return new ShortCircuitAnnotationElementAdapter<String>(this.member, daea);
+ }
+
+ public TextRange getNameTextRange(CompilationUnit astRoot) {
+ return this.getElementTextRange(NAME_ADAPTER, astRoot);
+ }
+
+ public TextRange getInverseNameTextRange(CompilationUnit astRoot) {
+ return this.getElementTextRange(INVERSE_NAME_ADAPTER, astRoot);
+ }
+
+ public static class ForeignKeyAnnotationDefinition implements AnnotationDefinition
+ {
+ // singleton
+ private static final ForeignKeyAnnotationDefinition INSTANCE = new ForeignKeyAnnotationDefinition();
+
+ /**
+ * Return the singleton.
+ */
+ public static AnnotationDefinition instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Ensure non-instantiability.
+ */
+ private ForeignKeyAnnotationDefinition() {
+ super();
+ }
+
+ public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
+ return new ForeignKeyAnnotationImpl(parent, member);
+ }
+
+ public String getAnnotationName() {
+ return ForeignKeyAnnotation.ANNOTATION_NAME;
+ }
+
+ public Annotation buildAnnotation(JavaResourcePersistentMember arg0,
+ IAnnotation arg1) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
+ throw new UnsupportedOperationException();
+ }
+
+ }
+
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/ForeignKeyAnnotationImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
15 years, 1 month
JBoss Tools SVN: r18395 - trunk/jmx/tests/org.jboss.tools.jmx.core.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-11-02 18:30:29 -0500 (Mon, 02 Nov 2009)
New Revision: 18395
Modified:
trunk/jmx/tests/org.jboss.tools.jmx.core.test/META-INF/MANIFEST.MF
Log:
fix continues build error
Modified: trunk/jmx/tests/org.jboss.tools.jmx.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jmx/tests/org.jboss.tools.jmx.core.test/META-INF/MANIFEST.MF 2009-11-02 22:58:58 UTC (rev 18394)
+++ trunk/jmx/tests/org.jboss.tools.jmx.core.test/META-INF/MANIFEST.MF 2009-11-02 23:30:29 UTC (rev 18395)
@@ -12,7 +12,8 @@
org.eclipse.core.runtime,
org.jboss.tools.jmx.core,
org.eclipse.debug.core,
- org.eclipse.jdt.launching
+ org.eclipse.jdt.launching,
+ org.jboss.tools.tests
Export-Package: org.jboss.tools.jmx.core,
org.jboss.tools.jmx.core.tests,
org.jboss.tools.jmx.core.tests.util
15 years, 1 month
JBoss Tools SVN: r18394 - trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-11-02 17:58:58 -0500 (Mon, 02 Nov 2009)
New Revision: 18394
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
Log:
JBIDE-5036 - filtering out jaxb-xjc.jar
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2009-11-02 20:36:58 UTC (rev 18393)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2009-11-02 22:58:58 UTC (rev 18394)
@@ -46,6 +46,14 @@
// TODO Auto-generated constructor stub
}
+ public static class ClientAllFilter {
+ public static boolean accepts(IPath path) {
+ if( !path.lastSegment().endsWith(EXT_JAR)) return false;
+ if( path.lastSegment().toLowerCase().endsWith("jaxb-xjc.jar")) return false;
+ return true;
+ }
+ }
+
public IClasspathEntry[] resolveClasspathContainer(IProject project, IRuntime runtime) {
if( runtime == null )
return new IClasspathEntry[0];
@@ -121,13 +129,14 @@
protected IClasspathEntry getEntry(IPath path) {
return JavaRuntime.newArchiveRuntimeClasspathEntry(path).getClasspathEntry();
}
+
protected void addEntries(IPath folder, ArrayList<IClasspathEntry> list) {
if( folder.toFile().exists()) {
File f = folder.toFile();
if(f.isDirectory()) {
String[] files = f.list();
for( int i = 0; i < files.length; i++ ) {
- if( files[i].endsWith(EXT_JAR)) {
+ if( files[i].endsWith(EXT_JAR) && ClientAllFilter.accepts(folder.append(files[i]))) {
list.add(getEntry(folder.append(files[i])));
}
}
15 years, 1 month