SecoBlocks first commit.
diff --git a/org.eclipse.blockchain.ui/.classpath b/org.eclipse.blockchain.ui/.classpath
new file mode 100644
index 0000000..6c8f5dc
--- /dev/null
+++ b/org.eclipse.blockchain.ui/.classpath
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="lib/jfxswt.jar"/>
+ <classpathentry kind="lib" path="lib/abi-4.2.0.jar"/>
+ <classpathentry kind="lib" path="lib/bcprov-jdk15on-1.62.jar"/>
+ <classpathentry kind="lib" path="lib/core-4.2.0.jar"/>
+ <classpathentry kind="lib" path="lib/crypto-4.2.0.jar"/>
+ <classpathentry kind="lib" path="lib/jackson-annotations-2.2.3.jar"/>
+ <classpathentry kind="lib" path="lib/jackson-core-2.2.3.jar"/>
+ <classpathentry kind="lib" path="lib/jackson-databind-2.2.3.jar"/>
+ <classpathentry kind="lib" path="lib/reactive-streams-1.0.2.jar"/>
+ <classpathentry kind="lib" path="lib/rlp-4.2.0.jar"/>
+ <classpathentry kind="lib" path="lib/rxjava-2.2.9.jar"/>
+ <classpathentry kind="lib" path="lib/slf4j-api-1.7.26.jar"/>
+ <classpathentry kind="lib" path="lib/tuples-4.2.0.jar"/>
+ <classpathentry kind="lib" path="lib/utils-4.2.0.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="lib" path="lib/commons-io-2.4.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JavaFX"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.blockchain.ui/.project b/org.eclipse.blockchain.ui/.project
new file mode 100644
index 0000000..0d25b6e
--- /dev/null
+++ b/org.eclipse.blockchain.ui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.blockchain.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.blockchain.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.blockchain.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..295926d
--- /dev/null
+++ b/org.eclipse.blockchain.ui/.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.eclipse.blockchain.ui/META-INF/MANIFEST.MF b/org.eclipse.blockchain.ui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..ffeb9f1
--- /dev/null
+++ b/org.eclipse.blockchain.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,31 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Ui
+Bundle-SymbolicName: org.eclipse.blockchain.ui;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Automatic-Module-Name: org.eclipse.blockchain.ui
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.ui.views,
+ org.eclipse.core.runtime,
+ org.eclipse.blockchain.core,
+ org.eclipse.ui.ide,
+ org.eclipse.core.resources,
+ org.eclipse.core.expressions,
+ org.eclipse.swt,
+ org.eclipse.fx.ui.workbench3,
+ org.eclipse.ui.console,
+ org.eclipse.ui.workbench
+Bundle-ClassPath: lib/commons-io-2.4.jar,
+ lib/jfxswt.jar,
+ .
+Export-Package: org.eclipse.blockchain.ui.console,
+ org.eclipse.blockchain.ui.handlers,
+ org.eclipse.blockchain.ui.perspective,
+ org.eclipse.blockchain.ui.preference,
+ org.eclipse.blockchain.ui.property.testers,
+ org.eclipse.blockchain.ui.util,
+ org.eclipse.blockchain.ui.views,
+ org.eclipse.blockchain.ui.wizard
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.eclipse.blockchain.ui.Activator
diff --git a/org.eclipse.blockchain.ui/bin/.gitignore b/org.eclipse.blockchain.ui/bin/.gitignore
new file mode 100644
index 0000000..cf1db2e
--- /dev/null
+++ b/org.eclipse.blockchain.ui/bin/.gitignore
@@ -0,0 +1 @@
+/org/
diff --git a/org.eclipse.blockchain.ui/build.properties b/org.eclipse.blockchain.ui/build.properties
new file mode 100644
index 0000000..0e3f296
--- /dev/null
+++ b/org.eclipse.blockchain.ui/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ lib/commons-io-2.4.jar,\
+ icon/,\
+ lib/jfxswt.jar
diff --git a/org.eclipse.blockchain.ui/icon/eth-bc-16-16.png b/org.eclipse.blockchain.ui/icon/eth-bc-16-16.png
new file mode 100644
index 0000000..b74394f
--- /dev/null
+++ b/org.eclipse.blockchain.ui/icon/eth-bc-16-16.png
Binary files differ
diff --git a/org.eclipse.blockchain.ui/icon/eth.png b/org.eclipse.blockchain.ui/icon/eth.png
new file mode 100644
index 0000000..da216e1
--- /dev/null
+++ b/org.eclipse.blockchain.ui/icon/eth.png
Binary files differ
diff --git a/org.eclipse.blockchain.ui/icon/import.png b/org.eclipse.blockchain.ui/icon/import.png
new file mode 100644
index 0000000..8841bf5
--- /dev/null
+++ b/org.eclipse.blockchain.ui/icon/import.png
Binary files differ
diff --git a/org.eclipse.blockchain.ui/icon/sol.png b/org.eclipse.blockchain.ui/icon/sol.png
new file mode 100644
index 0000000..0c9abc3
--- /dev/null
+++ b/org.eclipse.blockchain.ui/icon/sol.png
Binary files differ
diff --git a/org.eclipse.blockchain.ui/lib/abi-4.2.0.jar b/org.eclipse.blockchain.ui/lib/abi-4.2.0.jar
new file mode 100644
index 0000000..e11a957
--- /dev/null
+++ b/org.eclipse.blockchain.ui/lib/abi-4.2.0.jar
Binary files differ
diff --git a/org.eclipse.blockchain.ui/lib/bcprov-jdk15on-1.62.jar b/org.eclipse.blockchain.ui/lib/bcprov-jdk15on-1.62.jar
new file mode 100644
index 0000000..c52b16e
--- /dev/null
+++ b/org.eclipse.blockchain.ui/lib/bcprov-jdk15on-1.62.jar
Binary files differ
diff --git a/org.eclipse.blockchain.ui/lib/commons-io-2.4.jar b/org.eclipse.blockchain.ui/lib/commons-io-2.4.jar
new file mode 100644
index 0000000..90035a4
--- /dev/null
+++ b/org.eclipse.blockchain.ui/lib/commons-io-2.4.jar
Binary files differ
diff --git a/org.eclipse.blockchain.ui/lib/core-4.2.0.jar b/org.eclipse.blockchain.ui/lib/core-4.2.0.jar
new file mode 100644
index 0000000..a416f42
--- /dev/null
+++ b/org.eclipse.blockchain.ui/lib/core-4.2.0.jar
Binary files differ
diff --git a/org.eclipse.blockchain.ui/lib/crypto-4.2.0.jar b/org.eclipse.blockchain.ui/lib/crypto-4.2.0.jar
new file mode 100644
index 0000000..90cb362
--- /dev/null
+++ b/org.eclipse.blockchain.ui/lib/crypto-4.2.0.jar
Binary files differ
diff --git a/org.eclipse.blockchain.ui/lib/jackson-annotations-2.2.3.jar b/org.eclipse.blockchain.ui/lib/jackson-annotations-2.2.3.jar
new file mode 100644
index 0000000..b62c87d
--- /dev/null
+++ b/org.eclipse.blockchain.ui/lib/jackson-annotations-2.2.3.jar
Binary files differ
diff --git a/org.eclipse.blockchain.ui/lib/jackson-core-2.2.3.jar b/org.eclipse.blockchain.ui/lib/jackson-core-2.2.3.jar
new file mode 100644
index 0000000..24318a4
--- /dev/null
+++ b/org.eclipse.blockchain.ui/lib/jackson-core-2.2.3.jar
Binary files differ
diff --git a/org.eclipse.blockchain.ui/lib/jackson-databind-2.2.3.jar b/org.eclipse.blockchain.ui/lib/jackson-databind-2.2.3.jar
new file mode 100644
index 0000000..8545084
--- /dev/null
+++ b/org.eclipse.blockchain.ui/lib/jackson-databind-2.2.3.jar
Binary files differ
diff --git a/org.eclipse.blockchain.ui/lib/jfxswt.jar b/org.eclipse.blockchain.ui/lib/jfxswt.jar
new file mode 100644
index 0000000..7bdbe5c
--- /dev/null
+++ b/org.eclipse.blockchain.ui/lib/jfxswt.jar
Binary files differ
diff --git a/org.eclipse.blockchain.ui/lib/reactive-streams-1.0.2.jar b/org.eclipse.blockchain.ui/lib/reactive-streams-1.0.2.jar
new file mode 100644
index 0000000..8e8a9ce
--- /dev/null
+++ b/org.eclipse.blockchain.ui/lib/reactive-streams-1.0.2.jar
Binary files differ
diff --git a/org.eclipse.blockchain.ui/lib/rlp-4.2.0.jar b/org.eclipse.blockchain.ui/lib/rlp-4.2.0.jar
new file mode 100644
index 0000000..7ca7023
--- /dev/null
+++ b/org.eclipse.blockchain.ui/lib/rlp-4.2.0.jar
Binary files differ
diff --git a/org.eclipse.blockchain.ui/lib/rxjava-2.2.9.jar b/org.eclipse.blockchain.ui/lib/rxjava-2.2.9.jar
new file mode 100644
index 0000000..7db6f13
--- /dev/null
+++ b/org.eclipse.blockchain.ui/lib/rxjava-2.2.9.jar
Binary files differ
diff --git a/org.eclipse.blockchain.ui/lib/slf4j-api-1.7.26.jar b/org.eclipse.blockchain.ui/lib/slf4j-api-1.7.26.jar
new file mode 100644
index 0000000..d2f27ac
--- /dev/null
+++ b/org.eclipse.blockchain.ui/lib/slf4j-api-1.7.26.jar
Binary files differ
diff --git a/org.eclipse.blockchain.ui/lib/tuples-4.2.0.jar b/org.eclipse.blockchain.ui/lib/tuples-4.2.0.jar
new file mode 100644
index 0000000..2daf253
--- /dev/null
+++ b/org.eclipse.blockchain.ui/lib/tuples-4.2.0.jar
Binary files differ
diff --git a/org.eclipse.blockchain.ui/lib/utils-4.2.0.jar b/org.eclipse.blockchain.ui/lib/utils-4.2.0.jar
new file mode 100644
index 0000000..f3c7ce4
--- /dev/null
+++ b/org.eclipse.blockchain.ui/lib/utils-4.2.0.jar
Binary files differ
diff --git a/org.eclipse.blockchain.ui/plugin.xml b/org.eclipse.blockchain.ui/plugin.xml
new file mode 100644
index 0000000..fc8d52d
--- /dev/null
+++ b/org.eclipse.blockchain.ui/plugin.xml
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category
+ id="org.eclipse.blockchain.ui.project.category"
+ name="Ethereum">
+ </category>
+ <wizard
+ category="org.eclipse.blockchain.ui.project.category"
+ class="org.eclipse.blockchain.ui.wizard.EthereumProjectWizard"
+ icon="icon/eth.png"
+ id="org.eclipse.blockchain.ui.project.wizard"
+ name="Ethereum Project"
+ project="true">
+ </wizard>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
+ <toolbar
+ id="org.eclipse.blockchain.ui.toolbar.project"
+ label="Import Project">
+ <command
+ commandId="org.eclipse.blockchain.ui.command.importproject"
+ icon="icon/import.png"
+ id="org.eclipse.blockchain.ui.command.importproject.id"
+ label="Import Project"
+ style="push">
+ </command>
+ </toolbar>
+ <toolbar
+ id="org.eclipse.blockchain.ui.toolbar.compiler"
+ label="Solidity Compiler">
+ <command
+ commandId="org.eclipse.blockchain.core.solidity.compile"
+ icon="icon/sol.png"
+ label="Compiler"
+ style="push">
+ </command>
+ </toolbar>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ id="org.eclipse.blockchain.ui.command.importproject"
+ name="Import Project">
+ </command>
+ <command
+ id="org.eclipse.blockchain.core.solidity.compile"
+ name="Solidity compiler Preference shortcut">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.blockchain.ui.handlers.ImportProjectHandler"
+ commandId="org.eclipse.blockchain.ui.command.importproject">
+ </handler>
+ <handler
+ class="org.eclipse.blockchain.ui.handlers.SolidityCompilerPreferenceHandler"
+ commandId="org.eclipse.blockchain.core.solidity.compile">
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.blockchain.ui.property.testers.EthereumProjectPropertyTester"
+ id="org.eclipse.blockchain.ui.ethereum.project.tester"
+ namespace="org.eclipse.blockchain.ui.ethereum.project.tester"
+ properties="ethProject"
+ type="org.eclipse.core.resources.IProject">
+ </propertyTester>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectives">
+ <perspective
+ class="org.eclipse.blockchain.ui.perspective.BlockChainPerspectiveFactory"
+ id="org.eclipse.blockchain.ui.perspective"
+ name="BlockChain Perspective">
+ </perspective>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ category="org.eclipse.blockchain.ui.blockchain"
+ class="org.eclipse.blockchain.ui.views.TransactionsViewPart"
+ icon="icon/eth-bc-16-16.png"
+ id="org.eclipse.blockchain.ui.transactionView"
+ name="Deploy View"
+ restorable="true">
+ </view>
+ <category
+ id="org.eclipse.blockchain.ui.blockchain"
+ name="blockchain">
+ </category>
+ <view
+ category="org.eclipse.blockchain.ui.blockchain"
+ class="org.eclipse.blockchain.ui.views.EtherAccountViewPart"
+ icon="icon/eth-bc-16-16.png"
+ id="org.eclipse.blockchain.ui.accountsView"
+ name="Accounts View"
+ restorable="true">
+ </view>
+ <view
+ category="org.eclipse.blockchain.ui.blockchain"
+ class="org.eclipse.blockchain.ui.views.TransactionHistoryView"
+ icon="icon/eth-bc-16-16.png"
+ id="org.eclipse.blockchain.ui.TransactionHistoryView"
+ name="Transaction View"
+ restorable="true">
+ </view>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.eclipse.blockchain.ui.perspective">
+ <view
+ id="org.eclipse.blockchain.ui.accountsView"
+ minimized="false"
+ ratio="0.75"
+ relationship="bottom"
+ relative="org.eclipse.ui.navigator.ProjectExplorer">
+ </view>
+ </perspectiveExtension>
+ </extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ class="org.eclipse.blockchain.ui.preference.SolidityCompilerPreference"
+ id="org.eclipse.blockchain.ui.solidity.compiler.preference"
+ name="Solidity Compiler">
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.ui.startup">
+ <startup
+ class="org.eclipse.blockchain.ui.perspective.PerspectiveStartup">
+ </startup>
+ </extension>
+ <extension
+ point="org.eclipse.ui.console.consoleFactories">
+ <consoleFactory
+ class="org.eclipse.blockchain.ui.console.EtherConsoleFactory"
+ label="Ether Console View">
+ </consoleFactory>
+ </extension>
+</plugin>
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/Activator.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/Activator.java
new file mode 100644
index 0000000..592d6e0
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/Activator.java
@@ -0,0 +1,32 @@
+package org.eclipse.blockchain.ui;
+
+import org.eclipse.blockchain.core.BlockchainViewsRegistry;
+import org.eclipse.blockchain.ui.views.TransactionHistoryView;
+import org.eclipse.swt.SWT;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+import javafx.embed.swt.FXCanvas;
+
+
+/**
+ * @author ADG5COB -
+ */
+public class Activator extends AbstractUIPlugin {
+
+ /**
+ * The plugin id
+ */
+ public static final String PLUGIN_ID = "org.eclipse.blockchain.ui";
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void start(final BundleContext context) throws Exception {
+ super.start(context);
+ new FXCanvas(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.NONE);
+ BlockchainViewsRegistry.registerBlockchainView(new TransactionHistoryView());
+ }
+}
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/console/EtherConsoleFactory.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/console/EtherConsoleFactory.java
new file mode 100644
index 0000000..ccf6a2f
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/console/EtherConsoleFactory.java
@@ -0,0 +1,58 @@
+package org.eclipse.blockchain.ui.console;
+
+import org.eclipse.blockchain.core.log.EthereumLogService;
+import org.eclipse.blockchain.core.log.EthereumLogger;
+import org.eclipse.ui.console.ConsolePlugin;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleFactory;
+import org.eclipse.ui.console.IConsoleManager;
+import org.eclipse.ui.console.MessageConsole;
+
+
+/**
+ * @author PKI8COB
+ */
+public class EtherConsoleFactory implements IConsoleFactory {
+
+ /**
+ * The only instance of this class
+ */
+ private static EtherConsoleFactory instance;
+ public final IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
+ private MessageConsole fConsole = null;
+
+ /**
+ * @return the only instance of this class.
+ */
+ public static synchronized EtherConsoleFactory getInstance() {
+ if (null == instance) {
+ instance = new EtherConsoleFactory();
+ }
+ return instance;
+ }
+
+
+ @Override
+ public void openConsole() {
+ MessageConsole console = getConsole();
+
+ boolean exists = false;
+ for (IConsole existingConsole : this.consoleManager.getConsoles()) {
+ if (console == existingConsole) {
+ exists = true;
+ }
+ }
+ if (!exists) {
+ this.consoleManager.addConsoles(new IConsole[] { console });
+ }
+ EthereumLogService.INSTANCE.addIEthereumLogger(new EthereumLogger(getConsole()));
+ }
+
+ public MessageConsole getConsole() {
+ if (this.fConsole == null) {
+ this.fConsole = new MessageConsole("Eth Console", "ethConsole", null, true);
+ }
+ return this.fConsole;
+ }
+
+}
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/handlers/ImportProjectHandler.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/handlers/ImportProjectHandler.java
new file mode 100644
index 0000000..47fc148
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/handlers/ImportProjectHandler.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) Robert Bosch GmbH. All rights reserved.
+ */
+package org.eclipse.blockchain.ui.handlers;
+
+import org.eclipse.blockchain.ui.wizard.EthereumProjectWizard;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author DMU1COB
+ */
+public class ImportProjectHandler extends AbstractHandler {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ Display.getDefault().asyncExec(() -> {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ EthereumProjectWizard impotWizard = new EthereumProjectWizard();
+ impotWizard.init(workbench, null);
+ WizardDialog dialog = new WizardDialog(workbench.getActiveWorkbenchWindow().getShell(), impotWizard);
+ dialog.open();
+ });
+ return "";
+ }
+
+}
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/handlers/SolidityCompilerPreferenceHandler.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/handlers/SolidityCompilerPreferenceHandler.java
new file mode 100644
index 0000000..0e5d875
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/handlers/SolidityCompilerPreferenceHandler.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) Robert Bosch GmbH. All rights reserved.
+ */
+package org.eclipse.blockchain.ui.handlers;
+
+import org.eclipse.blockchain.ui.preference.SolidityCompilerPreference;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+
+/**
+ * @author DMU1COB
+ */
+public class SolidityCompilerPreferenceHandler extends AbstractHandler {
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ Display.getDefault().asyncExec(() -> {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ SolidityCompilerPreference page = new SolidityCompilerPreference();
+ page.init(workbench);
+ PreferenceDialog dialog =
+ PreferencesUtil.createPreferenceDialogOn(workbench.getActiveWorkbenchWindow().getShell(),
+ "org.eclipse.blockchain.ui.solidity.compiler.preference", null, null);
+ dialog.open();
+
+ });
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/perspective/BlockChainPerspectiveFactory.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/perspective/BlockChainPerspectiveFactory.java
new file mode 100644
index 0000000..9cd7ddb
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/perspective/BlockChainPerspectiveFactory.java
@@ -0,0 +1,58 @@
+package org.eclipse.blockchain.ui.perspective;
+
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+
+/**
+ * @author PKI8COB
+ */
+public class BlockChainPerspectiveFactory implements IPerspectiveFactory {
+
+ /**
+ * The id of the Blockchain perspective
+ */
+ public static final String BLOCKCHAIN_PERSPECTIVE = "org.eclipse.blockchain.ui.perspective";
+
+ public static final String RUN_TIME_VIEWID = "org.eclipse.blockchain.ui.runtimeView";
+
+ public static final String TRANSACTION_VIEWID = "org.eclipse.blockchain.ui.transactionView";
+
+ public static final String COMPILE_TIME_VIEWID = "org.eclipse.blockchain.ui.compileView";
+
+ public static final String CONSOLE_VIEW = "org.eclipse.ui.console.ConsoleView";
+
+ public static final String SERVER_VIEW = "org.eclipse.wst.server.ui.ServersView";
+
+ public static final String ERROR_LOG_VIEW = "org.eclipse.pde.runtime.LogView";
+
+ private final String TRANSACTION_VIEW_ID = "org.eclipse.blockchain.ui.TransactionHistoryView";
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void createInitialLayout(final IPageLayout layout) {
+ String editorArea = layout.getEditorArea();
+
+ IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT, 0.25f, editorArea);
+ left.addView(IPageLayout.ID_PROJECT_EXPLORER);
+
+ IFolderLayout rightLayout = layout.createFolder("rightLayout", IPageLayout.RIGHT, 0.75f, editorArea);
+ rightLayout.addView(COMPILE_TIME_VIEWID);
+ rightLayout.addPlaceholder(IPageLayout.ID_TASK_LIST);
+
+ // Add View in the bottom area in separate way
+ layout.addView(TRANSACTION_VIEWID, IPageLayout.RIGHT, 0.65f, editorArea);
+
+ IFolderLayout bottom = layout.createFolder("bottom", IPageLayout.BOTTOM, 0.75f, editorArea);
+ bottom.addView(CONSOLE_VIEW);
+ bottom.addView(SERVER_VIEW);
+ bottom.addView(ERROR_LOG_VIEW);
+ bottom.addView(this.TRANSACTION_VIEW_ID);
+
+ }
+
+
+}
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/perspective/PerspectiveStartup.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/perspective/PerspectiveStartup.java
new file mode 100644
index 0000000..edfe313
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/perspective/PerspectiveStartup.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) Robert Bosch GmbH. All rights reserved.
+ */
+package org.eclipse.blockchain.ui.perspective;
+
+import org.eclipse.blockchain.ui.console.EtherConsoleFactory;
+import org.eclipse.ui.IStartup;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author DMU1COB
+ */
+public class PerspectiveStartup implements IStartup {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void earlyStartup() {
+ PlatformUI.getWorkbench().getPerspectiveRegistry().setDefaultPerspective("org.eclipse.blockchain.ui.perspective");
+ EtherConsoleFactory.getInstance().openConsole();
+ }
+
+}
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/preference/SolidityCompilerPreference.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/preference/SolidityCompilerPreference.java
new file mode 100644
index 0000000..0709676
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/preference/SolidityCompilerPreference.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) Robert Bosch GmbH. All rights reserved.
+ */
+package org.eclipse.blockchain.ui.preference;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.blockchain.core.BlockchainCore;
+import org.eclipse.blockchain.core.SolidityPreferenceConstants;
+import org.eclipse.blockchain.core.log.EthereumLogService;
+import org.eclipse.blockchain.ui.Activator;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.preference.PreferencePage;
+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.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.osgi.service.prefs.BackingStoreException;
+
+/**
+ * @author ADG5COB
+ */
+public class SolidityCompilerPreference extends PreferencePage implements IWorkbenchPreferencePage {
+
+ private Text solcPathText = null;
+ String solidityCompilerPath;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void init(final IWorkbench workbench) {
+ // Nothing as of now
+ this.solidityCompilerPath = Platform.getPreferencesService().getString(SolidityPreferenceConstants.PREF_NODE,
+ SolidityPreferenceConstants.PREF_KEY, "", null);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Control createContents(final Composite parent) {
+ Composite container = new Composite(parent, SWT.None);
+ container.setLayout(new GridLayout(3, false));
+ container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ Label solcLabel = new Label(container, SWT.None);
+ solcLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+ solcLabel.setText("Solididty Compiler Path");
+
+ this.solcPathText = new Text(container, SWT.BORDER);
+ this.solcPathText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ this.solcPathText.setToolTipText("Please mention the filesystem path of solidity compiler");
+ this.solcPathText.setText(this.solidityCompilerPath);
+
+ Button compilerPathBrowseButton = new Button(container, SWT.PUSH);
+ compilerPathBrowseButton.setText("Browse");
+ compilerPathBrowseButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+ compilerPathBrowseButton.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ DirectoryDialog solcCompilerPathDialog = new DirectoryDialog(parent.getShell());
+ solcCompilerPathDialog.setFilterPath(System.getProperty("user.dir"));
+ String selectedDir = solcCompilerPathDialog.open();
+ if (selectedDir != null) {
+ SolidityCompilerPreference.this.solcPathText.setText(selectedDir);
+ }
+
+ }
+
+ @Override
+ public void widgetDefaultSelected(final SelectionEvent e) {
+ // do nothing
+ }
+ });
+
+
+ Link solidityGitLink = new Link(container, SWT.UNDERLINE_LINK);
+ solidityGitLink.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false, 3, 1));
+ solidityGitLink.setText("<a>Solidity Compiler Download</a>");
+ solidityGitLink.setToolTipText(
+ "Download solidity compiler from this link and provide the file system path in above preference dialog");
+ solidityGitLink.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ try {
+ PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser()
+ .openURL(new URL(SolidityPreferenceConstants.SOLIDITY_GIT_URL));
+ }
+ catch (PartInitException | MalformedURLException e1) {
+ EthereumLogService.INSTANCE.log(e1.getMessage());
+ e1.printStackTrace();
+ }
+ }
+ });
+
+ return parent;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean performOk() {
+ this.solidityCompilerPath = getSolText();
+ InstanceScope.INSTANCE.getNode(SolidityPreferenceConstants.PREF_NODE).put(SolidityPreferenceConstants.PREF_KEY,
+ this.solidityCompilerPath);
+ try {
+ InstanceScope.INSTANCE.getNode(SolidityPreferenceConstants.PREF_NODE).flush();
+ }
+ catch (BackingStoreException e) {
+ BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+ return super.performOk();
+ }
+
+ private String getSolText() {
+ List<String> solcPathList = new ArrayList<>();
+ Display.getDefault().syncExec(() -> {
+ solcPathList.add(this.solcPathText.getText());
+ });
+ return solcPathList.get(0);
+ }
+}
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/property/testers/EthereumProjectPropertyTester.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/property/testers/EthereumProjectPropertyTester.java
new file mode 100644
index 0000000..9cb6bc1
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/property/testers/EthereumProjectPropertyTester.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) Robert Bosch GmbH. All rights reserved.
+ */
+package org.eclipse.blockchain.ui.property.testers;
+
+import org.eclipse.blockchain.core.BlockchainCore;
+import org.eclipse.blockchain.core.EthereumProjectNature;
+import org.eclipse.blockchain.ui.Activator;
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ * @author ADG5COB
+ */
+public class EthereumProjectPropertyTester extends PropertyTester {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean test(final Object receiver, final String property, final Object[] args, final Object expectedValue) {
+ try {
+ if ((receiver instanceof IProject) && ((IProject) receiver).getProject().getDescription().getNatureIds()[0]
+ .equals(EthereumProjectNature.ETHEREUM_NATURE)) {
+ return true;
+ }
+ }
+ catch (CoreException e) {
+ BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+ return false;
+ }
+
+}
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/util/UIUtilities.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/util/UIUtilities.java
new file mode 100644
index 0000000..d246d42
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/util/UIUtilities.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) Robert Bosch GmbH. All rights reserved.
+ */
+package org.eclipse.blockchain.ui.util;
+
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * @author ADG5COB
+ */
+public class UIUtilities {
+
+ /**
+ * @param display -
+ * @param parent -
+ */
+ public static void moveShellToCenterOfScreen(final Display display, final Shell parent) {
+ Rectangle monitorBound = display.getPrimaryMonitor().getBounds();
+ Rectangle shellBounds = parent.getBounds();
+ int x = monitorBound.x + ((monitorBound.width - shellBounds.width) / 2);
+ int y = monitorBound.y + ((monitorBound.height - shellBounds.height) / 2);
+ parent.setLocation(x, y);
+ }
+}
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/AccountsView.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/AccountsView.java
new file mode 100644
index 0000000..ca8fa46
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/AccountsView.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) Robert Bosch GmbH. All rights reserved.
+ */
+package org.eclipse.blockchain.ui.views;
+
+import java.util.Set;
+
+import org.eclipse.blockchain.core.Web3jHandler;
+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.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.part.ViewPart;
+
+/**
+ * @author ADG5COB
+ */
+public class AccountsView extends ViewPart {
+
+ static Combo accountsCombo;
+ static Label balance;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void createPartControl(final Composite parent) {
+ Composite container = new Composite(parent, SWT.None);
+ container.setLayout(new GridLayout(2, false));
+ container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ Label accountLabel = new Label(container, SWT.None);
+ accountLabel.setText("Accounts");
+ accountLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+ AccountsView.accountsCombo = new Combo(container, SWT.READ_ONLY);
+ accountsCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ Set<String> accounts = Web3jHandler.getInstance().getAccount().getAccounts().keySet();
+ accountsCombo.setItems(accounts.toArray(new String[accounts.size()]));
+ accountsCombo.select(0);
+ // Ether Balance
+ Label etherBalance = new Label(container, SWT.None);
+ etherBalance.setText("Balance");
+ etherBalance.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+ balance = new Label(container, SWT.BORDER);
+ balance.setText(!(accounts.isEmpty())
+ ? Web3jHandler.getInstance().getAccount().getAccountBalance().get(accountsCombo.getText()) : "0.0");
+ balance.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+
+ accountsCombo.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ balance.setText(Web3jHandler.getInstance().getAccount().getAccountBalance().get(((Combo) e.widget).getText()));
+ balance.getParent().layout();
+ }
+ });
+ }
+
+ /**
+ * @param items - Set the accounts
+ */
+ public static void setAccountsCombo(final String[] items) {
+ if (accountsCombo != null) {
+ accountsCombo.setItems(items);
+ accountsCombo.getAccessible().getControl().update();
+ accountsCombo.select(0);
+ balance.setText(Web3jHandler.getInstance().getAccount().getAccountBalance().get(accountsCombo.getText()));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setPartName(final String partName) {
+ super.setPartName("Geth Accounts");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setFocus() {
+
+ }
+
+}
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/CompileViewPart.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/CompileViewPart.java
new file mode 100644
index 0000000..8ecc3c2
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/CompileViewPart.java
@@ -0,0 +1,33 @@
+package org.eclipse.blockchain.ui.views;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.part.ViewPart;
+
+
+public class CompileViewPart extends ViewPart {
+
+
+ public CompileViewPart() {
+ super();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void createPartControl(final Composite parent) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setFocus() {
+ // TODO Auto-generated method stub
+
+ }
+
+
+}
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/EtherAccountViewPart.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/EtherAccountViewPart.java
new file mode 100644
index 0000000..d204c78
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/EtherAccountViewPart.java
@@ -0,0 +1,157 @@
+package org.eclipse.blockchain.ui.views;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.blockchain.core.BlockchainCore;
+import org.eclipse.blockchain.core.Web3jHandler;
+import org.eclipse.blockchain.ui.Activator;
+import org.eclipse.fx.ui.workbench3.FXViewPart;
+
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.geometry.Insets;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.ComboBox;
+import javafx.scene.control.Label;
+import javafx.scene.control.TextField;
+import javafx.scene.layout.GridPane;
+
+/**
+ * @author DMU1COB
+ */
+public class EtherAccountViewPart extends FXViewPart {
+
+ static ComboBox<String> cmbAccount = new ComboBox<>();
+ static TextField txtBalance = new TextField();
+ private static String selectedItem;
+
+ @Override
+ protected Scene createFxScene() {
+
+ Scene scene = null;
+ try {
+
+ GridPane gridPane = new GridPane();
+ gridPane.setPadding(new Insets(20));
+ gridPane.setHgap(10);
+ gridPane.setVgap(10);
+
+ Label lblAccount = new Label();
+ lblAccount.setText("Accounts");
+
+ EtherAccountViewPart.cmbAccount.setPrefWidth(200);
+ EtherAccountViewPart.cmbAccount.setItems(getAccountList());
+ EtherAccountViewPart.cmbAccount.getSelectionModel().selectFirst();
+
+ Label lblEtherBalance = new Label();
+ lblEtherBalance.setText("Ether Balance");
+
+ Map<String, String> accountBalance = Web3jHandler.getInstance().getAccount().getAccountBalance();
+
+ // Add a ChangeListener to the ComboBox
+ EtherAccountViewPart.cmbAccount.getSelectionModel().selectedItemProperty()
+ .addListener(new ChangeListener<String>() {
+
+ @Override
+ public void changed(final ObservableValue<? extends String> ov, final String oldValue,
+ final String newValue) {
+ if (newValue != null) {
+ EtherAccountViewPart.txtBalance
+ .setText(Web3jHandler.getInstance().getAccount().getAccountBalance().get(newValue));
+ selectedItem = newValue;
+ }
+ }
+ });
+
+ Button btnAddAccount = new Button();
+ btnAddAccount.setText("+");
+
+ Label lblGasLimit = new Label();
+ lblGasLimit.setText("Gas Limit");
+
+ Label lblGasValue = new Label();
+ lblGasValue.setText("Gas Value");
+
+ TextField txtGasLimit = new TextField();
+ TextField txtGasValue = new TextField();
+ if (Web3jHandler.getInstance().getAdmin() != null) {
+ txtGasValue.setText(Web3jHandler.getInstance().getGasPrice().toString());
+ }
+ setEthBalanace(accountBalance);
+ gridPane.add(lblAccount, 0, 0);
+ gridPane.add(EtherAccountViewPart.cmbAccount, 1, 0);
+ gridPane.add(btnAddAccount, 2, 0);
+ gridPane.add(lblGasLimit, 0, 1);
+ gridPane.add(lblGasValue, 0, 2);
+ gridPane.add(txtGasLimit, 1, 1);
+ gridPane.add(txtGasValue, 1, 2);
+ gridPane.add(lblEtherBalance, 0, 3);
+ gridPane.add(EtherAccountViewPart.txtBalance, 1, 3);
+
+ scene = new Scene(gridPane, 400, 400);
+
+ scene.getStylesheets().add(getClass().getResource("Views.css").toExternalForm());
+ }
+ catch (Exception e) {
+ BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+
+ return scene;
+
+ }
+
+ /**
+ * @param accountBalance
+ */
+ private static void setEthBalanace(final Map<String, String> accountBalance) {
+ if (!EtherAccountViewPart.cmbAccount.getItems().isEmpty()) {
+ EtherAccountViewPart.selectedItem = EtherAccountViewPart.cmbAccount.getSelectionModel().getSelectedItem();
+ txtBalance.setText(accountBalance.get(EtherAccountViewPart.selectedItem));
+ }
+ }
+
+ /**
+ * @return
+ */
+ private static ObservableList<String> getAccountList() {
+ ObservableList<String> accountList = FXCollections.observableArrayList();
+ Map<String, String> acctInfo = Web3jHandler.getInstance().getAccount().getAccounts();
+ Set<String> accounts = acctInfo.keySet();
+ accountList.addAll(accounts);
+ if (!accountList.isEmpty()) {
+ accountList.remove(0);// skipping the coin-base account from displaying
+ }
+ return accountList;
+ }
+
+ @Override
+ protected void setFxFocus() {
+
+ }
+
+ /**
+ * @return the selectedItem
+ */
+ public static String getSelectedItem() {
+ return selectedItem;
+ }
+
+ /**
+ *
+ */
+ public static void updateView() {
+ EtherAccountViewPart.cmbAccount.setItems(getAccountList());
+ if (selectedItem == null) {
+ EtherAccountViewPart.cmbAccount.getSelectionModel().selectFirst();
+ }
+ else {
+ EtherAccountViewPart.cmbAccount.getSelectionModel().select(selectedItem);
+ }
+ setEthBalanace(Web3jHandler.getInstance().getAccount().getAccountBalance());
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/GethServerDialog.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/GethServerDialog.java
new file mode 100644
index 0000000..fa2203f
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/GethServerDialog.java
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) Robert Bosch GmbH. All rights reserved.
+ */
+package org.eclipse.blockchain.ui.views;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.blockchain.core.BlockchainCore;
+import org.eclipse.blockchain.core.CoreCommandExecutor;
+import org.eclipse.blockchain.ui.Activator;
+import org.eclipse.blockchain.ui.util.UIUtilities;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+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.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * @author ADG5COB
+ */
+public class GethServerDialog extends Dialog {
+
+ private Text dataDirText;
+ private Text initFileText;
+ private final String userDir = System.getProperty("user.dir");
+ private String networkId = "";
+ private Label networkIdLabel;
+ private final Map<String, String> gethOptions = new HashMap<>();
+ private String dataDirectory = "";
+ private String genesisFile = "";
+
+ /**
+ * @return -
+ */
+ public String getDataDirectory() {
+ return this.dataDirectory;
+ }
+
+ /**
+ * @return -
+ */
+ public String getGenesisFile() {
+ return this.genesisFile;
+ }
+
+ /**
+ * @return -
+ */
+ public Map<String, String> getGethOptions() {
+ return this.gethOptions;
+ }
+
+ /**
+ * @param parentShell -
+ */
+ public GethServerDialog(final Shell parentShell) {
+ super(parentShell);
+ populateGethOptions();
+ }
+
+ private void populateGethOptions() {
+ this.gethOptions.put("rpc", "");
+ this.gethOptions.put("rpccorsdomain", "*");
+ this.gethOptions.put("rpcapi", "db,eth,net,web3,personal");
+ this.gethOptions.put("gcmode", "archive");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void configureShell(final Shell shell) {
+ super.configureShell(shell);
+ shell.setText("Geth Server Setup");
+ shell.setSize(300, 400);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Control createDialogArea(final Composite parent) {
+ Composite containerComp = new Composite(parent, SWT.None);
+ containerComp.setLayout(new GridLayout(3, false));
+ containerComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ createContent(containerComp);
+ UIUtilities.moveShellToCenterOfScreen(Display.getDefault(), parent.getShell());
+ return parent;
+ }
+
+ private void createContent(final Composite containerComp) {
+ // First Layer
+ Label dataDirLabel = new Label(containerComp, SWT.None);
+ dataDirLabel.setText("Data Directory");
+ dataDirLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+ this.dataDirText = new Text(containerComp, SWT.BORDER);
+ this.dataDirText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ this.dataDirText.setText("C:\\Deepthi\\BlockChain\\Account\\Node4");
+ this.dataDirText.setToolTipText(this.dataDirText.getText());
+
+ Button dataDirBrowse = new Button(containerComp, SWT.PUSH);
+ dataDirBrowse.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+ dataDirBrowse.setText("Browse");
+ dataDirBrowse.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ getAndSetSelectedDirectoryNode(containerComp, GethServerDialog.this.dataDirText);
+ }
+ });
+
+ // Second Layer
+ Label initFileLabel = new Label(containerComp, SWT.None);
+ initFileLabel.setText("Init File");
+ initFileLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+ this.initFileText = new Text(containerComp, SWT.BORDER);
+ this.initFileText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ this.initFileText.setText("");
+ this.initFileText.setToolTipText(this.initFileText.getText());
+
+ Button initFileBrowse = new Button(containerComp, SWT.PUSH);
+ initFileBrowse.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+ initFileBrowse.setText("Browse");
+ initFileBrowse.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ getandSetSelectedGenesisFile(containerComp, GethServerDialog.this.initFileText);
+ }
+ });
+
+ // Scrolled Composite - contains network values
+ ScrolledComposite networkComposite = new ScrolledComposite(containerComp, SWT.V_SCROLL | SWT.BORDER);
+ networkComposite.setLayout(new GridLayout(1, false));
+ networkComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 3, 0));
+ Composite networkChild = createdScrolledContent(networkComposite);
+
+ networkComposite.setContent(networkChild);
+ networkComposite.setMinSize(networkComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+ networkComposite.setExpandHorizontal(true);
+ networkComposite.setExpandVertical(true);
+ networkComposite.layout();
+ }
+
+ private Composite createdScrolledContent(final ScrolledComposite scrolledComposite) {
+ /**
+ * This contains the geth arguments which should be made configurable, as of now its static but networkId will be
+ * read from the genesis file
+ */
+ Composite childComp = new Composite(scrolledComposite, SWT.None);
+ childComp.setLayout(new GridLayout(1, false));
+ childComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ Group networkGroup = new Group(childComp, SWT.BORDER);
+ networkGroup.setLayout(new GridLayout(1, false));
+ networkGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ networkGroup.setText("Network");
+
+ this.networkIdLabel = new Label(networkGroup, SWT.None | SWT.READ_ONLY);
+ this.networkIdLabel.setText("Network ID : " +
+ (this.networkId.isEmpty() ? CoreCommandExecutor.getInstance().getDefaultNetworkIdForGeth() : this.networkId));
+
+ Group rpcGroup = new Group(childComp, SWT.BORDER);
+ rpcGroup.setLayout(new GridLayout(1, false));
+ rpcGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ rpcGroup.setText("RPC");
+
+ for (Map.Entry<String, String> entry : this.gethOptions.entrySet()) {
+ Label lab = new Label(rpcGroup, SWT.None);
+ String val = entry.getValue();
+ lab.setText(entry.getKey() + (val.isEmpty() ? "" : " : " + val));
+ }
+ return childComp;
+ }
+
+ private void getandSetSelectedGenesisFile(final Composite parent, final Text textWidget) {
+ FileDialog dataDir = new FileDialog(parent.getShell());
+ dataDir.setFilterPath(this.userDir);
+ String selectedDir = dataDir.open();
+ textWidget.setText(selectedDir);
+ try (BufferedReader br = new BufferedReader(new FileReader(new File(selectedDir)))) {
+ String contents = "";
+ while ((contents = br.readLine()) != null) {
+ if (contents.contains("chainId")) {
+ this.networkId = contents.substring(contents.indexOf(':') + 1).replace(",", "").trim();
+ this.networkIdLabel.setText("Network ID : " + this.networkId);
+ this.networkIdLabel.getParent().layout();
+ }
+ }
+ }
+ catch (IOException e) {
+ BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+ }
+
+ private void getAndSetSelectedDirectoryNode(final Composite parent, final Text textWidget) {
+ DirectoryDialog dirDialog = new DirectoryDialog(parent.getShell());
+ dirDialog.setFilterPath(this.userDir);
+ String selectedDir = dirDialog.open();
+ textWidget.setText(selectedDir);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void okPressed() {
+ this.dataDirectory = this.dataDirText.getText();
+ this.genesisFile = this.initFileText.getText();
+ super.okPressed();
+ }
+
+}
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/RunViewPart.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/RunViewPart.java
new file mode 100644
index 0000000..e31cb66
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/RunViewPart.java
@@ -0,0 +1,124 @@
+package org.eclipse.blockchain.ui.views;
+
+import org.eclipse.swt.SWT;
+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.part.ViewPart;
+
+
+/**
+ * Class with the implementation for the Run time view that would deploy the selected smart contaracts belonging to an
+ * account on either a test network or an actual blockchain network.
+ *
+ * @author SDG3COB
+ */
+public class RunViewPart extends ViewPart {
+
+ /**
+ * Empty constructor.
+ */
+ public RunViewPart() {
+ // Do nothing
+ }
+
+ @Override
+ public void createPartControl(final Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.horizontalSpacing = 5;
+ layout.verticalSpacing = 10;
+ layout.makeColumnsEqualWidth = true;
+
+ composite.setLayout(layout);
+
+ Button testNetButton = new Button(composite, SWT.RADIO);
+ testNetButton.setText("TestNet");
+
+ Combo testNetCombo = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
+ testNetCombo.add("TestNet A");
+ testNetCombo.add("TestNet B");
+ testNetCombo.add("TestNet C");
+
+ GridData gridTestNetCombo = commonGridDataCreation();
+ testNetCombo.setLayoutData(gridTestNetCombo);
+
+ Button atAddressButton = new Button(composite, SWT.RADIO);
+ atAddressButton.setText("At Address");
+
+ Text addressText = new Text(composite, SWT.BORDER);
+ addressText.setText("0.0.0.0");
+ GridData gridDataAddressText = commonGridDataCreation();
+ addressText.setLayoutData(gridDataAddressText);
+
+ Label accountLabel = new Label(composite, 0);
+ accountLabel.setText("Account");
+
+ Combo accountCombo = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
+
+ accountCombo.add("0x76439311057c197e3ef6a9ad87f57e3550d36f5c");
+ accountCombo.add("0xb304c9e034f29800b6cef17934a9e1a5564d9bc6");
+ accountCombo.add("0x9d6a1232e12b793db22ba3f76a9e9f6650e4bf54");
+ GridData gridDataAccText = commonGridDataCreation();
+ accountCombo.setLayoutData(gridDataAccText);
+
+
+ Label gasLimitLabel = new Label(composite, 0);
+ gasLimitLabel.setText("Gas Limit");
+
+ Text gasLimitText = new Text(composite, SWT.BORDER);
+ gasLimitText.setText("10000");
+ GridData gridDataGasLimitText = commonGridDataCreation();
+ gasLimitText.setLayoutData(gridDataGasLimitText);
+
+
+ Label valueLabel = new Label(composite, 0);
+ valueLabel.setText("Value");
+
+ Text valueText = new Text(composite, SWT.BORDER);
+ valueText.setText("0");
+ GridData gridDataValueText = commonGridDataCreation();
+ valueText.setLayoutData(gridDataValueText);
+
+ Label environmentLabel = new Label(composite, 0);
+ environmentLabel.setText("Smart Contract");
+
+ Combo environmentCombo = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
+
+ environmentCombo.add("SC 1");
+ environmentCombo.add("SC 2");
+ environmentCombo.add("SC 3");
+ GridData gridDataText = commonGridDataCreation();
+ environmentCombo.setLayoutData(gridDataText);
+
+ Button deployButton = new Button(composite, SWT.PUSH);
+ deployButton.setText("Deploy");
+
+ GridData gridDataDeployButton = commonGridDataCreation();
+ gridDataDeployButton.horizontalSpan = 2;
+ deployButton.setLayoutData(gridDataDeployButton);
+
+ }
+
+ /**
+ * @return
+ */
+ private GridData commonGridDataCreation() {
+ GridData gridDataAddressText = new GridData();
+ gridDataAddressText.horizontalAlignment = GridData.FILL;
+ gridDataAddressText.grabExcessHorizontalSpace = true;
+ return gridDataAddressText;
+ }
+
+ @Override
+ public void setFocus() {
+
+ }
+
+}
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/TransactionHistoryView.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/TransactionHistoryView.java
new file mode 100644
index 0000000..9f6f213
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/TransactionHistoryView.java
@@ -0,0 +1,229 @@
+/*
+ * Copyright (c) Robert Bosch GmbH. All rights reserved.
+ */
+package org.eclipse.blockchain.ui.views;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.blockchain.core.BlockchainCore;
+import org.eclipse.blockchain.core.BlockchainViewsRegistry;
+import org.eclipse.blockchain.core.IBlockchainView;
+import org.eclipse.blockchain.core.TransactionModel;
+import org.eclipse.blockchain.core.Web3jHandler;
+import org.eclipse.blockchain.ui.Activator;
+import org.eclipse.fx.ui.workbench3.FXViewPart;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.PartInitException;
+
+import javafx.event.ActionEvent;
+import javafx.scene.Scene;
+import javafx.scene.control.Alert;
+import javafx.scene.control.Alert.AlertType;
+import javafx.scene.control.ContextMenu;
+import javafx.scene.control.Label;
+import javafx.scene.control.MenuItem;
+import javafx.scene.control.OverrunStyle;
+import javafx.scene.control.TableColumn;
+import javafx.scene.control.TableRow;
+import javafx.scene.control.TableView;
+import javafx.scene.control.TextArea;
+import javafx.scene.control.Tooltip;
+import javafx.scene.control.cell.PropertyValueFactory;
+import javafx.scene.layout.GridPane;
+import javafx.scene.layout.Priority;
+import javafx.scene.layout.VBox;
+
+
+/**
+ * @author ABB3COB
+ */
+public class TransactionHistoryView extends FXViewPart implements IBlockchainView {
+
+ /**
+ * Important Note - This view is added to the list of registered blockchain views in the Activator. Because this class
+ * won't be initialized until user manually activate's the view. To avoid data loss this view is added in Activator
+ */
+ /**
+ * These 2 are maintained as a static instance because FXViewPart creates one instance and we create another instance
+ * inactivator. This small glitch can be handled later
+ */
+ private static TableView<TransactionModel> table;
+ /**
+ * A temporary model object
+ */
+ private static Set<TransactionModel> tableContents = new HashSet<>();
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void init(final IViewSite site) throws PartInitException {
+ super.init(site);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Scene createFxScene() {
+ TransactionHistoryView.table = new TableView<>();
+ // Create the VBox
+ VBox root = new VBox(TransactionHistoryView.table);
+ TransactionHistoryView.table.setVisible(true);
+ TransactionHistoryView.table.setPlaceholder(new Label("No transactions to display"));
+ TransactionHistoryView.table.setRowFactory(tv -> {
+ TableRow<TransactionModel> row = new TableRow<>();
+ row.setTooltip(new Tooltip("Double click to view details"));
+ row.setTextOverrun(OverrunStyle.ELLIPSIS);
+ row.setOnMouseClicked(event -> {
+ if ((event.getClickCount() == 2) && !row.isEmpty()) {
+ TransactionModel transaction = row.getItem();
+ String transactionDetailsMsg = "blockHash : " + transaction.getBlockHash() + System.lineSeparator() +
+ "blockNumber : " + transaction.getBlockNumber() + System.lineSeparator() + "from : " +
+ transaction.getFromAddress() + System.lineSeparator() + "gas : " + transaction.getGas() +
+ System.lineSeparator() + "gasPrice : " + transaction.getGasPrice() + System.lineSeparator() + "hash : " +
+ transaction.getTransactionHash() + System.lineSeparator() + "input : " + transaction.getInput() +
+ System.lineSeparator() + "nonce : " + transaction.getNonce() + System.lineSeparator() + "r : " +
+ transaction.getR() + System.lineSeparator() + "s : " + transaction.getS() + System.lineSeparator() +
+ "to : " + transaction.getToAddress() + System.lineSeparator() + "transactionIndex : " +
+ transaction.getTransactionIndex() + System.lineSeparator() + "v : " + transaction.getV() +
+ System.lineSeparator() + "value : " + transaction.getValue() + System.lineSeparator();
+
+ showAlert(transactionDetailsMsg, "Transaction details");
+ }
+ });
+ return row;
+ });
+
+ TableColumn<TransactionModel, String> blockHashColumn = new TableColumn<>("Block Hash");
+ blockHashColumn.setCellValueFactory(new PropertyValueFactory<>("blockHash"));
+
+ TableColumn<TransactionModel, String> blockNumberColumn = new TableColumn<>("block Number");
+ blockNumberColumn.setCellValueFactory(new PropertyValueFactory<>("blockNumber"));
+
+ TableColumn<TransactionModel, String> fromAddressColumn = new TableColumn<>("From");
+ fromAddressColumn.setCellValueFactory(new PropertyValueFactory<>("fromAddress"));
+
+ TableColumn<TransactionModel, String> gasColumn = new TableColumn<>("Gas");
+ gasColumn.setCellValueFactory(new PropertyValueFactory<>("gas"));
+
+ TableColumn<TransactionModel, String> gasPriceColumn = new TableColumn<>("Gas Price");
+ gasPriceColumn.setCellValueFactory(new PropertyValueFactory<>("gasPrice"));
+
+ TableColumn<TransactionModel, String> transactionHashColumn = new TableColumn<>("Hash");
+ transactionHashColumn.setCellValueFactory(new PropertyValueFactory<>("transactionHash"));
+
+ TableColumn<TransactionModel, String> inputColumn = new TableColumn<>("Input");
+ inputColumn.setCellValueFactory(new PropertyValueFactory<>("input"));
+
+ TableColumn<TransactionModel, String> nonceColumn = new TableColumn<>("Nonce");
+ nonceColumn.setCellValueFactory(new PropertyValueFactory<>("nonce"));
+
+ TableColumn<TransactionModel, String> rColumn = new TableColumn<>("R");
+ rColumn.setCellValueFactory(new PropertyValueFactory<>("r"));
+
+ TableColumn<TransactionModel, String> sColumn = new TableColumn<>("S");
+ sColumn.setCellValueFactory(new PropertyValueFactory<>("s"));
+
+ TableColumn<TransactionModel, String> toAddressColumn = new TableColumn<>("To");
+ toAddressColumn.setCellValueFactory(new PropertyValueFactory<>("toAddress"));
+
+ TableColumn<TransactionModel, String> transactionIndexColumn = new TableColumn<>("Transaction Index");
+ transactionIndexColumn.setCellValueFactory(new PropertyValueFactory<>("transactionIndex"));
+ TransactionHistoryView.table.getColumns().add(blockHashColumn);
+ TransactionHistoryView.table.getColumns().add(blockNumberColumn);
+ TransactionHistoryView.table.getColumns().add(fromAddressColumn);
+ TransactionHistoryView.table.getColumns().add(gasPriceColumn);
+ TransactionHistoryView.table.getColumns().add(transactionHashColumn);
+ TransactionHistoryView.table.getColumns().add(inputColumn);
+ TransactionHistoryView.table.getColumns().add(nonceColumn);
+ TransactionHistoryView.table.getColumns().add(rColumn);
+ TransactionHistoryView.table.getColumns().add(sColumn);
+ TransactionHistoryView.table.getColumns().add(toAddressColumn);
+ TransactionHistoryView.table.getColumns().add(transactionIndexColumn);
+
+ TransactionHistoryView.table.setTableMenuButtonVisible(true);
+ ContextMenu contextMenu = new ContextMenu();
+
+ MenuItem debugItem = new MenuItem("Debug");
+ MenuItem exportMenu = new MenuItem("Export");
+ MenuItem transactionReceiptMenu = new MenuItem("TX Receipt");
+
+ contextMenu.getItems().add(debugItem);
+ contextMenu.getItems().add(exportMenu);
+ contextMenu.getItems().add(transactionReceiptMenu);
+ transactionReceiptMenu.setOnAction((final ActionEvent event) -> {
+ try {
+ TransactionModel selectedItem = TransactionHistoryView.table.getSelectionModel().getSelectedItem();
+ showAlert(Web3jHandler.getInstance().getTransactionReceiptAsString(selectedItem.getTransactionHash()),
+ "Transaction receipt");
+ }
+ catch (IOException e) {
+ BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, "Error during transaction receipt generation",
+ e);
+ }
+ });
+
+ TransactionHistoryView.table.setContextMenu(contextMenu);
+ TransactionHistoryView.table.autosize();
+ if (!tableContents.isEmpty()) {
+ TransactionHistoryView.table.getItems().addAll(tableContents);
+ }
+
+
+ // Create the Scene
+ Scene scene = new Scene(root);
+ scene.getStylesheets().add(getClass().getResource("Views.css").toExternalForm());
+ return scene;
+
+ }
+
+ private void showAlert(final String transactionDetailsMsg, final String title) {
+ Alert transactionDetailsAlert = new Alert(AlertType.INFORMATION);
+ transactionDetailsAlert.setTitle(title);
+
+ TextArea detailsArea = new TextArea(transactionDetailsMsg);
+ detailsArea.setEditable(false);
+ detailsArea.setWrapText(true);
+ GridPane.setVgrow(detailsArea, Priority.ALWAYS);
+ GridPane.setHgrow(detailsArea, Priority.ALWAYS);
+ transactionDetailsAlert.getDialogPane().setExpandableContent(detailsArea);
+ transactionDetailsAlert.getDialogPane().setExpanded(true);
+ transactionDetailsAlert.showAndWait();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setFxFocus() {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void updateView(final TransactionModel transactionModel) {
+ tableContents.add(transactionModel);
+ if (TransactionHistoryView.table == null) {
+ return;// We are not supposed to manually create this let the framework handle the creation. data loss wont happen
+ // because we store the transaction in a set.
+ }
+ TransactionHistoryView.table.getItems().add(transactionModel);
+ TransactionHistoryView.table.refresh();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void dispose() {
+ super.dispose();
+ BlockchainViewsRegistry.dereisterBlockchainView(this);
+
+ }
+}
+
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/TransactionsViewPart.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/TransactionsViewPart.java
new file mode 100644
index 0000000..584b33d
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/TransactionsViewPart.java
@@ -0,0 +1,575 @@
+/*
+ * Copyright (c) Robert Bosch GmbH. All rights reserved.
+ */
+package org.eclipse.blockchain.ui.views;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.eclipse.blockchain.core.BlockchainCore;
+import org.eclipse.blockchain.core.CoreCommandExecutor;
+import org.eclipse.blockchain.core.EthereumProject;
+import org.eclipse.blockchain.core.EthereumProjectNature;
+import org.eclipse.blockchain.core.ProjectCreator;
+import org.eclipse.blockchain.core.Web3jHandler;
+import org.eclipse.blockchain.ui.Activator;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.fx.ui.workbench3.FXViewPart;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.ISources;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.services.IEvaluationService;
+
+import javafx.beans.value.ObservableValue;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.geometry.Insets;
+import javafx.geometry.Orientation;
+import javafx.scene.Scene;
+import javafx.scene.control.Alert;
+import javafx.scene.control.Alert.AlertType;
+import javafx.scene.control.Button;
+import javafx.scene.control.ComboBox;
+import javafx.scene.control.Label;
+import javafx.scene.control.ProgressBar;
+import javafx.scene.control.ScrollPane;
+import javafx.scene.control.ScrollPane.ScrollBarPolicy;
+import javafx.scene.control.Separator;
+import javafx.scene.control.TextArea;
+import javafx.scene.control.TextField;
+import javafx.scene.control.ToolBar;
+import javafx.scene.control.Tooltip;
+import javafx.scene.layout.GridPane;
+import javafx.scene.layout.Priority;
+
+
+/**
+ * @author DMU1COB
+ */
+public class TransactionsViewPart extends FXViewPart implements IResourceChangeListener {
+
+ private static final String SOLIDITY_OUTPUT_FOLDER = "sol-output";
+ static Map<String, Set<IResource>> projectToSolidityFilesMap = new HashMap<>();
+ ComboBox<String> cmbSmartContracts = new ComboBox<>();
+ List<Object> listOfObjects = new ArrayList<>();
+ GridPane gridPane = new GridPane();
+ TextField constructorArgs = new TextField();
+ private String anyErrors = "Not Done";
+ private String deploySmartContractMessage = "Not Done";
+ private String invokeSmartContractMessage = "Not Done";
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void init(final IViewSite site) throws PartInitException {
+ super.init(site);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void resourceChanged(final IResourceChangeEvent event) {
+
+ if ((event.getDelta() != null)) {
+ IResourceDelta rootDelta = event.getDelta();
+ try {
+ rootDelta.accept(new IResourceDeltaVisitor() {
+
+ @Override
+ public boolean visit(final IResourceDelta delta) throws CoreException {
+ if ((delta != null) && (delta.getResource() != null) && (delta.getResource() instanceof IFile) &&
+ (delta.getResource().getFileExtension() != null) &&
+ (delta.getResource().getFileExtension().equals("sol")) && (delta.getKind() == IResourceDelta.REMOVED)) {
+ Object currentSelection = getCurrentSelectionProject();
+ if ((currentSelection != null) &&
+ projectToSolidityFilesMap.containsKey(((IProject) currentSelection).getName())) {
+ projectToSolidityFilesMap.get(((IProject) currentSelection).getName()).remove(delta.getResource());
+ Display.getDefault().syncExec(() -> {
+ updateSmartContractsCombo((IProject) currentSelection);
+ });
+ }
+ }
+ return true;
+ }
+ });
+ }
+ catch (CoreException e) {
+ BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Scene createFxScene() {
+ Scene scene = null;
+ try {
+
+
+ this.gridPane.setPadding(new Insets(20));
+ this.gridPane.setHgap(10);
+ this.gridPane.setVgap(10);
+
+ ToolBar toolBar = new ToolBar();
+ Button btnCompile = new Button("Compile");
+ toolBar.getItems().add(btnCompile);
+ toolBar.getItems().add(new Separator());
+ Button btnDeploy = new Button("Deploy");
+ toolBar.getItems().add(btnDeploy);
+ toolBar.getItems().add(new Separator());
+ Button btnContractAddress = new Button("CxAddr");
+ btnContractAddress.setTooltip(new Tooltip("Contract Address"));
+ toolBar.getItems().add(btnContractAddress);
+ toolBar.setOrientation(Orientation.HORIZONTAL);
+
+ ProgressBar progressBar = new ProgressBar(0);
+ progressBar.setProgress(0.5);
+
+ Label lblContract = new Label();
+ lblContract.setText("Smart Contract");
+
+
+ this.cmbSmartContracts.setPrefWidth(200);
+ ObservableList<String> smartContractList = FXCollections.observableArrayList();
+ smartContractList.addAll(getSmartContracts((IProject) getCurrentSelectionProject()));
+ this.cmbSmartContracts.setItems(smartContractList);
+ this.cmbSmartContracts.getSelectionModel().selectFirst();
+
+ // Add a ChangeListener to the ComboBox
+ this.cmbSmartContracts.getSelectionModel().selectedItemProperty()
+ .addListener((final ObservableValue<? extends String> ov, final String oldValue, final String newValue) -> {
+ // on change of smart-contract load that corresponding details in the UI
+ this.gridPane.getChildren().remove(this.constructorArgs);
+ constructorTextUI();
+ clearWidgets();
+ String solPath = getSolPath(newValue);
+ if (!solPath.isEmpty()) {
+ String projectName = solPath.split("--")[1];
+ String scAbsPath = solPath.split("--")[0];
+ EthereumProject ethProject = ProjectCreator.getInstance().getEthProject(projectName);
+ if (ethProject.isSCDeployed(ethProject.getProject()
+ .getFile(scAbsPath.replace(ethProject.getProject().getLocation().toOSString(), "")))) {
+ constructUI(solPath);
+ }
+ }
+ });
+
+ // Contract Address
+ btnContractAddress.setOnAction(event -> {
+ String selectedContract = this.cmbSmartContracts.getSelectionModel().getSelectedItem();
+ String solPath = getSolPath(selectedContract);
+ String projectName = solPath.split("--")[1];
+ String scAbsPath = solPath.split("--")[0];
+ EthereumProject ethProject = ProjectCreator.getInstance().getEthProject(projectName);
+ IFile file =
+ ethProject.getProject().getFile(scAbsPath.replace(ethProject.getProject().getLocation().toOSString(), ""));
+ String contractAddr = "Not deployed!!!";
+ if (ethProject.isSCDeployed(file)) {
+ contractAddr = file.getName() + "-" + ethProject.getContractAddress(file);
+ }
+ Alert alert = new Alert(AlertType.INFORMATION);
+ alert.setTitle("Contract Address");
+ TextArea detailsArea = new TextArea(contractAddr);
+ detailsArea.setEditable(false);
+ detailsArea.setWrapText(true);
+ GridPane.setVgrow(detailsArea, Priority.ALWAYS);
+ GridPane.setHgrow(detailsArea, Priority.ALWAYS);
+ alert.getDialogPane().setExpandableContent(detailsArea);
+ alert.getDialogPane().setExpanded(true);
+ alert.showAndWait();
+ });
+
+ // Deploy
+ btnDeploy.setOnAction(value -> {
+ clearWidgets();
+ String selectedContract = this.cmbSmartContracts.getSelectionModel().getSelectedItem();
+ try {
+ String solPath = getSolPath(selectedContract);
+ this.deploySmartContractMessage = "Not Done";
+ IRunnableWithProgress deployRunnable = new IRunnableWithProgress() {
+
+ @Override
+ public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ TransactionsViewPart.this.deploySmartContractMessage =
+ Web3jHandler.getInstance().deploySmartContract(solPath.split("--")[1], selectedContract,
+ getOutputDirPath(selectedContract), solPath.split("--")[0],
+ TransactionsViewPart.this.constructorArgs.getText(), EtherAccountViewPart.getSelectedItem());
+ }
+ catch (Exception e) {
+ BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+ }
+ };
+ new ProgressMonitorDialog(Display.getDefault().getActiveShell()).run(true, false, deployRunnable);
+
+ if (this.deploySmartContractMessage.isEmpty()) {
+ constructUI(solPath);
+ }
+ else {
+ MessageDialog errorDialog = new MessageDialog(Display.getDefault().getActiveShell(), "Geth Server error",
+ null, this.deploySmartContractMessage, MessageDialog.ERROR, new String[] { "OK" }, 0);
+ errorDialog.open();
+ }
+ // If-end
+ }
+ catch (Exception e) {
+ BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+ });
+
+ // Compile
+ btnCompile.setOnAction(value -> {
+ Object selection = getCurrentSelectionResource();
+ if ((selection != null) && (selection instanceof IResource)) {
+ IProject selectedProject = ((IResource) selection).getProject();
+ this.gridPane.getChildren().remove(this.constructorArgs);
+ clearWidgets();
+ Set<IResource> solidityFilesSet =
+ projectToSolidityFilesMap.computeIfAbsent(selectedProject.getName(), s -> new HashSet<>());
+
+ try {
+ if (selection instanceof IProject) {
+ /**
+ * The existing list of solidity files should be cleared only if project level compilation is choosen,
+ * else if single file is selected for compilation only add that file to the list
+ */
+ solidityFilesSet.clear();
+ selectedProject.accept((final IResource resource) -> {
+ if ((resource instanceof IFile) && (resource.getFileExtension() != null) &&
+ resource.getFileExtension().equals("sol")) {
+ solidityFilesSet.add(resource);
+ }
+ return true;
+ });
+ }
+ else if ((((IResource) selection).getFileExtension() != null) &&
+ (((IResource) selection).getFileExtension().equals("sol"))) {
+ solidityFilesSet.add((IResource) selection);
+ }
+ if ((selection instanceof IProject) && selectedProject.getFolder(SOLIDITY_OUTPUT_FOLDER).exists()) {
+ selectedProject.getFolder(SOLIDITY_OUTPUT_FOLDER).delete(true, new NullProgressMonitor());
+ }
+ else if (!selectedProject.getFolder(SOLIDITY_OUTPUT_FOLDER).exists()) {
+ selectedProject.getFolder(SOLIDITY_OUTPUT_FOLDER).create(true, true, new NullProgressMonitor());
+ }
+ this.anyErrors = "Not Done";
+ IRunnableWithProgress compileRunnable = new IRunnableWithProgress() {
+
+ @Override
+ public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ List<IResource> solFiles = new ArrayList<>();
+ if (selection instanceof IProject) {
+ solFiles.addAll(solidityFilesSet);
+ }
+ else {
+ // Single sol file
+ solFiles.add((IResource) selection);
+ }
+ TransactionsViewPart.this.anyErrors = CoreCommandExecutor.getInstance().solidityCompile(
+ selectedProject.getName(), solFiles, selectedProject.findMember(SOLIDITY_OUTPUT_FOLDER));
+ selectedProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ }
+ catch (CoreException | IOException | InterruptedException | ClassNotFoundException e) {
+ BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+ }
+ };
+ if (Arrays.asList(selectedProject.getDescription().getNatureIds())
+ .contains(EthereumProjectNature.ETHEREUM_NATURE)) {
+ new ProgressMonitorDialog(Display.getDefault().getActiveShell()).run(true, false, compileRunnable);
+ }
+ else {
+ this.anyErrors = "Selected project is not an Ethereum Project";
+ }
+
+ if (!this.anyErrors.isEmpty()) {
+ MessageDialog errorDialog = new MessageDialog(Display.getDefault().getActiveShell(), "Solc error", null,
+ this.anyErrors, MessageDialog.ERROR, new String[] { "OK" }, 0);
+ errorDialog.open();
+ }
+ }
+ catch (CoreException | InvocationTargetException | InterruptedException e) {
+ BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+ updateSmartContractsCombo(selectedProject);
+ }
+ });// End of compile
+
+
+ this.gridPane.add(toolBar, 0, 0);
+ this.gridPane.add(lblContract, 0, 1);
+ this.gridPane.add(this.cmbSmartContracts, 1, 1);
+
+ toolBar.getItems().add(new Separator());
+
+
+ // gridPane.add(progressBar, 0, 2);
+ ScrollPane scrollPane = new ScrollPane(this.gridPane);
+ scrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
+ scene = new Scene(scrollPane, 550, 400);
+
+ scene.getStylesheets().add(getClass().getResource("Views.css").toExternalForm());
+
+ }
+ catch (Exception e) {
+ BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+ return scene;
+
+ }
+
+ private void constructUI(final String solPath) {
+ Map<String, String> uiComponentForSolidityFile =
+ CoreCommandExecutor.getInstance().getUIComponentForSolidityFile(solPath.split("--")[0], false);
+ if (uiComponentForSolidityFile == null) {
+ return;
+ }
+ Set<Entry<String, String>> entrySet = uiComponentForSolidityFile.entrySet();
+ Iterator<Entry<String, String>> iterator = entrySet.iterator();
+ int row = 2;
+ int col = 0;
+ while (iterator.hasNext()) {
+ Entry<String, String> next = iterator.next();
+ String key = next.getKey();
+ String[] keyValue = key.split("-");
+ String value2 = next.getValue();
+ if (value2.isEmpty()) {
+ Button btnOK = new Button();
+ btnOK.setText(keyValue[0]);
+ Label lblAssign = new Label();
+ lblAssign.setMaxWidth(150);
+ btnOK.setOnAction(val -> {
+ this.invokeSmartContractMessage = "Not Done";
+ try {
+ IRunnableWithProgress invokeSCRunnable = new IRunnableWithProgress() {
+
+ @Override
+ public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ TransactionsViewPart.this.invokeSmartContractMessage = Web3jHandler.getInstance().invokeSCFunction(
+ solPath.split("--")[1], key, solPath.split("--")[0], "", EtherAccountViewPart.getSelectedItem());
+ }
+ catch (Exception e) {
+ BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+ }
+ };
+ new ProgressMonitorDialog(Display.getDefault().getActiveShell()).run(true, false, invokeSCRunnable);
+ Display.getDefault().syncExec(() -> {
+ EtherAccountViewPart.updateView();
+ });
+ }
+ catch (Exception e) {
+ BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+ lblAssign.setText(this.invokeSmartContractMessage);
+ lblAssign.setTooltip(new Tooltip("Click to view in details"));
+ String localLabelValue = this.invokeSmartContractMessage;
+ lblAssign.setOnMouseClicked(
+ m -> MessageDialog.openInformation(Display.getDefault().getActiveShell(), "Value", localLabelValue));
+ });
+ this.gridPane.add(btnOK, col, row);
+ this.gridPane.add(lblAssign, col + 1, row);
+ row = row + 1;
+ col = 0;
+ this.listOfObjects.add(btnOK);
+ this.listOfObjects.add(lblAssign);
+ }
+ else {
+ Button btnOK = new Button();
+ btnOK.setText(keyValue[0]);
+ TextField txtField = new TextField();
+ txtField.setTooltip(new Tooltip(
+ "Enter input args as ; separated text and if any array elements separate them with , - expected arguments " +
+ keyValue[1]));
+ Label lblAssign = new Label();
+ lblAssign.setMaxWidth(150);
+ btnOK.setOnAction(v -> {
+ this.invokeSmartContractMessage = "Not Done";
+ try {
+ IRunnableWithProgress invokeSCRunnable = new IRunnableWithProgress() {
+
+ @Override
+ public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ TransactionsViewPart.this.invokeSmartContractMessage =
+ Web3jHandler.getInstance().invokeSCFunction(solPath.split("--")[1], key, solPath.split("--")[0],
+ txtField.getText(), EtherAccountViewPart.getSelectedItem());
+ }
+ catch (Exception e) {
+ BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+ }
+ };
+ new ProgressMonitorDialog(Display.getDefault().getActiveShell()).run(true, false, invokeSCRunnable);
+ Display.getDefault().syncExec(() -> {
+ EtherAccountViewPart.updateView();
+ });
+ }
+ catch (Exception e) {
+ BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+ lblAssign.setText(this.invokeSmartContractMessage);
+ lblAssign.setTooltip(new Tooltip("Click to view in details"));
+ String localLabelValue = this.invokeSmartContractMessage;
+ lblAssign.setOnMouseClicked(
+ m -> MessageDialog.openInformation(Display.getDefault().getActiveShell(), "Value", localLabelValue));
+ });
+ this.listOfObjects.add(btnOK);
+ this.listOfObjects.add(lblAssign);
+ this.listOfObjects.add(txtField);
+
+ this.gridPane.add(btnOK, col, row);
+ this.gridPane.add(txtField, col + 1, row);
+ this.gridPane.add(lblAssign, col + 2, row);
+ row = row + 1;
+ col = 0;
+ }
+ }
+
+ }
+
+ private Object getCurrentSelectionProject() {
+ Object variable = PlatformUI.getWorkbench().getService(IEvaluationService.class).getCurrentState()
+ .getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME);
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ variable = getFirstElement(variable);
+ return variable instanceof IResource ? ((IResource) variable).getProject()
+ : (projects.length > 0 ? projects[0] : null);
+ }
+
+ private Object getCurrentSelectionResource() {
+ Object variable = PlatformUI.getWorkbench().getService(IEvaluationService.class).getCurrentState()
+ .getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME);
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ variable = getFirstElement(variable);
+ return variable instanceof IResource ? ((IResource) variable) : (projects.length > 0 ? projects[0] : null);
+ }
+
+ private Object getFirstElement(final Object variable) {
+ if ((variable instanceof ISelection) && (variable instanceof IStructuredSelection)) {
+ Object firstElement = ((IStructuredSelection) variable).getFirstElement();
+ if (firstElement instanceof IResource) {
+ return firstElement;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * This returns solidity file path along with the project name to which the solidity file belongs to.
+ *
+ * @param selectedContract
+ * @return
+ */
+ private String getSolPath(final String selectedContract) {
+ Set<IResource> solFiles = (Set<IResource>) this.cmbSmartContracts.getUserData();
+ if (solFiles != null) {
+ for (IResource sol : solFiles) {
+ if (sol.getName().replace(".sol", "").equals(selectedContract)) {
+ return sol.getLocation().toOSString() + "--" + sol.getProject().getName();
+ }
+ }
+ }
+ return "";
+ }
+
+ private String getOutputDirPath(final String selectedContract) {
+ Set<IResource> solFiles = (Set<IResource>) this.cmbSmartContracts.getUserData();
+ for (IResource sol : solFiles) {
+ if (sol.getName().replace(".sol", "").equals(selectedContract)) {
+ return sol.getProject().findMember(SOLIDITY_OUTPUT_FOLDER).getLocation().toOSString();
+ }
+ }
+ return "";
+ }
+
+ private void clearWidgets() {
+ if (!this.listOfObjects.isEmpty()) {
+ for (Object obj : this.listOfObjects) {
+ this.gridPane.getChildren().remove(obj);
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setFxFocus() {
+ // TODO Auto-generated method stub
+
+ }
+
+ private static Set<String> getSmartContracts(final IProject project) {
+ if (project == null) {
+ return Collections.emptySet();
+ }
+ Set<IResource> solFiles = projectToSolidityFilesMap.computeIfAbsent(project.getName(), s -> new HashSet<>());
+ return solFiles.stream().map(IResource::getName).map(r -> r.replace(".sol", "")).collect(Collectors.toSet());
+ }
+
+ private void updateSmartContractsCombo(final IProject project) {
+ if (this.cmbSmartContracts != null) {
+ ObservableList<String> smartContractList = FXCollections.observableArrayList();
+ smartContractList.addAll(getSmartContracts(project));
+ this.cmbSmartContracts.setItems(smartContractList);
+ this.cmbSmartContracts.getSelectionModel().selectFirst();
+ this.cmbSmartContracts.setUserData(projectToSolidityFilesMap.get(project.getName()));
+
+ constructorTextUI();
+ }
+ }
+
+ private void constructorTextUI() {
+ String solPath = getSolPath(this.cmbSmartContracts.getSelectionModel().getSelectedItem()).split("--")[0];
+ Map<String, String> uiComponentForSolidityFile =
+ CoreCommandExecutor.getInstance().getUIComponentForSolidityFile(solPath, true);
+ Set<Entry<String, String>> entrySet = uiComponentForSolidityFile.entrySet();
+ Iterator<Entry<String, String>> iterator = entrySet.iterator();
+
+ Entry<String, String> next = iterator.hasNext() ? iterator.next() : null;
+ if ((next != null) && !next.getValue().equals("")) {
+ this.gridPane.add(this.constructorArgs, 1, 0);
+ this.constructorArgs.setTooltip(new Tooltip(
+ "Enter input args as ; separated text and if any array elements separate them with , - expected arguments " +
+ next.getValue()));
+ }
+ }
+
+}
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/Views.css b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/Views.css
new file mode 100644
index 0000000..6fbb2b3
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/views/Views.css
@@ -0,0 +1,10 @@
+/* JavaFX CSS - Leave this comment until you have at least create one rule which uses -fx-Property */
+.root
+{
+ -fx-padding: 10;
+ -fx-border-style: solid inside;
+ -fx-border-width: 2;
+ -fx-border-insets: 5;
+ -fx-border-radius: 5;
+ -fx-border-color: grey;
+}
\ No newline at end of file
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/wizard/EthereumProjectWizard.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/wizard/EthereumProjectWizard.java
new file mode 100644
index 0000000..98e8370
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/wizard/EthereumProjectWizard.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) Robert Bosch GmbH. All rights reserved.
+ */
+package org.eclipse.blockchain.ui.wizard;
+
+import java.io.IOException;
+
+import org.eclipse.blockchain.core.BlockchainCore;
+import org.eclipse.blockchain.core.ProjectCreator;
+import org.eclipse.blockchain.core.SolidityPreferenceConstants;
+import org.eclipse.blockchain.ui.Activator;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.osgi.service.prefs.BackingStoreException;
+
+/**
+ * @author ADG5COB
+ */
+public class EthereumProjectWizard extends Wizard implements INewWizard {
+
+ private EthereumProjectWizardPage ePWP = null;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void init(final IWorkbench workbench, final IStructuredSelection selection) {
+ setWindowTitle("Ethereum Project Creation");
+ this.ePWP = new EthereumProjectWizardPage("Ethereum Project Creation");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean performFinish() {
+ try {
+ String projectCreationResponse = "";
+ // check if it is an existing/new project
+ if (this.ePWP.isNewProjectToBeCreated()) {
+ // New project
+ String projectNameString = this.ePWP.getProjectNameString();
+ projectCreationResponse =
+ ProjectCreator.getInstance().createNewProject(projectNameString, this.ePWP.getNewProjectPath());
+ ResourcesPlugin.getWorkspace().getRoot().getProject(projectNameString).refreshLocal(IResource.DEPTH_ONE,
+ new NullProgressMonitor());
+ if (projectCreationResponse.equals("")) {
+ InstanceScope.INSTANCE.getNode(SolidityPreferenceConstants.PREF_NODE)
+ .put(SolidityPreferenceConstants.PREF_KEY, this.ePWP.getSolcPathFromTextBox());
+ InstanceScope.INSTANCE.getNode(SolidityPreferenceConstants.PREF_NODE).flush();
+ IFile solFile = ProjectCreator.getInstance().getFirstMatchingSolFile(projectNameString);
+ if (solFile != null) {
+ IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), solFile);
+ }
+ return true;
+ }
+ }
+ else {
+ String ethCheck = ProjectCreator.getInstance().isItAnEthereumProject(this.ePWP.getExistingProjectPath());
+ if (ethCheck.isEmpty()) {
+ // existing project
+ projectCreationResponse =
+ ProjectCreator.getInstance().createExistingProject(this.ePWP.getExistingProjectPath());
+ if (projectCreationResponse.equals("")) {
+ return true;
+ }
+ }
+ else {
+ if (ethCheck.equals("Not Ethereum project")) {
+ if (MessageDialog.openQuestion(getShell(), "Project Not Ethereum Project",
+ "Only if Ethereum nature is present you can import it. Would you like to add it???")) {
+ projectCreationResponse =
+ ProjectCreator.getInstance().createExistingProject(this.ePWP.getExistingProjectPath());
+ if (projectCreationResponse.equals("")) {
+ return true;
+ }
+ }
+ else {
+ return true;
+ }
+ }
+ else {
+ showError("Project Creation Error", ethCheck);
+ }
+ }
+ }
+ showError("Project Creation Error", projectCreationResponse);
+ }
+ catch (IOException | CoreException | BackingStoreException e) {
+ BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, e.getMessage(), e);
+ }
+ return false;
+ }
+
+ private void showError(final String title, final String message) {
+ MessageDialog.openError(Display.getDefault().getActiveShell(), title, message);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void addPages() {
+ super.addPages();
+ addPage(this.ePWP);
+ }
+
+}
diff --git a/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/wizard/EthereumProjectWizardPage.java b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/wizard/EthereumProjectWizardPage.java
new file mode 100644
index 0000000..c6afc21
--- /dev/null
+++ b/org.eclipse.blockchain.ui/src/org/eclipse/blockchain/ui/wizard/EthereumProjectWizardPage.java
@@ -0,0 +1,455 @@
+
+/*
+ * Copyright (c) Robert Bosch GmbH. All rights reserved.
+ */
+package org.eclipse.blockchain.ui.wizard;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.blockchain.core.SolidityPreferenceConstants;
+import org.eclipse.blockchain.core.log.EthereumLogService;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.wizard.WizardPage;
+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.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+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.Control;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author ADG5COB
+ */
+public class EthereumProjectWizardPage extends WizardPage {
+
+ private Label projectNameLabel = null;
+ private Text projectNameText = null;
+ private String projectNameString;
+ private final String projectNameError = "Project Name cannot be empty!!!";
+ private final String existingProjectpathError = "Project paath cannot be empty!!!";
+ private String projectTemplateToBeCreated = null;
+ private boolean testNetTobeCreated = false;
+ private Text solcPathText;
+ private String solcPathString = "";
+ private Text existingProjectPathText;
+ private Text newProjectPathText;
+ private Button newPrjButton;
+ private Button existingPrjButton;
+ Color greyColor = new Color(Display.getDefault(), new RGB(128, 128, 128));
+
+ /**
+ * @param pageName page name
+ */
+ protected EthereumProjectWizardPage(final String pageName) {
+ super(pageName);
+ setPageComplete(false);
+ setTitle("New Ethereum Project");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void createControl(final Composite parent) {
+ Composite wizardContainer = new Composite(parent, SWT.None);
+ GridLayout containerGrid = new GridLayout(2, false);
+ GridData genericGridData = new GridData(GridData.FILL_BOTH);
+ genericGridData.minimumHeight = 50;
+ wizardContainer.setLayout(containerGrid);
+ wizardContainer.setLayoutData(genericGridData);
+
+// Select if it has to be imported as new or existing project
+ Group newOrExistingGrp = new Group(wizardContainer, NONE);
+ newOrExistingGrp.setLayout(new GridLayout(3, true));
+ newOrExistingGrp.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ GridData gridData = new GridData(SWT.FILL, SWT.LEFT, true, false, 1, 1);
+ Label importAs = new Label(newOrExistingGrp, SWT.NONE);
+ importAs.setText("Import project as: ");
+ importAs.setLayoutData(gridData);
+
+ this.newPrjButton = new Button(newOrExistingGrp, SWT.RADIO);
+ gridData = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
+ this.newPrjButton.setLayoutData(gridData);
+ this.newPrjButton.setText("New project");
+
+ this.existingPrjButton = new Button(newOrExistingGrp, SWT.RADIO);
+ gridData = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
+ this.existingPrjButton.setText("Existing project");
+ this.existingPrjButton.setLayoutData(gridData);
+
+ // create a group to for new project creation related widgets
+
+ Group newPrjGrp = new Group(wizardContainer, NONE);
+ newPrjGrp.setLayout(new GridLayout(3, false));
+ newPrjGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
+ newPrjGrp.setText("New project");
+
+ gridData = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
+ this.projectNameLabel = new Label(newPrjGrp, SWT.None);
+ this.projectNameLabel.setText("Project Name : ");
+ this.projectNameLabel.setLayoutData(gridData);
+ this.projectNameText = new Text(newPrjGrp, SWT.BORDER);
+ gridData = new GridData(SWT.FILL, SWT.LEFT, true, true, 2, 1);
+ this.projectNameText.setLayoutData(gridData);
+
+ gridData = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
+ Label projectPath = new Label(newPrjGrp, SWT.None);
+ projectPath.setText("Project path : ");
+ projectPath.setLayoutData(gridData);
+
+ this.newProjectPathText = new Text(newPrjGrp, SWT.BORDER);
+ gridData = new GridData(SWT.FILL, SWT.LEFT, true, false, 1, 1);
+ this.newProjectPathText.setLayoutData(gridData);
+ String workspaceLocation = ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString();
+ this.newProjectPathText.setText(workspaceLocation);
+
+
+ Button newPrjPathBrowseButton = new Button(newPrjGrp, SWT.PUSH);
+ newPrjPathBrowseButton.setText("Browse");
+ gridData = new GridData(SWT.FILL, SWT.LEFT, false, false, 1, 1);
+ newPrjPathBrowseButton.setLayoutData(gridData);
+
+ newPrjPathBrowseButton.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ DirectoryDialog prjPathDialog = new DirectoryDialog(parent.getShell());
+ prjPathDialog.setFilterPath(workspaceLocation);
+ String selectedDir = prjPathDialog.open();
+ if (selectedDir != null) {
+ EthereumProjectWizardPage.this.newProjectPathText.setText(selectedDir);
+ }
+
+ }
+
+ @Override
+ public void widgetDefaultSelected(final SelectionEvent e) {
+ // do nothing
+ }
+ });
+
+
+ // project template section
+
+ Label projectTemplateGroup = new Label(newPrjGrp, SWT.SHADOW_ETCHED_IN);
+ projectTemplateGroup.setText("Project Template : ");
+
+ gridData = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
+ projectTemplateGroup.setLayoutData(gridData);
+
+
+ // combo for project selection
+ Combo projectTemplateSelection = new Combo(newPrjGrp, NONE);
+ // Only simple project is supported for now - , "Web project", "Angular JS Project", "React Js Project"
+ projectTemplateSelection.setItems("Simple project");
+ projectTemplateSelection.setLayoutData(gridData);
+ projectTemplateSelection.select(0);
+ setProjectTemplateToBeImported(projectTemplateSelection.getText());
+ projectTemplateSelection.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ setProjectTemplateToBeImported(projectTemplateSelection.getText());
+ }
+ });
+
+ // existing project section
+ Group existingPrjGrp = new Group(wizardContainer, NONE);
+ existingPrjGrp.setLayout(new GridLayout(3, false));
+ existingPrjGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
+ existingPrjGrp.setText("Existing project");
+
+
+ gridData = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
+ Label newProjectPath = new Label(existingPrjGrp, SWT.None);
+ newProjectPath.setText("Project path : ");
+ newProjectPath.setLayoutData(gridData);
+
+ this.existingProjectPathText = new Text(existingPrjGrp, SWT.BORDER);
+ gridData = new GridData(SWT.FILL, SWT.LEFT, true, false, 1, 1);
+ this.existingProjectPathText.setLayoutData(gridData);
+
+ this.existingProjectPathText.addModifyListener(new ModifyListener() {
+
+ @Override
+ public void modifyText(final ModifyEvent e) {
+ if (getTextBoxText(EthereumProjectWizardPage.this.existingProjectPathText).trim().isEmpty()) {
+ setPageComplete(false);
+ setErrorMessage(EthereumProjectWizardPage.this.existingProjectpathError);
+ }
+ else {
+ setPageComplete(true);
+ setErrorMessage(null);
+ }
+ }
+ });
+
+ Button existingPrjPathBrowseButton = new Button(existingPrjGrp, SWT.PUSH);
+ existingPrjPathBrowseButton.setText("Browse");
+ gridData = new GridData(SWT.FILL, SWT.LEFT, false, false, 1, 1);
+ existingPrjPathBrowseButton.setLayoutData(gridData);
+
+ existingPrjPathBrowseButton.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ DirectoryDialog prjPathDialog = new DirectoryDialog(parent.getShell());
+ prjPathDialog.setFilterPath(System.getProperty("user.dir"));
+ String selectedDir = prjPathDialog.open();
+ if ((selectedDir != null) && !selectedDir.equals("")) {
+ setPageComplete(true);
+ setErrorMessage(null);
+ EthereumProjectWizardPage.this.existingProjectPathText.setText(selectedDir);
+ }
+ else {
+ setErrorMessage(EthereumProjectWizardPage.this.existingProjectpathError);
+ setPageComplete(false);
+ }
+
+ }
+
+ @Override
+ public void widgetDefaultSelected(final SelectionEvent e) {
+ // do nothing
+ }
+ });
+
+
+ // Enable the new/existing fiel import depending on the radio button selection
+
+ this.newPrjButton.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ // Enable the new project creation group
+ newPrjGrp.setEnabled(true);
+ newPrjGrp.setForeground(null);
+ setForeGroundToChildren(newPrjGrp.getChildren(), null);
+
+ // Disable existing project creation
+ existingPrjGrp.setEnabled(false);
+ existingPrjGrp.setForeground(EthereumProjectWizardPage.this.greyColor);
+ setForeGroundToChildren(existingPrjGrp.getChildren(), EthereumProjectWizardPage.this.greyColor);
+ }
+
+ @Override
+ public void widgetDefaultSelected(final SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+
+
+ this.existingPrjButton.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ newPrjGrp.setEnabled(false);
+ newPrjGrp.setForeground(EthereumProjectWizardPage.this.greyColor);
+ setForeGroundToChildren(newPrjGrp.getChildren(), EthereumProjectWizardPage.this.greyColor);
+
+
+ existingPrjGrp.setEnabled(true);
+ existingPrjGrp.setForeground(null);
+ setForeGroundToChildren(existingPrjGrp.getChildren(), null);
+ }
+
+ @Override
+ public void widgetDefaultSelected(final SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+
+ // compiler section
+
+ Group compilerGrp = new Group(wizardContainer, NONE);
+ compilerGrp.setLayout(new GridLayout(3, false));
+ compilerGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
+ compilerGrp.setText("Compiler settings");
+
+
+ Label solcLabel = new Label(compilerGrp, SWT.NONE);
+ solcLabel.setText("Solidity compiler path : ");
+ gridData = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
+ solcLabel.setLayoutData(gridData);
+
+
+ this.solcPathText = new Text(compilerGrp, SWT.BORDER);
+ this.solcPathText.setText(getSolcPath());
+ gridData = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
+ this.solcPathText.setLayoutData(gridData);
+
+
+ Button compilerPathBrowseButton = new Button(compilerGrp, SWT.PUSH);
+ compilerPathBrowseButton.setText("Browse");
+ gridData = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
+ compilerPathBrowseButton.setLayoutData(gridData);
+
+ compilerPathBrowseButton.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ DirectoryDialog solcCompilerPathDialog = new DirectoryDialog(parent.getShell());
+ solcCompilerPathDialog.setFilterPath(System.getProperty("user.dir"));
+ String selectedDir = solcCompilerPathDialog.open();
+ if (selectedDir != null) {
+ EthereumProjectWizardPage.this.solcPathText.setText(selectedDir);
+ }
+
+ }
+
+ @Override
+ public void widgetDefaultSelected(final SelectionEvent e) {
+ // do nothing
+ }
+ });
+
+ Link solidityGitLink = new Link(compilerGrp, SWT.UNDERLINE_LINK);
+ solidityGitLink.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false, 3, 1));
+ solidityGitLink.setText("<a>Solidity Compiler Download</a>");
+ solidityGitLink.setToolTipText(
+ "Download solidity compiler from this link and provide the file system path in above preference dialog");
+ solidityGitLink.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ try {
+ PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser()
+ .openURL(new URL(SolidityPreferenceConstants.SOLIDITY_GIT_URL));
+ }
+ catch (PartInitException | MalformedURLException e1) {
+ EthereumLogService.INSTANCE.log(e1.getMessage());
+ e1.printStackTrace();
+ }
+ }
+ });
+
+ setControl(wizardContainer);
+ setErrorMessage(this.projectNameError);
+
+ addButtonListeners();
+ }
+
+ private void setForeGroundToChildren(final Control[] children, final Color color) {
+ for (Control child : children) {
+ if ((child instanceof Text)) {
+ ((Text) child).setEditable(color == null);
+ }
+ child.setForeground(color);
+ }
+ }
+
+ private String getSolcPath() {
+ return InstanceScope.INSTANCE.getNode(SolidityPreferenceConstants.PREF_NODE)
+ .get(SolidityPreferenceConstants.PREF_KEY, "");
+ }
+
+ private void addButtonListeners() {
+ this.projectNameText.addModifyListener((final ModifyEvent e) -> {
+ if (!getTextBoxText(this.projectNameText).trim().equals("")) {
+ setPageComplete(true);
+ setErrorMessage(null);
+ }
+ else {
+ setPageComplete(false);
+ setErrorMessage(this.projectNameError);
+ }
+ });
+ }
+
+ private String getTextBoxText(final Text textBox) {
+ Display.getDefault().syncExec(() -> this.projectNameString = textBox.getText());
+ return this.projectNameString;
+ }
+
+ /**
+ * @return -
+ */
+ public String getSolcPathFromTextBox() {
+ Display.getDefault().syncExec(() -> this.solcPathString = this.solcPathText.getText());
+ return this.solcPathString;
+ }
+
+ /**
+ * @return
+ */
+ public String getNewProjectPath() {
+ return this.newProjectPathText.getText();
+ }
+
+ /**
+ * @return
+ */
+ public String getExistingProjectPath() {
+ return this.existingProjectPathText.getText();
+ }
+
+ /**
+ * @return
+ */
+ public boolean isNewProjectToBeCreated() {
+ return this.newPrjButton.getSelection();
+ }
+
+ /**
+ * @return - The project name entered in project creation wizard
+ */
+ public String getProjectNameString() {
+ return this.projectNameString;
+ }
+
+
+ /**
+ * @return the selectedProject
+ */
+ public String getProjectTemplaeToBeCreated() {
+ return this.projectTemplateToBeCreated;
+ }
+
+
+ /**
+ * @param selectedProject the selectedProject to set
+ */
+ public void setProjectTemplateToBeImported(final String selectedProject) {
+ this.projectTemplateToBeCreated = selectedProject;
+ }
+
+
+ /**
+ * @return the testNetTobeCreated
+ */
+ public boolean isTestNetTobeCreated() {
+ return this.testNetTobeCreated;
+ }
+
+ /**
+ * @param testNetTobeCreated the testNetTobeCreated to set
+ */
+ public void setTestNetTobeCreated(final boolean testNetTobeCreated) {
+ this.testNetTobeCreated = testNetTobeCreated;
+ }
+}