Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

561771 [Passage] Remove outdated code dedicated to select a User #178

Merged
merged 2 commits into from
Apr 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.eclipse.passage.loc.licenses.emfforms" version="2">
<resource path="META-INF/MANIFEST.MF">
<filter comment="Increased because of non-API types removed" id="926941240">
<filter comment="Bug 561771 - removed functionality was not intended to be an API" id="926941240">
<message_arguments>
<message_argument value="0.7.0"/>
<message_argument value="0.6.0"/>
<message_argument value="0.5.0"/>
</message_arguments>
</filter>
</resource>
<resource path="META-INF/MANIFEST.MF" type="org.eclipse.passage.loc.licenses.emfforms.handlers.CreateLicensePackHandler">
<filter comment="Was not intended for API" id="305324134">
<resource path="META-INF/MANIFEST.MF" type="org.eclipse.passage.loc.licenses.emfforms.renderers.UserIdentifierRendererService">
<filter id="305324134">
<message_arguments>
<message_argument value="org.eclipse.passage.loc.licenses.emfforms.handlers.CreateLicensePackHandler"/>
<message_argument value="org.eclipse.passage.loc.licenses.emfforms_0.6.0"/>
<message_argument value="org.eclipse.passage.loc.licenses.emfforms.renderers.UserIdentifierRendererService"/>
<message_argument value="org.eclipse.passage.loc.licenses.emfforms_0.7.0"/>
</message_arguments>
</filter>
</resource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.passage.loc.licenses.emfforms
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.passage.loc.licenses.emfforms;singleton:=true
Bundle-Version: 0.6.0.qualifier
Bundle-Version: 0.7.0.qualifier
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Expand Down Expand Up @@ -36,7 +36,6 @@ Require-Bundle: javax.inject;bundle-version="0.0.0",
org.eclipse.passage.loc.workbench.emfforms;bundle-version="0.0.0",
org.eclipse.passage.loc.features.emfforms;bundle-version="0.0.0",
org.eclipse.passage.loc.products.emfforms;bundle-version="0.0.0",
org.eclipse.passage.loc.users.emfforms;bundle-version="0.0.0",
org.eclipse.passage.loc.licenses.ui;bundle-version="0.0.0"
Service-Component: OSGI-INF/*.xml
Bundle-ActivationPolicy: lazy
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@
import org.eclipse.passage.lic.products.ProductVersionDescriptor;
import org.eclipse.passage.lic.products.registry.ProductRegistry;
import org.eclipse.passage.lic.users.UserDescriptor;
import org.eclipse.passage.lic.users.UserOriginDescriptor;
import org.eclipse.passage.lic.users.model.api.UserLicense;
import org.eclipse.passage.lic.users.model.meta.UsersPackage;
import org.eclipse.passage.lic.users.registry.UserRegistry;
import org.eclipse.passage.loc.api.OperatorLicenseService;
import org.eclipse.passage.loc.internal.licenses.ui.i18n.LicensesUiMessages;
import org.eclipse.passage.loc.internal.users.ui.SelectUser;
import org.eclipse.passage.loc.internal.users.ui.SelectUserOrigin;
import org.eclipse.passage.loc.internal.workbench.SelectInner;
import org.eclipse.passage.loc.products.ui.ProductsUi;
import org.eclipse.passage.loc.users.ui.UsersUi;
import org.eclipse.passage.loc.workbench.LocWokbench;
Expand All @@ -58,11 +61,11 @@ public void execute(@Named(IServiceConstants.ACTIVE_SELECTION) LicensePlanDescri
IEclipseContext context) {
OperatorLicenseService licenseService = context.get(OperatorLicenseService.class);
Shell shell = context.get(Shell.class);
UserRegistry userRegistry = context.get(UserRegistry.class);
ProductRegistry productRegistry = context.get(ProductRegistry.class);
ComposedAdapterFactoryProvider provider = context.get(ComposedAdapterFactoryProvider.class);
UserDescriptor userDescriptor = UsersUi.selectUserDescriptor(shell, provider, userRegistry, null);
if (userDescriptor == null) {
java.util.Optional<UserDescriptor> user = new SelectInner<UserDescriptor, UserOriginDescriptor>(
new SelectUser(context).get(), new SelectUserOrigin(context).get(), context).get();
if (!user.isPresent()) {
return;
}
ProductVersionDescriptor productVersion = ProductsUi.selectProductVersionDescriptor(shell, provider,
Expand Down Expand Up @@ -96,7 +99,7 @@ public String isValid(String newText) {
Date from = Date.from(fromLocal.atZone(ZoneId.systemDefault()).toInstant());
Date until = Date.from(untilLocal.atZone(ZoneId.systemDefault()).toInstant());

LicensingRequest request = createLicensingRequest(userDescriptor, licensePlan, productVersion, from, until);
LicensingRequest request = createLicensingRequest(user.get(), licensePlan, productVersion, from, until);

LicensePackDescriptor licensePack = licenseService.createLicensePack(request);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.eclipse.passage.loc.users.emfforms" version="2">
<resource path="META-INF/MANIFEST.MF">
<filter comment="Bug 561771 - removed functionality was not intended to be an API" id="926941240">
<message_arguments>
<message_argument value="0.6.0"/>
<message_argument value="0.5.0"/>
</message_arguments>
</filter>
</resource>
<resource path="META-INF/MANIFEST.MF" type="org.eclipse.passage.loc.users.emfforms.renderers.UserIdentifierRenderer">
<filter comment="Bug 561771 - removed functionality was not intended to be an API" id="305324134">
<message_arguments>
<message_argument value="org.eclipse.passage.loc.users.emfforms.renderers.UserIdentifierRenderer"/>
<message_argument value="org.eclipse.passage.loc.users.emfforms_0.6.0"/>
</message_arguments>
</filter>
</resource>
</component>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.passage.loc.users.emfforms
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.passage.loc.users.emfforms;singleton:=true
Bundle-Version: 0.5.0.qualifier
Bundle-Version: 0.6.0.qualifier
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Expand Down

This file was deleted.

19 changes: 19 additions & 0 deletions bundles/org.eclipse.passage.loc.users.ui/.settings/.api_filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.eclipse.passage.loc.users.ui" version="2">
<resource path="META-INF/MANIFEST.MF">
<filter comment="Bug 561771 - removed functionality was not intended to be an API" id="926941240">
<message_arguments>
<message_argument value="0.7.0"/>
<message_argument value="0.6.0"/>
</message_arguments>
</filter>
</resource>
<resource path="src/org/eclipse/passage/loc/users/ui/UsersUi.java" type="org.eclipse.passage.loc.users.ui.UsersUi">
<filter comment="Bug 561771 - removed functionality was not intended to be an API" id="338792546">
<message_arguments>
<message_argument value="org.eclipse.passage.loc.users.ui.UsersUi"/>
<message_argument value="selectUserDescriptor(Shell, ComposedAdapterFactoryProvider, UserRegistry, UserDescriptor)"/>
</message_arguments>
</filter>
</resource>
</component>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Bundle-SymbolicName: org.eclipse.passage.loc.users.ui;singleton:=true
Bundle-Version: 0.6.0.qualifier
Bundle-Version: 0.7.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.core.runtime;bundle-version="0.0.0",
org.eclipse.e4.core.contexts;bundle-version="0.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,10 @@
*******************************************************************************/
package org.eclipse.passage.loc.users.ui;

import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.passage.lic.emf.edit.ComposedAdapterFactoryProvider;
import org.eclipse.passage.lic.users.UserDescriptor;
import org.eclipse.passage.lic.users.model.meta.UsersPackage;
import org.eclipse.passage.lic.users.registry.UserRegistry;
import org.eclipse.passage.loc.internal.users.ui.i18n.UsersUiMessages;
import org.eclipse.passage.loc.workbench.LocWokbench;
import org.eclipse.swt.widgets.Shell;

public class UsersUi {

public static final String BUNDLE_SYMBOLIC_NAME = "org.eclipse.passage.loc.users.ui"; //$NON-NLS-1$

public static final String PERSPECTIVE_MAIN = BUNDLE_SYMBOLIC_NAME + '.' + "perspective.main"; //$NON-NLS-1$

public static UserDescriptor selectUserDescriptor(Shell shell, ComposedAdapterFactoryProvider provider,
UserRegistry registry, UserDescriptor initial) {
String classifier = UsersPackage.eINSTANCE.getUser().getName();
String title = UsersUiMessages.UsersUi_select_user;
Iterable<? extends UserDescriptor> input = registry.getUsers();
Class<UserDescriptor> clazz = UserDescriptor.class;
ComposedAdapterFactory factory = provider.getComposedAdapterFactory();
return LocWokbench.selectClassifier(shell, factory, classifier, title, input, initial, clazz);
}

}