Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 255870 Details for
Bug 473803
Papyrus versions 1.1.0, 1.1.1, 1.1.2, 1.1.3 and 2.0.0 fail to export diagrams as images (Eclipse Neon and Mars)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Code Fix for "Export All Diagrams" issue.
ExportComposite.java (text/plain), 6.58 KB, created by
Fred Eckertson
on 2015-08-14 15:53:05 EDT
(
hide
)
Description:
Code Fix for "Export All Diagrams" issue.
Filename:
MIME Type:
Creator:
Fred Eckertson
Created:
2015-08-14 15:53:05 EDT
Size:
6.58 KB
patch
obsolete
>/******************************************************************************* > * Copyright (c) 2011 AtoS > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: > * Anass RADOUANI (AtoS) > *******************************************************************************/ > >package org.eclipse.papyrus.infra.gmfdiag.export.actions; > >import org.eclipse.core.resources.IFile; >import org.eclipse.core.resources.IFolder; >import org.eclipse.core.resources.IResource; >import org.eclipse.core.resources.ResourcesPlugin; >import org.eclipse.core.runtime.CoreException; >import org.eclipse.core.runtime.IPath; >import org.eclipse.core.runtime.Path; >import org.eclipse.emf.common.util.URI; >import org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat; >import org.eclipse.jface.window.Window; >import org.eclipse.papyrus.infra.gmfdiag.export.Activator; >import org.eclipse.papyrus.infra.gmfdiag.export.messages.Messages; >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.SelectionAdapter; >import org.eclipse.swt.events.SelectionEvent; >import org.eclipse.swt.layout.GridData; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Combo; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Label; >import org.eclipse.swt.widgets.Text; >import org.eclipse.ui.dialogs.ContainerSelectionDialog; > >/** > * ExportAll configuration windows > */ >public class ExportComposite extends Composite { > > // SWT Objects > private Text outputPathTxt; > > private Button outputDirectoryBtn; > > private Combo outputFormatCb; > > private Button btnCheckButton; > > // Configured items > protected IResource outputDirectory; > > protected String exporter; > > protected boolean qualifiedName; > > private URI uriDiagramFile; > > /** > * Constructor > * > * @param parent > * @param style > */ > public ExportComposite(Composite parent, int style) { > super(parent, style); > createDialogComposite(); > createDialogContents(); > hookListeners(); > } > > /** > * Create the view of the list of interaction operators > * > * @param parent > * the parent composite to contain this group > */ > protected void createDialogContents() { > Composite composite = new Composite(this, SWT.NONE); > GridLayout layout = new GridLayout(); > layout.numColumns = 3; > composite.setLayout(layout); > composite.setFont(this.getFont()); > composite.setLayoutData(new GridData(GridData.FILL_BOTH)); > > Label editorConfLbl = new Label(composite, SWT.NONE); > editorConfLbl.setText(Messages.ExportAllDiagramsDialog_0); > outputPathTxt = new Text(composite, SWT.BORDER); > outputPathTxt.setEnabled(false); > outputPathTxt.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > > outputDirectoryBtn = new Button(composite, SWT.NONE); > outputDirectoryBtn.setText(Messages.ExportAllDiagramsDialog_1); > > Label outputFormatLbl = new Label(composite, SWT.NONE); > outputFormatLbl.setText(Messages.ExportAllDiagramsDialog_2); > > outputFormatCb = new Combo(composite, SWT.NONE); > GridData gridData2 = new GridData(GridData.FILL_HORIZONTAL); > gridData2.horizontalSpan = 2; > outputFormatCb.setLayoutData(gridData2); > > btnCheckButton = new Button(this, SWT.CHECK); > btnCheckButton.setText(Messages.ExportAllDiagramsDialog_btnCheckButton_text); > > } > > /** > * Create the Dialog Contents > */ > private void createDialogComposite() { > GridLayout dialogLayout = new GridLayout(); > GridData dialogLayoutData = new GridData(GridData.FILL_BOTH); > this.setLayout(dialogLayout); > this.setLayoutData(dialogLayoutData); > } > > private void hookListeners() { > btnCheckButton.addSelectionListener(new SelectionAdapter() { > > @Override > public void widgetSelected(SelectionEvent e) { > qualifiedName = btnCheckButton.getSelection(); > } > }); > > outputDirectoryBtn.addSelectionListener(new SelectionAdapter() { > > @Override > public void widgetSelected(SelectionEvent e) { > ContainerSelectionDialog csDialog = new ContainerSelectionDialog(Activator.getActiveWorkbenchShell(), ResourcesPlugin.getWorkspace().getRoot(), true, Messages.ExportAllDiagramsDialog_3); > > > if (csDialog.open() == Window.OK) { > Object[] results = csDialog.getResult(); > if (results.length == 1 && results[0] instanceof IPath) { > URI uri = URI.createPlatformResourceURI(((IPath) results[0]).toString(), true); > outputDirectory = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(uri.toPlatformString(true))); > outputPathTxt.setText(outputDirectory.getLocation().toString()); > } > } > } > }); > > outputFormatCb.addSelectionListener(new SelectionAdapter() { > > @Override > public void widgetSelected(SelectionEvent e) { > exporter = outputFormatCb.getText(); > } > }); > } > > /** > * set the file from which diagrams will be exported > * > * @param file > */ > public void setSelectedDiagramFileURI(URI uriFile) { > uriDiagramFile = uriFile; > loadData(); > } > > private void loadData() { > if (uriDiagramFile != null) { > IPath location = new Path(uriDiagramFile.toPlatformString(true)); > outputDirectory = ResourcesPlugin.getWorkspace().getRoot().findMember(location.makeRelativeTo(ResourcesPlugin.getWorkspace().getRoot().getLocation())); > if (outputDirectory == null){ > try { > IResource[] members = ResourcesPlugin.getWorkspace().getRoot().members(); > for (int idx = 0; idx < members.length; idx++) { > if (members[idx].getLocation().equals(location)) { > outputDirectory = members[idx]; > break; > } > } > } catch (CoreException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } > } > outputPathTxt.setText(location.toString()); > } > for (ImageFileFormat imageFileFormat : ImageFileFormat.VALUES) { > outputFormatCb.add(imageFileFormat.toString()); > } > > outputFormatCb.setText(ImageFileFormat.getDefaultImageFormat().toString()); > > exporter = outputFormatCb.getText(); > } > > /** > * return the output directory where exported diagrams will be saved > * > * @return > */ > public IResource getOutputDirectory() { > return outputDirectory; > } > > /** > * return the path to the output directory > * > * @return > */ > public String getExporter() { > return exporter; > } > > /** > * return the qualified name of the diagram > * > * @return > */ > public boolean getQualifiedName() { > return qualifiedName; > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
fred.eckertson
:
review?
Actions:
View
|
Diff
Attachments on
bug 473803
:
255501
| 255870