Skip to content
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
1 change: 0 additions & 1 deletion bundle/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ Export-Package: com.jfrog.ide.eclipse.configuration,
com.jfrog.ide.eclipse.ui,
com.jfrog.ide.eclipse.ui.actions,
com.jfrog.ide.eclipse.ui.issues,
com.jfrog.ide.eclipse.ui.licenses,
com.jfrog.ide.eclipse.utils
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import com.jfrog.ide.eclipse.ui.ComponentDetails;
import com.jfrog.ide.eclipse.ui.issues.ComponentIssueDetails;
import com.jfrog.ide.eclipse.ui.licenses.ComponentLicenseDetails;

/**
* Panel for configuring Xray URL, username and password.
Expand Down Expand Up @@ -49,7 +48,7 @@ public boolean performOk() {
return true;
}
boolean doQuickScan = false;
ComponentDetails[] componentsDetails = { ComponentIssueDetails.getInstance(), ComponentLicenseDetails.getInstance() };
ComponentDetails[] componentsDetails = { ComponentIssueDetails.getInstance()};
for (ComponentDetails componentsDetail : componentsDetails) {
if (componentsDetail != null) {
componentsDetail.credentialsSet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.jfrog.ide.eclipse.scheduling.ScanJob;
import com.jfrog.ide.eclipse.ui.FilterManagerSingleton;
import com.jfrog.ide.eclipse.ui.issues.IssuesTree;
import com.jfrog.ide.eclipse.ui.licenses.LicensesTree;
import com.jfrog.ide.eclipse.utils.ProjectsMap;
import com.jfrog.xray.client.services.summary.Components;
import org.jfrog.build.api.util.Log;
Expand Down Expand Up @@ -76,23 +75,21 @@ public IProgressMonitor getMonitor(){
* @param parent - The parent UI composite. Cancel the scan if the parent is
* disposed.
*/
public void scanAndUpdateResults(boolean quickScan, IssuesTree issuesTree, LicensesTree licensesTree, Composite parent) {
ScanJob.doSchedule(project.getName(), new ScanRunnable(parent, issuesTree, licensesTree, quickScan));
public void scanAndUpdateResults(boolean quickScan, IssuesTree issuesTree, Composite parent) {
ScanJob.doSchedule(project.getName(), new ScanRunnable(parent, issuesTree, quickScan));
}

/**
* Start a dependency scan.
*/
private class ScanRunnable implements ICoreRunnable {
private LicensesTree licensesTree;
private IssuesTree issuesTree;
private boolean quickScan;
private Composite parent;

private ScanRunnable(Composite parent, IssuesTree issuesTree, LicensesTree licensesTree, boolean quickScan) {
private ScanRunnable(Composite parent, IssuesTree issuesTree, boolean quickScan) {
this.parent = parent;
this.issuesTree = issuesTree;
this.licensesTree = licensesTree;
this.quickScan = quickScan;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,20 @@
import static com.jfrog.ide.eclipse.ui.UiUtils.createLabel;
import static com.jfrog.ide.eclipse.ui.UiUtils.setGridLayout;

import java.util.Set;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.program.Program;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Link;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.Hyperlink;
import org.jfrog.build.extractor.scan.DependencyTree;
import org.jfrog.build.extractor.scan.GeneralInfo;
import org.jfrog.build.extractor.scan.License;

import com.jfrog.ide.common.utils.Utils;
import com.jfrog.ide.eclipse.configuration.XrayGlobalConfiguration;
import com.jfrog.ide.eclipse.configuration.XrayServerConfigImpl;

Expand Down Expand Up @@ -106,7 +96,7 @@ protected void createComponentsPanel() {
}

/**
* Create the common information between issues and licenses tabs.
* Create the common information.
*
* @param node - Extract the component information from this node.
*/
Expand All @@ -123,7 +113,6 @@ protected void createCommonInfo(DependencyTree node) {
addSection("Version:", generalInfo.getVersion());
addSection("Type:", StringUtils.capitalize(generalInfo.getPkgType()));
addSection("Path:", generalInfo.getPath());
addLicenses(node.getLicenses());
refreshPanel();
}

Expand All @@ -143,36 +132,4 @@ protected void refreshPanel() {
componentDetailsPanel.pack();
}

/**
* Add licenses to panel.
*
* @param licenses - The licenses to add.
*/
private void addLicenses(Set<License> licenses) {
if (licenses.isEmpty()) {
return;
}
createLabel(componentDetailsPanel, "Licenses:");
Panel licensesPanel = new Panel(componentDetailsPanel);
licensesPanel.setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create());
licenses.forEach(license -> {
if (CollectionUtils.isEmpty(license.getMoreInfoUrl())) {
// Add a license without URL.
createLabel(licensesPanel, Utils.createLicenseString(license));
} else {
// Add a license with URL.
addHyperlink(licensesPanel, Utils.createLicenseString(license), license.getMoreInfoUrl().get(0));
}
});
}

private static void addHyperlink(Panel parent, String text, String url) {
Link link = new Link(parent, SWT.NONE);
link.setText("<A>" + text + "</A>");
link.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
Program.launch(url);
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public abstract class FilterDialog extends Dialog {
* Construct a filter dialog.
*
* @param parentShell - The shell that will contain the dialog.
* @param title - Filter dialog title - "Severity" or "License".
* @param title - Filter dialog title - "Severity".
* @param selectAllState - The state of "All" checkbox.
*/
public FilterDialog(Shell parentShell, String title, MutableBoolean selectAllState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
import com.jfrog.ide.eclipse.ui.issues.ComponentIssueDetails;
import com.jfrog.ide.eclipse.ui.issues.IssuesTab;
import com.jfrog.ide.eclipse.ui.issues.IssuesTree;
import com.jfrog.ide.eclipse.ui.licenses.ComponentLicenseDetails;
import com.jfrog.ide.eclipse.ui.licenses.LicensesTab;
import com.jfrog.ide.eclipse.ui.licenses.LicensesTree;

/**
* The entry point of the plug-in. Creates the UI and perform a quick scan if
Expand All @@ -41,7 +38,6 @@ private void createTabs(Composite parent, XrayScanToolbar xrayScanToolbar) {
tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));

new IssuesTab(tabFolder);
new LicensesTab(tabFolder);
tabFolder.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
xrayScanToolbar.setFilterType(FilterType.values()[tabFolder.getSelectionIndex()]);
Expand All @@ -59,9 +55,7 @@ private void doQuickScan(Composite parent) {
@PreDestroy
public void dispose() {
ComponentIssueDetails.disposeComponentDetails();
ComponentLicenseDetails.disposeComponentDetails();
IssuesTree.disposeTree();
LicensesTree.disposeTree();
IconManager.dispose();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.jfrog.ide.eclipse.utils.ProjectsMap;

/**
* Base class for the issues and licenses trees.
* Base class for the issues tree.
*
* @author yahavi
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.ToolBar;
import com.jfrog.ide.eclipse.ui.issues.IssuesTree;
import com.jfrog.ide.eclipse.ui.licenses.LicensesTree;

/**
* Collapse the issue/licenses tree.
* Collapse the issues tree.
*
* @author yahavi
*/
Expand All @@ -19,6 +18,5 @@ public CollapseAll(ToolBar toolBar) {
@Override
public void execute(SelectionEvent event) {
IssuesTree.getInstance().collapseAll();
LicensesTree.getInstance().collapseAll();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.ToolBar;
import com.jfrog.ide.eclipse.ui.issues.IssuesTree;
import com.jfrog.ide.eclipse.ui.licenses.LicensesTree;

/**
* Expand the issue/licenses tree.
* Expand the issues tree.
*
* @author yahavi
*/
Expand All @@ -19,6 +17,5 @@ public ExpandAll(ToolBar toolBar) {
@Override
public void execute(SelectionEvent event) {
IssuesTree.getInstance().expandAll();
LicensesTree.getInstance().expandAll();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.ToolBar;
import com.jfrog.ide.eclipse.ui.issues.IssuesFilterDialog;
import com.jfrog.ide.eclipse.ui.licenses.LicensesFilterDialog;

/**
* Open the filter dialog.
Expand All @@ -13,7 +12,7 @@
public class Filter extends Action {

public enum FilterType {
Severity, License
Severity
}

private FilterType filterType = FilterType.Severity;
Expand All @@ -27,8 +26,6 @@ public Filter(ToolBar toolBar) {
public void execute(SelectionEvent event) {
if (filterType == FilterType.Severity) {
new IssuesFilterDialog(getDisplay().getActiveShell(), "Severities").open();
} else {
new LicensesFilterDialog(getDisplay().getActiveShell(), "Licenses").open();
}
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading