This repository has been archived by the owner on Apr 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from arsysop/develop
0.3.1 to master
- Loading branch information
Showing
198 changed files
with
8,982 additions
and
2,037 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>ru.arsysop.passage.lic.root</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.m2e.core.maven2Builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
</natures> | ||
</projectDescription> |
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
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,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2018 ArSysOp | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
SPDX-License-Identifier: Apache-2.0 | ||
Contributors: | ||
ArSysOp - initial API and implementation | ||
--> | ||
<projectDescription> | ||
<name>ru.arsysop.passage.lic.base.ui</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
4 changes: 4 additions & 0 deletions
4
bundles/ru.arsysop.passage.lic.base.ui/.settings/org.sonarlint.eclipse.core.prefs
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,4 @@ | ||
autoEnabled=false | ||
eclipse.preferences.version=1 | ||
extraProperties= | ||
fileExclusions= |
14 changes: 14 additions & 0 deletions
14
bundles/ru.arsysop.passage.lic.base.ui/META-INF/MANIFEST.MF
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,14 @@ | ||
Manifest-Version: 1.0 | ||
Automatic-Module-Name: ru.arsysop.passage.lic.base.ui | ||
Bundle-ManifestVersion: 2 | ||
Bundle-SymbolicName: ru.arsysop.passage.lic.base.ui | ||
Bundle-Version: 0.3.1.qualifier | ||
Bundle-Name: %Bundle-Name | ||
Bundle-Vendor: %Bundle-Vendor | ||
Bundle-Copyright: %Bundle-Copyright | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
Require-Bundle: ru.arsysop.passage.lic.runtime;bundle-version="0.0.0";visibility:=reexport, | ||
ru.arsysop.passage.lic.registry;bundle-version="0.0.0", | ||
ru.arsysop.passage.lic.base;bundle-version="0.0.0", | ||
org.eclipse.jface | ||
Export-Package: ru.arsysop.passage.lic.base.ui |
25 changes: 25 additions & 0 deletions
25
bundles/ru.arsysop.passage.lic.base.ui/OSGI-INF/l10n/bundle.properties
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,25 @@ | ||
#Properties file for ru.arsysop.passage.lic.base.ui | ||
############################################################################### | ||
# Copyright (c) 2018 ArSysOp | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Contributors: | ||
# ArSysOp - initial API and implementation | ||
############################################################################### | ||
|
||
Bundle-Name = Passage LIC Base | ||
Bundle-Vendor = ArSysOp | ||
Bundle-Copyright = Copyright (c) 2018 ArSysOp |
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,6 @@ | ||
source.. = src/ | ||
output.. = target/classes/ | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
OSGI-INF/,\ | ||
icons/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
98 changes: 98 additions & 0 deletions
98
...ysop.passage.lic.base.ui/src/ru/arsysop/passage/lic/base/ui/RestrictionVerdictLabels.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,98 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2018 ArSysOp | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*******************************************************************************/ | ||
package ru.arsysop.passage.lic.base.ui; | ||
|
||
import static ru.arsysop.passage.lic.base.LicensingProperties.*; | ||
import static ru.arsysop.passage.lic.base.ui.LicensingImages.*; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import ru.arsysop.passage.lic.base.RestrictionVerdictComparator; | ||
import ru.arsysop.passage.lic.runtime.RestrictionVerdict; | ||
|
||
public class RestrictionVerdictLabels { | ||
|
||
public static String resolveImageKey(Iterable<RestrictionVerdict> verdicts) { | ||
RestrictionVerdict last = resolveLastVerdict(verdicts); | ||
return resolveImageKey(last); | ||
} | ||
|
||
public static String resolveImageKey(RestrictionVerdict verdict) { | ||
if (verdict == null) { | ||
return IMG_LEVEL_OK; | ||
} | ||
String level = verdict.getRestrictionLevel(); | ||
if (level == null) { | ||
level = LICENSING_RESTRICTION_LEVEL_DEFAULT; | ||
} | ||
switch (level) { | ||
case LICENSING_RESTRICTION_LEVEL_WARN: | ||
return IMG_LEVEL_WARN; | ||
case LICENSING_RESTRICTION_LEVEL_ERROR: | ||
return IMG_LEVEL_ERROR; | ||
case LICENSING_RESTRICTION_LEVEL_FATAL: | ||
return IMG_LEVEL_FATAL; | ||
default: | ||
return IMG_LEVEL_WARN; | ||
} | ||
} | ||
|
||
public static String resolveLabel(RestrictionVerdict verdict) { | ||
if (verdict == null) { | ||
return "OK"; | ||
} | ||
String level = verdict.getRestrictionLevel(); | ||
if (level == null) { | ||
level = LICENSING_RESTRICTION_LEVEL_DEFAULT; | ||
} | ||
switch (level) { | ||
case LICENSING_RESTRICTION_LEVEL_WARN: | ||
return "Warning"; | ||
case LICENSING_RESTRICTION_LEVEL_ERROR: | ||
return "Error"; | ||
case LICENSING_RESTRICTION_LEVEL_FATAL: | ||
return "Fatal"; | ||
default: | ||
return "Warning"; | ||
} | ||
} | ||
|
||
public static String resolveTooltip(RestrictionVerdict verdict) { | ||
if (verdict == null) { | ||
return "The product in licensed properly"; | ||
} | ||
return "There are issues with licensing"; | ||
} | ||
|
||
public static RestrictionVerdict resolveLastVerdict(Iterable<RestrictionVerdict> verdicts) { | ||
List<RestrictionVerdict> list = new ArrayList<>(); | ||
verdicts.forEach(list::add); | ||
if (list.isEmpty()) { | ||
return null; | ||
} | ||
Collections.sort(list, new RestrictionVerdictComparator()); | ||
RestrictionVerdict last = list.get(list.size()-1); | ||
return last; | ||
} | ||
|
||
} |
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
Oops, something went wrong.