-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 575165 - [Passage][Operator] License Agreement management: gui
rework static util to normal class Signed-off-by: eparovyshnaya <[email protected]>
- Loading branch information
1 parent
0561b13
commit fa552e1
Showing
5 changed files
with
66 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...assage.loc.agreements.ui/src/org/eclipse/passage/loc/agreements/ui/SelectedAgreement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0/. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.passage.loc.agreements.ui; | ||
|
||
import java.util.Optional; | ||
import java.util.function.Supplier; | ||
|
||
import org.eclipse.passage.lic.agreements.AgreementDescriptor; | ||
import org.eclipse.passage.lic.agreements.model.meta.AgreementsPackage; | ||
import org.eclipse.passage.loc.internal.agreements.AgreementRegistry; | ||
import org.eclipse.passage.loc.internal.agreements.ui.i18n.AgreementsUiMessages; | ||
import org.eclipse.passage.loc.workbench.LocWokbench; | ||
import org.eclipse.swt.widgets.Shell; | ||
|
||
public final class SelectedAgreement implements Supplier<Optional<AgreementDescriptor>> { | ||
|
||
private final Shell shell; | ||
private final AgreementRegistry registry; | ||
private final AgreementDescriptor initial; | ||
|
||
public SelectedAgreement(Shell shell, AgreementRegistry registry, AgreementDescriptor initial) { | ||
this.shell = shell; | ||
this.registry = registry; | ||
this.initial = initial; | ||
} | ||
|
||
@Override | ||
public Optional<AgreementDescriptor> get() { | ||
return Optional.ofNullable(// | ||
LocWokbench.selectClassifier(// | ||
shell, // | ||
AgreementsPackage.eINSTANCE.getAgreement().getName(), // | ||
AgreementsUiMessages.AgreementsUi_select_agreement, // | ||
registry.agreements(), // | ||
initial, // | ||
AgreementDescriptor.class)// | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters