use of org.eclipse.scout.rt.client.ui.basic.filechooser.FileChooser in project scout.rt by eclipse.
the class AbstractFileChooserField method getFileChooser.
/**
* @deprecated The UI will display the native file chooser dialog on click. There is no {@link FileChooser} created on
* java side anymore. Will be removed with 7.0
*/
@Deprecated
@Override
public IFileChooser getFileChooser() {
FileChooser fileChooser = new FileChooser(getFileExtensions(), false);
fileChooser.setMaximumUploadSize(getMaximumUploadSize());
return fileChooser;
}
use of org.eclipse.scout.rt.client.ui.basic.filechooser.FileChooser in project scout.rt by eclipse.
the class AbstractForm method doImportXml.
@Override
public void doImportXml() {
try {
List<BinaryResource> a = new FileChooser(Collections.singletonList("xml"), false).startChooser();
if (a.size() == 1) {
BinaryResource newPath = a.get(0);
try (InputStream in = new ByteArrayInputStream(newPath.getContent())) {
// NOSONAR
Document doc = XmlUtility.getXmlDocument(in);
// load xml to search
loadFromXml(doc.getDocumentElement());
} catch (Exception e) {
LOG.warn("Could not load XML from file: {}", newPath, e);
MessageBoxes.createOk().withDisplayParent(this).withHeader(TEXTS.get("LoadFormXmlFailedText")).show();
}
}
} catch (Exception e) {
BEANS.get(ExceptionHandler.class).handle(e);
}
}
Aggregations