diff --git a/Activities/Activities.Java.sln b/Activities/Activities.Java.sln index 485d47541..4fe96cbf4 100644 --- a/Activities/Activities.Java.sln +++ b/Activities/Activities.Java.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30621.155 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35514.174 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UiPath.Java", "Java\UiPath.Java\UiPath.Java.csproj", "{89957ABF-8A15-484A-94BA-6565969046AD}" EndProject @@ -21,12 +21,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UiPath.TestUtils", "Shared\UiPath.TestUtils\UiPath.TestUtils.csproj", "{D2C94889-1E86-4ABD-9D5E-631B3463DA86}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UiPath.Java.Activities.ViewModels", "Java\UiPath.Java.Activities.ViewModels\UiPath.Java.Activities.ViewModels.csproj", "{08C8716A-5902-4E2F-B5CB-B3977D0A7506}" +EndProject Global - GlobalSection(SharedMSBuildProjectFiles) = preSolution - Shared\UiPath.Shared.Activities.Design\UiPath.Shared.Activities.Design.projitems*{5e102b9e-dcef-4d8b-8a02-3fdf0fcc0d59}*SharedItemsImports = 5 - Shared\UiPath.Shared.Activities\UiPath.Shared.Activities.projitems*{7747a478-8986-4a56-8342-093752fc07c3}*SharedItemsImports = 5 - Shared\UiPath.Shared\UiPath.Shared.projitems*{7747a478-8986-4a56-8342-093752fc07c3}*SharedItemsImports = 5 - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU @@ -56,6 +53,10 @@ Global {D2C94889-1E86-4ABD-9D5E-631B3463DA86}.Debug|Any CPU.Build.0 = Debug|Any CPU {D2C94889-1E86-4ABD-9D5E-631B3463DA86}.Release|Any CPU.ActiveCfg = Release|Any CPU {D2C94889-1E86-4ABD-9D5E-631B3463DA86}.Release|Any CPU.Build.0 = Release|Any CPU + {08C8716A-5902-4E2F-B5CB-B3977D0A7506}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {08C8716A-5902-4E2F-B5CB-B3977D0A7506}.Debug|Any CPU.Build.0 = Debug|Any CPU + {08C8716A-5902-4E2F-B5CB-B3977D0A7506}.Release|Any CPU.ActiveCfg = Release|Any CPU + {08C8716A-5902-4E2F-B5CB-B3977D0A7506}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -63,4 +64,9 @@ Global GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5AC55779-EA32-41AD-BAAD-1808F8A412CB} EndGlobalSection + GlobalSection(SharedMSBuildProjectFiles) = preSolution + Shared\UiPath.Shared.Activities.Design\UiPath.Shared.Activities.Design.projitems*{5e102b9e-dcef-4d8b-8a02-3fdf0fcc0d59}*SharedItemsImports = 5 + Shared\UiPath.Shared.Activities\UiPath.Shared.Activities.projitems*{7747a478-8986-4a56-8342-093752fc07c3}*SharedItemsImports = 5 + Shared\UiPath.Shared\UiPath.Shared.projitems*{7747a478-8986-4a56-8342-093752fc07c3}*SharedItemsImports = 5 + EndGlobalSection EndGlobal diff --git a/Activities/Java/UiPath.Java.Activities.Design/ConvertJavaObjectDesigner.xaml b/Activities/Java/UiPath.Java.Activities.Design/ConvertJavaObjectDesigner.xaml index 07964a574..54efba819 100644 --- a/Activities/Java/UiPath.Java.Activities.Design/ConvertJavaObjectDesigner.xaml +++ b/Activities/Java/UiPath.Java.Activities.Design/ConvertJavaObjectDesigner.xaml @@ -1,44 +1,51 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Activities/Java/UiPath.Java.Activities.Design/CreateJavaObjectDesigner.xaml b/Activities/Java/UiPath.Java.Activities.Design/CreateJavaObjectDesigner.xaml index fa1453890..384c002b6 100644 --- a/Activities/Java/UiPath.Java.Activities.Design/CreateJavaObjectDesigner.xaml +++ b/Activities/Java/UiPath.Java.Activities.Design/CreateJavaObjectDesigner.xaml @@ -1,38 +1,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Activities/Java/UiPath.Java.Activities.Design/GetJavaFieldDesigner.xaml b/Activities/Java/UiPath.Java.Activities.Design/GetJavaFieldDesigner.xaml index 103b3df53..4e13920e5 100644 --- a/Activities/Java/UiPath.Java.Activities.Design/GetJavaFieldDesigner.xaml +++ b/Activities/Java/UiPath.Java.Activities.Design/GetJavaFieldDesigner.xaml @@ -1,48 +1,54 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Activities/Java/UiPath.Java.Activities.Design/InvokeJavaMethodDesigner.xaml b/Activities/Java/UiPath.Java.Activities.Design/InvokeJavaMethodDesigner.xaml index 5f95098c5..2eba2a911 100644 --- a/Activities/Java/UiPath.Java.Activities.Design/InvokeJavaMethodDesigner.xaml +++ b/Activities/Java/UiPath.Java.Activities.Design/InvokeJavaMethodDesigner.xaml @@ -1,49 +1,55 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Activities/Java/UiPath.Java.Activities.Design/JavaScopeDesigner.xaml b/Activities/Java/UiPath.Java.Activities.Design/JavaScopeDesigner.xaml index c23cf5800..a29629b5a 100644 --- a/Activities/Java/UiPath.Java.Activities.Design/JavaScopeDesigner.xaml +++ b/Activities/Java/UiPath.Java.Activities.Design/JavaScopeDesigner.xaml @@ -1,21 +1,28 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/Activities/Java/UiPath.Java.Activities.Design/LoadJarDesigner.xaml b/Activities/Java/UiPath.Java.Activities.Design/LoadJarDesigner.xaml index c01fed65e..cd2b722ca 100644 --- a/Activities/Java/UiPath.Java.Activities.Design/LoadJarDesigner.xaml +++ b/Activities/Java/UiPath.Java.Activities.Design/LoadJarDesigner.xaml @@ -1,25 +1,32 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Activities/Java/UiPath.Java.Activities.Design/Themes/Icons.xaml b/Activities/Java/UiPath.Java.Activities.Design/Themes/Icons.xaml new file mode 100644 index 000000000..61998cb18 --- /dev/null +++ b/Activities/Java/UiPath.Java.Activities.Design/Themes/Icons.xaml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Activities/Java/UiPath.Java.Activities.Design/UiPath.Java.Activities.Design.csproj b/Activities/Java/UiPath.Java.Activities.Design/UiPath.Java.Activities.Design.csproj index 31e0049d0..86b817be7 100644 --- a/Activities/Java/UiPath.Java.Activities.Design/UiPath.Java.Activities.Design.csproj +++ b/Activities/Java/UiPath.Java.Activities.Design/UiPath.Java.Activities.Design.csproj @@ -1,11 +1,11 @@  - net461;net5.0-windows + net461;net6.0-windows $(ProjectDir)..\..\Output\Activities\Java\ true - + diff --git a/Activities/Java/UiPath.Java.Activities.Packaging/UiPath.Java.Activities.Packaging.csproj b/Activities/Java/UiPath.Java.Activities.Packaging/UiPath.Java.Activities.Packaging.csproj index 83ec71256..c3fe9078c 100644 --- a/Activities/Java/UiPath.Java.Activities.Packaging/UiPath.Java.Activities.Packaging.csproj +++ b/Activities/Java/UiPath.Java.Activities.Packaging/UiPath.Java.Activities.Packaging.csproj @@ -1,7 +1,7 @@  - net461;net5.0-windows;net5.0 + net461;net6.0-windows;net6.0 $(ProjectDir)..\..\Output\Activities\Java\ @@ -50,7 +50,7 @@ - + @@ -66,18 +66,27 @@ + + + + - + All - + All + + + All + + diff --git a/Activities/Java/UiPath.Java.Activities.ViewModels/Resources/ActivitiesMetadataWindows.json b/Activities/Java/UiPath.Java.Activities.ViewModels/Resources/ActivitiesMetadataWindows.json new file mode 100644 index 000000000..6916166f6 --- /dev/null +++ b/Activities/Java/UiPath.Java.Activities.ViewModels/Resources/ActivitiesMetadataWindows.json @@ -0,0 +1,47 @@ +{ + "additionalTypeCacheInfo": { + "legacyDesignerActivities": [ + { + "fullName": "UiPath.Java.Activities.ConvertJavaObject", + "displayNameKey": "ConvertJavaObjectDisplayName", + "descriptionKey": "ConvertJavaObjectDescription", + "iconKey": "JavaIcon.svg" + }, + { + "fullName": "UiPath.Java.Activities.CreateJavaObject", + "displayNameKey": "CreateJavaObjectDisplayName", + "descriptionKey": "CreateJavaObjectDescription", + "iconKey": "JavaIcon.svg" + }, + { + "fullName": "UiPath.Java.Activities.GetJavaField", + "displayNameKey": "GetFieldDisplayName", + "descriptionKey": "GetFieldDescritption", + "iconKey": "JavaIcon.svg" + }, + { + "fullName": "UiPath.Java.Activities.InvokeJavaMethod", + "displayNameKey": "InvokeJavaMethodDisplayName", + "descriptionKey": "InvokeJavaMethodDescription", + "iconKey": "JavaIcon.svg" + }, + { + "fullName": "UiPath.Java.Activities.JavaScope", + "displayNameKey": "JavaScopeNameDisplayName", + "descriptionKey": "JavaScopeDescription", + "iconKey": "JavaIcon.svg" + }, + { + "fullName": "UiPath.Java.Activities.LoadJar", + "displayNameKey": "LoadJarDisplayName", + "descriptionKey": "LoadJarDescription", + "iconKey": "JavaIcon.svg" + } + ] + }, + "defaultActivityNameBackgroundColor": "#00489D", + "defaultActivityColor": "#00489D", + "defaultActivityIconKey": "JavaIcon.svg", + "assemblyIconKey": "JavaIcon.svg", + "resourceManagerName": "UiPath.Java.Activities.Design.Properties.UiPath.Java.Activities.Design" +} diff --git a/Activities/Java/UiPath.Java.Activities.ViewModels/Resources/Icons/JavaIcon.svg b/Activities/Java/UiPath.Java.Activities.ViewModels/Resources/Icons/JavaIcon.svg new file mode 100644 index 000000000..fc6665f26 --- /dev/null +++ b/Activities/Java/UiPath.Java.Activities.ViewModels/Resources/Icons/JavaIcon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Activities/Java/UiPath.Java.Activities.ViewModels/UiPath.Java.Activities.ViewModels.csproj b/Activities/Java/UiPath.Java.Activities.ViewModels/UiPath.Java.Activities.ViewModels.csproj new file mode 100644 index 000000000..1117cb09f --- /dev/null +++ b/Activities/Java/UiPath.Java.Activities.ViewModels/UiPath.Java.Activities.ViewModels.csproj @@ -0,0 +1,23 @@ + + + + + net6.0;net6.0-windows + $(ProjectDir)..\..\Output\Activities\Java\ + VIEW_MODELS + UiPath.Java.Activities.ViewModels + UiPath.Activities.Java.ViewModels + + + + + + + + + + All + + + + diff --git a/Activities/Java/UiPath.Java.Activities/UiPath.Java.Activities.csproj b/Activities/Java/UiPath.Java.Activities/UiPath.Java.Activities.csproj index 8883b6f0c..9ac948599 100644 --- a/Activities/Java/UiPath.Java.Activities/UiPath.Java.Activities.csproj +++ b/Activities/Java/UiPath.Java.Activities/UiPath.Java.Activities.csproj @@ -2,7 +2,7 @@ .noconflict - net461;net5.0 + net461;net6.0 ..\..\Output\Activities\Java\ @@ -12,7 +12,7 @@ - + diff --git a/Activities/Java/UiPath.Java/UiPath.Java.csproj b/Activities/Java/UiPath.Java/UiPath.Java.csproj index cc64df04e..320dc14c6 100644 --- a/Activities/Java/UiPath.Java/UiPath.Java.csproj +++ b/Activities/Java/UiPath.Java/UiPath.Java.csproj @@ -1,7 +1,7 @@  - net461;net5.0 + net461;net6.0 ..\..\Output\Activities\Java\ @@ -10,7 +10,7 @@ - + \ No newline at end of file diff --git a/Activities/Java/azure-pipelines.yml b/Activities/Java/azure-pipelines.yml index 34b652dda..7b1af288b 100644 --- a/Activities/Java/azure-pipelines.yml +++ b/Activities/Java/azure-pipelines.yml @@ -44,7 +44,7 @@ stages: projectName: 'Java' solutionPath: '$(SolutionsPath)/Activities.Java.sln' sonarKeyPrefix: 'CommunityActivities' - sdkBuild: true + sdkBuild: false enableCDStages: false hasQaPackages: false diff --git a/Activities/Shared/UiPath.Shared.Activities.Design/Converters/ActivityIconConverter.cs b/Activities/Shared/UiPath.Shared.Activities.Design/Converters/ActivityIconConverter.cs index d3fda81db..7f4f794fc 100644 --- a/Activities/Shared/UiPath.Shared.Activities.Design/Converters/ActivityIconConverter.cs +++ b/Activities/Shared/UiPath.Shared.Activities.Design/Converters/ActivityIconConverter.cs @@ -8,6 +8,8 @@ namespace UiPath.Activities.Presentation.Converters { public class ActivityIconConverter : IValueConverter { + private const string IconsUri = "pack://application:,,,/{0};component/Themes/Icons.xaml"; + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { try @@ -16,18 +18,10 @@ public object Convert(object value, Type targetType, object parameter, System.Gl { return null; } - Type activityType = (value as ModelItem).ItemType; - string resourceName = activityType.Name; - if (activityType.IsGenericType) - { - resourceName = resourceName.Split('`')[0]; - } - resourceName += "Icon"; + GetResourceInfoFromParam(out var resourceName, out var source); - var iconsSource = new ResourceDictionary { Source = new Uri(parameter as string) }; - - var icon = iconsSource[resourceName] as DrawingBrush; + DrawingBrush icon = GetDrawingBrushFromCustomDictionary(source, resourceName); if (icon == null) { icon = Application.Current.Resources[resourceName] as DrawingBrush; @@ -37,17 +31,53 @@ public object Convert(object value, Type targetType, object parameter, System.Gl icon = Application.Current.Resources["GenericLeafActivityIcon"] as DrawingBrush; } - return icon.Drawing; + return icon?.Drawing; } catch { return null; } + + void GetResourceInfoFromParam(out string resourceName, out string sourceUri) + { + Type activityType = (value as ModelItem).ItemType; + resourceName = activityType.Name; + + if (activityType.IsGenericType) + { + resourceName = resourceName.Split('`')[0]; + } + resourceName += "Icon"; + + sourceUri = GetDefaultResource(); + } } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return Binding.DoNothing; } + + private static DrawingBrush GetDrawingBrushFromCustomDictionary(object source, string resourceName) + { + var sourceUri = source as string; + if (sourceUri == null) + return null; + try + { + var iconsSource = new ResourceDictionary { Source = new Uri(sourceUri, UriKind.Absolute) }; + return iconsSource[resourceName] as DrawingBrush; + } + catch + { + //just default to null + return null; + } + } + + private static string GetDefaultResource() + { + return string.Format(IconsUri, typeof(ActivityIconConverter).Assembly.FullName); + } } } \ No newline at end of file