Skip to content

Commit

Permalink
Bug 558677 append user export to LOC ui
Browse files Browse the repository at this point in the history
 - `loc.report.ui`: org.eclipse.osgi dependency lost precise version
(3.15.200) as it looks like we use different target platform on CI
 - ui listeners and providers are reimplemented on function-base
 - `loc.report.core` and `loc.report.ui` plug-ins are included into
`dashboard` feature

Signed-off-by: elena.parovyshnaya <[email protected]>
  • Loading branch information
eparovyshnaya committed Feb 24, 2020
1 parent 4cb1664 commit 464e87d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.passage.loc.yars.api;bundle-version="0.1.0";visibility:=reexport,
org.eclipse.passage.loc.report.core;bundle-version="0.1.0",
org.eclipse.passage.lic.users;bundle-version="0.5.0",
org.eclipse.jface,
org.eclipse.jface;bundle-version="3.19.0",
org.eclipse.osgi.services;bundle-version="3.8.0",
org.eclipse.passage.lic.products;bundle-version="0.5.200",
org.eclipse.osgi;bundle-version="3.15.200"
org.eclipse.osgi
Export-Package: org.eclipse.passage.loc.report.internal.ui.jface;x-internal:=true
Bundle-ActivationPolicy: lazy
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,15 @@
import java.util.stream.Collectors;

import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.ICheckStateProvider;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.passage.lic.products.ProductDescriptor;
import org.eclipse.passage.loc.report.internal.ui.i18n.ExportCustomersWizardMessages;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
Expand Down Expand Up @@ -109,32 +106,23 @@ private void createButtons(Composite content) {
all.setText(ExportCustomersWizardMessages.ScopePage_selectAll);
none = new Button(controls, SWT.PUSH);
none.setText(ExportCustomersWizardMessages.ScopePage_selctNone);
all.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Arrays.stream(products).forEach(selected::add);
viewer.refresh();
updateControls();
}
});
none.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
selected.clear();
viewer.refresh();
updateControls();
}
});
viewer.addCheckStateListener(new ICheckStateListener() {
@Override
public void checkStateChanged(CheckStateChangedEvent event) {
if (event.getChecked()) {
selected.add((ProductDescriptor) event.getElement());
} else {
selected.remove(event.getElement());
}
updateControls();
all.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
Arrays.stream(products).forEach(selected::add);
viewer.refresh();
updateControls();
}));
none.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
selected.clear();
viewer.refresh();
updateControls();
}));
viewer.addCheckStateListener(e -> {
if (e.getChecked()) {
selected.add((ProductDescriptor) e.getElement());
} else {
selected.remove(e.getElement());
}
updateControls();
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.passage.loc.report.internal.ui.i18n.ExportCustomersWizardMessages;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
Expand Down Expand Up @@ -71,12 +68,7 @@ boolean open() {
private void createPath(Composite content) {
path = new Text(content, SWT.READ_ONLY | SWT.BORDER);
path.setLayoutData(new GridData(GridData.FILL, SWT.TOP, true, false));
path.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
updateControls();
}
});
path.addModifyListener(e -> updateControls());
}

private void updateControls() {
Expand All @@ -93,14 +85,11 @@ private void createBrowseForPath(Composite content) {
Button browse = new Button(content, SWT.PUSH);
browse.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false));
browse.setText(ExportCustomersWizardMessages.TargetPage_browse);
browse.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
DirectoryDialog dialog = new DirectoryDialog(getShell());
dialog.setFilterPath(path.getText());
Optional.ofNullable(dialog.open()).ifPresent(path::setText);
}
});
browse.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
DirectoryDialog dialog = new DirectoryDialog(getShell());
dialog.setFilterPath(path.getText());
Optional.ofNullable(dialog.open()).ifPresent(path::setText);
}));
}

}
15 changes: 15 additions & 0 deletions features/org.eclipse.passage.loc.dashboard.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,19 @@
version="0.0.0"
unpack="false"/>

<plugin
id="org.eclipse.passage.loc.report.core"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

<plugin
id="org.eclipse.passage.loc.report.ui"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>


</feature>

0 comments on commit 464e87d

Please sign in to comment.