From 26dadd9389db2401c5ba59c37ead77d75b912ee5 Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Mon, 22 Aug 2016 10:55:05 +0000 Subject: [PATCH] refs #6653 Initial commit for org.simantics.fileimport enabling easy drag and drop import for supported file extensions (e.g. .r, .fmu etc) git-svn-id: https://www.simantics.org/svn/simantics/r/trunk@33128 ac1ea38d-2e2b-0410-8846-a27921b304fc --- org.simantics.r.fileimport/.classpath | 7 ++++ org.simantics.r.fileimport/.project | 33 ++++++++++++++++++ .../.settings/org.eclipse.jdt.core.prefs | 7 ++++ .../META-INF/MANIFEST.MF | 13 +++++++ .../OSGI-INF/component.xml | 7 ++++ .../simantics/r/fileimport/Activator.class | Bin 0 -> 794 bytes .../simantics/r/fileimport/RFileImport.class | Bin 0 -> 1433 bytes org.simantics.r.fileimport/build.properties | 5 +++ .../org/simantics/r/fileimport/Activator.java | 30 ++++++++++++++++ .../simantics/r/fileimport/RFileImport.java | 26 ++++++++++++++ 10 files changed, 128 insertions(+) create mode 100644 org.simantics.r.fileimport/.classpath create mode 100644 org.simantics.r.fileimport/.project create mode 100644 org.simantics.r.fileimport/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.simantics.r.fileimport/META-INF/MANIFEST.MF create mode 100644 org.simantics.r.fileimport/OSGI-INF/component.xml create mode 100644 org.simantics.r.fileimport/bin/org/simantics/r/fileimport/Activator.class create mode 100644 org.simantics.r.fileimport/bin/org/simantics/r/fileimport/RFileImport.class create mode 100644 org.simantics.r.fileimport/build.properties create mode 100644 org.simantics.r.fileimport/src/org/simantics/r/fileimport/Activator.java create mode 100644 org.simantics.r.fileimport/src/org/simantics/r/fileimport/RFileImport.java diff --git a/org.simantics.r.fileimport/.classpath b/org.simantics.r.fileimport/.classpath new file mode 100644 index 0000000..b862a29 --- /dev/null +++ b/org.simantics.r.fileimport/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.simantics.r.fileimport/.project b/org.simantics.r.fileimport/.project new file mode 100644 index 0000000..cee0871 --- /dev/null +++ b/org.simantics.r.fileimport/.project @@ -0,0 +1,33 @@ + + + org.simantics.r.fileimport + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.ds.core.builder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.simantics.r.fileimport/.settings/org.eclipse.jdt.core.prefs b/org.simantics.r.fileimport/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..295926d --- /dev/null +++ b/org.simantics.r.fileimport/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/org.simantics.r.fileimport/META-INF/MANIFEST.MF b/org.simantics.r.fileimport/META-INF/MANIFEST.MF new file mode 100644 index 0000000..a997db9 --- /dev/null +++ b/org.simantics.r.fileimport/META-INF/MANIFEST.MF @@ -0,0 +1,13 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Fileimport +Bundle-SymbolicName: org.simantics.r.fileimport +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.simantics.r.fileimport.Activator +Require-Bundle: org.eclipse.core.runtime, + org.simantics.fileimport, + org.simantics.r;bundle-version="0.1.0", + org.simantics.db +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-ActivationPolicy: lazy +Service-Component: OSGI-INF/component.xml diff --git a/org.simantics.r.fileimport/OSGI-INF/component.xml b/org.simantics.r.fileimport/OSGI-INF/component.xml new file mode 100644 index 0000000..109c9bf --- /dev/null +++ b/org.simantics.r.fileimport/OSGI-INF/component.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.simantics.r.fileimport/bin/org/simantics/r/fileimport/Activator.class b/org.simantics.r.fileimport/bin/org/simantics/r/fileimport/Activator.class new file mode 100644 index 0000000000000000000000000000000000000000..51895a1acc6116ee91639b2017192518f49f1c0b GIT binary patch literal 794 zcmah`%T60H6g@YYWMBx-q_h-T1OgPOgg4!lRw}4nMRd`My)!t$Fd0W42l%W4i%MPe z1Nu=F*G?2zK(nxYALpF=@ZW#G{{VQ8^%y0>ma$z?=$_1-P77g0M`ud+`o=o(Id%F{ zI%8u*goSf?DMcppuK3nISE-9pC2V@WDY{y8tn8^PV=u(vAV1C2m`#XNlRI_o7~Xmo ze>B8=AXE=@uH7d>xw(5nh>pyuN>IjZ4bw;n^DUjL<3X>j><`(_6k(}lQkk7dtGz!8 zM(#`(gq=`w(uiC(=_)sBg7?zgo!sg)2rp`gF-52pPFkLDyE&QXr%JwDr>gI?$%`1T z3H68djx&VWcG%^(t*CIO&*blBU{m##|B5g--t@lLzy^0!=2PL5_~!V#Ber>We9y2a z_$7WTd%sY-VWWgOzN;Zv#XQ@!Api?lWN!*fsB^@Vw?c*`Z_)V4{$uV;;FdT_SjJ1v zy<*!JUkTigZ24^E-5nYag_97hGq4c^mWQBGafV}+Tkt)v{ZEvh5M5=_wF#nc!W3`s E0at*bfB*mh literal 0 HcmV?d00001 diff --git a/org.simantics.r.fileimport/bin/org/simantics/r/fileimport/RFileImport.class b/org.simantics.r.fileimport/bin/org/simantics/r/fileimport/RFileImport.class new file mode 100644 index 0000000000000000000000000000000000000000..a9919ae46db69997705144f853ba6d91beda63b8 GIT binary patch literal 1433 zcmb_cTTc^F5dIDnwp~^(m5T~0c)=}~t{0GpHY5g%At|kC5qvY-awvzK?l!xp>d*4> zAo0N;;EyuS?zVJW#b{!awmWlXzWHY6JNx~|*KYteu%%&$VcGQ>mM@yNqeR`eJnKYA zE}AXZQ&we{p7+9M4GD&g{@7S#wF^+;zT5WdyqC$4epW1&j|$J<6kZ<`O4Yq`smd@> zJhR{0R$B>a?c1#!L#iqoj;-1rXV~mN%}1uRorYCao^TquUp?D|k<8bnaD>`s7&bG9 z42d20m?v?C?3JvS!~}y;Sr3>mn&imnn8H;JX@;2|pB-09URT0(d;`;%p&XxTO0Hao zxDq`xR=!+2qu@B9jwjRKL@ot}IRhgY4cZqDFSVOB?j6`QNiC;~ZrzrLwkHC+;~dS0 z-RKy`f`J>*sUvkNd$qlhH`Zyu5pE~}>!qzubMY3+ ztzaUyB*fbPz{wAE5a+U;({UH~HQZyEA8fR;Pdk;bNIA5gWjvtu)IDx19vv_g|D9fc zjW`t@8LVnpp$+vE(w&8YHLNq}?n$XFWwc21H{!Ttj-xHx0cvj2uUR9n}SZBG4iaEFZhh5jr90ACO>2LBbh_EM!!KCFple?Cj#px zT67kij;wsa{9uX^rWjEGZsHaNGTg=@0Y^NR!s;)`4p^pE*UoY09Oj3xQm=M81X_%O tIzSYTEQ0#M(?dKW5QfKiasj>(f@jGa#3Vjpb`W ALLOWED_EXTENSIONS = Collections.singletonMap("*.r", "R-file (*.r)"); + + @Override + public Optional perform(Resource parent, Path file) { + return Optional.ofNullable(RModelUtils.createRModel(parent, file)); + } + + @Override + public Map allowedExtensionsWithFilters() { + return ALLOWED_EXTENSIONS; + } + +} -- 2.47.1