use of org.eclipse.linuxtools.internal.rpm.createrepo.dnd.ImportRPMDropListener in project linuxtools by eclipse.
the class ImportRPMsPage method createFormContent.
@Override
protected void createFormContent(IManagedForm managedForm) {
// setting up the form page
super.createFormContent(managedForm);
GridLayout layout = new GridLayout();
FormToolkit toolkit = managedForm.getToolkit();
ScrolledForm form = managedForm.getForm();
form.setText(Messages.ImportRPMsPage_formHeaderText);
form.setImage(Activator.getImageDescriptor(HEADER_ICON).createImage());
ToolBarManager toolbarManager = (ToolBarManager) form.getToolBarManager();
toolkit.decorateFormHeading(form.getForm());
// add the menuContribution from MANIFEST.MF to the form
IMenuService menuService = getSite().getService(IMenuService.class);
menuService.populateContributionManager(toolbarManager, MENU_URI);
toolbarManager.update(true);
layout = new GridLayout(2, true);
layout.marginWidth = 6;
layout.marginHeight = 12;
form.getBody().setLayout(layout);
// Section and its client area to manage importing the RPMs
Section rpmSection = toolkit.createSection(form.getBody(), Section.DESCRIPTION | ExpandableComposite.TITLE_BAR);
layout = new GridLayout();
rpmSection.setText(Messages.ImportRPMsPage_sectionTitle);
rpmSection.setDescription(Messages.ImportRPMsPage_sectionInstruction);
rpmSection.setLayoutData(expandComposite());
// the client area containing the tree + buttons
Composite sectionClient = toolkit.createComposite(rpmSection);
layout = new GridLayout(2, false);
layout.marginWidth = 1;
layout.marginHeight = 7;
sectionClient.setLayout(layout);
TreeViewer viewer = new TreeViewer(sectionClient, SWT.BORDER | SWT.MULTI | SWT.HORIZONTAL | SWT.VERTICAL | SWT.LEFT_TO_RIGHT | SWT.SMOOTH);
viewer.addDropSupport(DND.DROP_COPY, new Transfer[] { FileTransfer.getInstance() }, new ImportRPMDropListener(viewer, project));
tree = viewer.getTree();
tree.setLayoutData(expandComposite());
Composite buttonList = toolkit.createComposite(sectionClient);
layout = new GridLayout();
GridData data = new GridData(SWT.BEGINNING, SWT.FILL, false, true);
layout.marginWidth = 0;
layout.marginHeight = 0;
buttonList.setLayout(layout);
buttonList.setLayoutData(data);
createPushButton(buttonList, Messages.ImportRPMsPage_buttonImportRPMs, toolkit).addSelectionListener(new ImportButtonListener());
createPushButton(buttonList, Messages.ImportRPMsPage_buttonRemoveRPMs, toolkit).addSelectionListener(new RemoveButtonListener());
new Label(buttonList, SWT.NONE).setLayoutData(new GridData(0, 0));
createPushButton(buttonList, Messages.ImportRPMsPage_buttonCreateRepo, toolkit).addSelectionListener(new CreaterepoButtonListener());
refreshTree();
rpmSection.setClient(sectionClient);
managedForm.refresh();
}
Aggregations