+
+
+
+
+
+
\ No newline at end of file
diff --git a/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/Aspose.Email Java for IntelliJ (Maven).iml b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/Aspose.Email Java for IntelliJ (Maven).iml
new file mode 100644
index 0000000..71bea68
--- /dev/null
+++ b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/Aspose.Email Java for IntelliJ (Maven).iml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/LICENSE b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/LICENSE
new file mode 100644
index 0000000..8002026
--- /dev/null
+++ b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2001-2015 Aspose Pty Ltd.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/META-INF/plugin.xml b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/META-INF/plugin.xml
new file mode 100644
index 0000000..317809c
--- /dev/null
+++ b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/META-INF/plugin.xml
@@ -0,0 +1,28 @@
+
+
+ com.aspose.email.java.intellij.maven
+ Aspose.Email Java for IntelliJ IDEA Maven
+ 1.0.0.0
+ Aspose Pty Ltd.
+
+
+ Aspose.Email for Java API allows developers to create as well as read message files, enabling complete processing of message contents.
Aspose.Email for Java enables you to create, read and manipulate Outlook MSG, PST, EML, EMLX and MHT files from within a Java application without the need of using Microsoft Outlook. The API also allows connecting to email servers and send/receive emails. It's support for POP3, IMAP and SMTP protocols provide complete capability of working with SSL as well as non-SSL email servers.
The plugin's Aspose.Email Maven Project wizard lets you create a Aspose.Email Java API maven project by fetching & referencing the latest API mvn artifact from the Aspose Cloud Maven Repository.
Plugin provided wizards also gives you option to download & import the example source codes for using Aspose.Email for Java API.
After the completion of wizard, project will be created and API examples are downloaded. All references and required resources will also be automatically added to the project.
You can then import / use codes (using option File-> New-> Aspose.Email Example) from downloaded examples for your project needs and enhance them as necessary.
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/README.md b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/README.md
new file mode 100644
index 0000000..e52fad3
--- /dev/null
+++ b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/README.md
@@ -0,0 +1,44 @@
+## Aspose.Email Java for IntelliJ IDEA (Maven)
+
+The project is **Intellij IDEA (JetBrains IDE) plugin** allows developer to create, read and manipulate Outlook MSG, PST, EML, EMLX and MHT messages using API -**Aspose.Email for Java** that enables you the processing of email messages from within your Java code without the need of using Microsoft Outlook.
+
+The plugins is for those who wants to utilize / use **Aspose.Email for Java API** in their java projects.
+
+The plugin contains two wizards:
+
+1. **Aspose-Email Maven Project** Wizard - To create **Aspose.Email for Java API** Maven project
+2. **Aspose.Email Examples** - To create / download **Aspose.Email for Java API** Examples Source Codes (Which is meant to demonstrate the usages of the API)
+
+**Wizards Detail:**
+
+1. **Aspose.Email Maven Project** wizard, after installing the plugin, can be run from **File->New Project->Aspose.Email Maven Project** option. You will have to follow the wizard steps asking for the project information i.e **Project Name, Artifact ID** for your maven project or whether you want to download the Examples Source Codes (for later addition into the project).
+2. **Aspose.Email Examples** wizard lets you create /copy downloaded Source Code Examples into your project. All the examples withn the selected category will be copied/ created inside "**com.aspose.email.examples**" package and also the corresponding directory structure for the package will be created within "src/main/resources" folder which is needed to run the examples.
+
+## What is Aspose.Email Java API?
+
+Managing and manipulating emails that come in through Microsoft Outlook doesn’t have to be difficult. It doesn’t even have to involve Outlook. **Aspose.Email for Java** lets you focus on the business logic by hiding the complexities of the Microsoft Outlook file formats implementation. It gives you the tools you need to create, read and manipulate **Outlook MSG, PST, EML and MHT** files from within a Java application.
+
+**Aspose.Email for Java** includes classes that allow you to create as well as read message files, enabling complete processing of message contents. **You can manipulate a number of message formats such as MSG, EML, EMLX, and MHT without the need of using Microsoft Outlook**. You can not only modify the message contents, but also manipulate (add/remove) message attachments. It provides you sufficient ability to customize message headers and also empowers you to completely control a message by exposing its Mapi properties.
+
+Aspose.Email API also provides the ability to manipulate message storage files i.e. Personal Storage Files (PST) and Offline Storage Files (OST). You can create PST, add messages to it, extract information from various PST folders, and remove items from the PST with just a few lines of code. Its powerful API gives you complete access to the contents of a PST for manipulation.
+
+For more info about the **Aspose.Email for Java API**, [please check the api documentation - click here](http://goo.gl/idmYQ1)
+
+## Plugin Documentation
+
+For the complete documentation of this Intellij IDEA plugin, [please go through this wiki - click here](http://goo.gl/j0rSTJ)
+
+## Download Latest Versions?
+
+
+* [Latest Releases on Codeplex](https://asposeemailjavaintellij.codeplex.com/releases/view)
+
+
+
+## Clone Plugin SourceCodes?
+
+
+This project is also hosted and maintained at CodePlex. To clone navigate to:
+
+
+* [Aspose.Email Java for IntelliJ Maven on CodePlex - click here](https://asposeemailjavaintellij.codeplex.com/SourceControl/latest)
diff --git a/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/lib/org.eclipse.jgit-3.4.1.201406201815-r.jar b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/lib/org.eclipse.jgit-3.4.1.201406201815-r.jar
new file mode 100644
index 0000000..1018c85
Binary files /dev/null and b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/lib/org.eclipse.jgit-3.4.1.201406201815-r.jar differ
diff --git a/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/src/Bundle.properties b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/src/Bundle.properties
new file mode 100644
index 0000000..fbbfc03
--- /dev/null
+++ b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/src/Bundle.properties
@@ -0,0 +1,26 @@
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2001-2015 Aspose Pty Ltd.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+AsposeWizardPanel.myMainPanel.border.title=Description:
+AsposeWizardPanel.myMainPanel.description= < Aspose.Email for Java API allows developers to create as well as read message files, enabling complete processing of message contents.
Aspose.Email for Java enables you to create, read and manipulate Outlook MSG, PST, EML, EMLX and MHT files from within a Java application without the need of using Microsoft Outlook. The API also allows connecting to email servers and send/receive emails. It's support for POP3, IMAP and SMTP protocols provide complete capability of working with SSL as well as non-SSL email servers.
The plugin's Aspose.Email Maven Project wizard lets you create a Aspose.Email Java API maven project by fetching & referencing the latest API mvn artifact from the Aspose Cloud Maven Repository.
Plugin provided wizards also gives you option to download & import the example source codes for using Aspose.Email for Java API.
After the completion of wizard, project will be created and API examples are downloaded. All references and required resources will also be automatically added to the project.
You can then import / use codes (using option File-> New-> Aspose.Email Example) from downloaded examples for your project needs and enhance them as necessary.
+AsposeWizardPanel.WizardStep.ExampleChkbox=Also Download Example Source Codes (of Aspose.Email for Java)
+AsposeWizardPanel.WizardStep.headingMavn=Please provide your creating maven project artifact detail:
+
+AsposeManager.progressMessage=Retrieving Aspose.Email for java - Maven Dependency...
+AsposeManager.projectMessage=Creating Aspose.Email maven project...
+AsposeManager.progressTitle=Retrieving Latest Maven artifact...
+AsposeManager.progressExamplesTitle=Downloading Example Source Codes...
+AsposeManager.downloadExamplesMessage=Downloading Aspose.Email for java - Example Source Codes...
+
+AsposeExamples.title=Aspose.Email Example
+AsposeExamples.message=Aspose.Email Examples allow you to add Aspose sourcecode examples to demonstrate Aspose.Email Java API usage. Available samples are displayed in tree format from where you can select one. Selected category examples will be added to current project including source files and required data files.
+AsposeExample.jLabel1_text=Aspose.Email for Java (version):
diff --git a/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/src/com/aspose/examples/AsposeExampleAction.java b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/src/com/aspose/examples/AsposeExampleAction.java
new file mode 100644
index 0000000..e6f3892
--- /dev/null
+++ b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/src/com/aspose/examples/AsposeExampleAction.java
@@ -0,0 +1,41 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2001-2015 Aspose Pty Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+package com.aspose.examples;
+
+import com.aspose.utils.AsposeMavenProjectManager;
+import com.aspose.utils.AsposeEmailJavaAPI;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.project.DumbAware;
+import com.intellij.openapi.project.Project;
+
+import java.util.ResourceBundle;
+
+/**
+ * Created by Adeel Ilyas on 9/9/2015.
+ */
+public class AsposeExampleAction extends AnAction implements DumbAware {
+ public void actionPerformed(AnActionEvent e) {
+ final Project project = getEventProject(e);
+ if (project == null) {
+ return;
+ }
+ ResourceBundle bundle = ResourceBundle.getBundle("Bundle");
+ AsposeMavenProjectManager asposeMavenProjectManager = AsposeMavenProjectManager.initialize(project);
+ AsposeEmailJavaAPI.initialize(asposeMavenProjectManager);
+ final AsposeExampleDialog dialog = new AsposeExampleDialog(bundle.getString("AsposeExamples.title"),bundle.getString("AsposeExamples.message"));
+ dialog.show();
+ }
+
+
+}
diff --git a/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/src/com/aspose/examples/AsposeExampleCallback.java b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/src/com/aspose/examples/AsposeExampleCallback.java
new file mode 100644
index 0000000..cf54f24
--- /dev/null
+++ b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/src/com/aspose/examples/AsposeExampleCallback.java
@@ -0,0 +1,69 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2001-2015 Aspose Pty Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+package com.aspose.examples;
+
+
+import com.aspose.utils.AsposeJavaAPI;
+import com.aspose.utils.AsposeEmailJavaAPI;
+import com.aspose.utils.execution.CallBackHandler;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.ModalityState;
+import com.intellij.openapi.progress.ProgressIndicator;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Created by Adeel Ilyas on 9/9/2015.
+ */
+public class AsposeExampleCallback implements CallBackHandler {
+
+ public AsposeExamplePanel getPage() {
+ return page;
+ }
+
+ private AsposeExamplePanel page;
+ CustomMutableTreeNode top;
+ public AsposeExampleCallback(AsposeExamplePanel page,CustomMutableTreeNode top) {
+ this.page = page;
+ this.top = top;
+ }
+ @Override
+ public boolean executeTask(@NotNull ProgressIndicator progressIndicator) {
+ // progressIndicator.setIndeterminate(true);
+ // Set the progress bar percentage and text
+ progressIndicator.setFraction(0.10);
+
+ progressIndicator.setText("Preparing to refresh examples");
+
+ final String item = (String) page.getComponentSelection().getSelectedItem();
+
+ if (item != null && !item.equals("Select Java API")) {
+ ApplicationManager.getApplication().invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ page.diplayMessage("Please wait. Preparing to refresh examples", true);
+ }
+ }, ModalityState.defaultModalityState());
+
+ progressIndicator.setFraction(0.20);
+ AsposeJavaAPI component = AsposeEmailJavaAPI.getInstance();
+ component.checkAndUpdateRepo(progressIndicator);
+ if (component.isExamplesDefinitionAvailable()) {
+ progressIndicator.setFraction(0.60);
+ page.populateExamplesTree(component, top,progressIndicator);
+ }
+ }
+
+ progressIndicator.setFraction(1);
+ return true;
+ }
+}
diff --git a/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/src/com/aspose/examples/AsposeExampleDialog.java b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/src/com/aspose/examples/AsposeExampleDialog.java
new file mode 100644
index 0000000..f79c6b7
--- /dev/null
+++ b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/src/com/aspose/examples/AsposeExampleDialog.java
@@ -0,0 +1,147 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2001-2015 Aspose Pty Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+package com.aspose.examples;
+
+import com.aspose.utils.*;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.ui.DialogWrapper;
+import org.w3c.dom.NodeList;
+
+import javax.swing.*;
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * Created by Adeel Ilyas on 9/9/2015.
+ */
+
+public class AsposeExampleDialog extends DialogWrapper {
+ private static final Logger LOG = Logger.getInstance("#com.aspose.examples.AsposeExampleDialog");
+
+ private final String myDescription;
+ private AsposeExamplePanel component;
+
+ public AsposeExampleDialog(final String title, String description) {
+ super(false);
+ myDescription = description;
+ setTitle(title);
+ init();
+ setOKButtonText("Create");
+ setOKActionEnabled(false);
+ }
+
+ public void updateControls(boolean selection) {
+ setOKActionEnabled(selection);
+ }
+
+ @Override
+ protected void doOKAction() {
+ super.doOKAction();
+ createExample();
+ AsposeMavenProjectManager.getInstance().getProjectHandle().getProjectFile().getFileSystem().refresh(false);
+ AsposeMavenProjectManager.getInstance().getProjectHandle().getBaseDir().getFileSystem().refresh(false);
+ }
+
+ @Override
+ public JComponent getPreferredFocusedComponent() {
+ AsposeConstants.println("AsposeExamplePanel getComponent(): is called ...");
+ if (component == null) {
+ component = new AsposeExamplePanel(this);
+ }
+
+ return component.getComponentSelection();
+ }
+
+ @Override
+ protected JComponent createCenterPanel() {
+ AsposeConstants.println("AsposeExamplePanel getComponent(): is called ...");
+ if (component == null) {
+ component = new AsposeExamplePanel(this);
+ }
+ return component;
+ }
+
+ @Override
+ protected String getDimensionServiceKey() {
+ return "#com.aspose.examples.AsposeExampleDialog";
+ }
+
+ //=========================================================================
+
+
+ //=========================================================================
+ private boolean createExample() {
+ String projectPath = component.getSelectedProjectRootPath();
+ CustomMutableTreeNode comp = getSelectedNode();
+ if (comp == null || !comp.isFolder()) {
+ return false;
+ }
+ try {
+
+ String sourceRepositoryExamplePath = comp.getExPath();
+
+ String repositorylocation = AsposeEmailJavaAPI.getInstance().getLocalRepositoryPath();
+ String repositoryPOM_XML=repositorylocation+File.separator+"Examples"+File.separator+AsposeConstants.MAVEN_POM_XML;
+
+ NodeList examplesNoneAsposeDependencies=AsposeMavenProjectManager.getInstance().getDependenciesFromPOM(repositoryPOM_XML,AsposeConstants.ASPOSE_GROUP_ID);
+
+ AsposeMavenProjectManager.getInstance().addMavenDependenciesInProject(examplesNoneAsposeDependencies);
+
+ NodeList examplesNoneAsposeRepositories=AsposeMavenProjectManager.getInstance().getRepositoriesFromPOM(repositoryPOM_XML, AsposeConstants.ASPOSE_MAVEN_REPOSITORY);
+
+ AsposeMavenProjectManager.getInstance().addMavenRepositoriesInProject(examplesNoneAsposeRepositories);
+
+ String sourceExamplesUtilsPath= repositorylocation+File.separator+AsposeConstants.REPOSITORY_UTIL;
+ String destinationExamplesUtilsPath = projectPath + File.separator + sourceExamplesUtilsPath.replace(repositorylocation + File.separator + AsposeConstants.SOURCE_API_EXAMPLES_LOCATION, AsposeConstants.DESTINATION_API_EXAMPLES_LOCATION);
+
+ String destinationExamplePath = projectPath + File.separator + sourceRepositoryExamplePath.replace(repositorylocation + File.separator + AsposeConstants.SOURCE_API_EXAMPLES_LOCATION, AsposeConstants.DESTINATION_API_EXAMPLES_LOCATION);
+
+ String destinationResourcePath = projectPath + File.separator + sourceRepositoryExamplePath.replace(repositorylocation + File.separator + AsposeConstants.SOURCE_API_EXAMPLES_LOCATION, AsposeConstants.DESTINATION_API_EXAMPLES_RESOURCES_LOCATION);
+
+
+ String sourceRepositoryExampleResourcesPath = sourceRepositoryExamplePath.replace(AsposeConstants.SOURCE_API_EXAMPLES_LOCATION, AsposeConstants.SOURCE_API_EXAMPLES_RESOURCES_LOCATION);
+
+ //Copying Example Category
+ copyExample(sourceRepositoryExamplePath, destinationExamplePath);
+
+ //Copying Example Resoureces
+ copyExample(sourceRepositoryExampleResourcesPath, destinationResourcePath);
+
+
+ //Copying Utils.java
+ AsposeMavenProjectManager.copyDirectory(new File(sourceExamplesUtilsPath + File.separator), new File(destinationExamplesUtilsPath + File.separator));
+
+ if (sourceRepositoryExamplePath == null || comp == null) {
+ return false;
+ }
+
+ } catch (Exception ex) {
+ return false;
+ }
+ return true;
+ }
+
+ //=========================================================================
+ private CustomMutableTreeNode getSelectedNode() {
+ return (CustomMutableTreeNode) component.getExamplesTree().getLastSelectedPathComponent();
+ }
+
+ //=========================================================================
+ private void copyExample(String sourcePath, String destinationPath) {
+ try {
+ AsposeMavenProjectManager.copyDirectory(sourcePath, destinationPath);
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+}
diff --git a/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/src/com/aspose/examples/AsposeExamplePanel.java b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/src/com/aspose/examples/AsposeExamplePanel.java
new file mode 100644
index 0000000..ff03818
--- /dev/null
+++ b/Plugins/Aspose_Email_Java_for_IntelliJ(Maven)/src/com/aspose/examples/AsposeExamplePanel.java
@@ -0,0 +1,355 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2001-2015 Aspose Pty Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+package com.aspose.examples;
+
+import com.aspose.utils.AsposeConstants;
+import com.aspose.utils.AsposeJavaAPI;
+import com.aspose.utils.AsposeMavenProjectManager;
+import com.aspose.utils.FormatExamples;
+import com.aspose.utils.execution.ModalTaskImpl;
+import com.intellij.openapi.progress.ProgressIndicator;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.ui.ComboBox;
+import com.intellij.ui.components.JBScrollPane;
+import com.intellij.ui.treeStructure.Tree;
+
+import javax.swing.*;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreePath;
+import java.awt.*;
+import java.io.File;
+import java.util.*;
+
+/**
+ * Created by Adeel Ilyas on 9/9/2015.
+ */
+
+public final class AsposeExamplePanel extends JPanel {
+
+ AsposeExampleDialog dialog;
+
+ /**
+ * Creates new form AsposeExamplePanel
+ */
+ public AsposeExamplePanel(AsposeExampleDialog dialog) {
+ initComponents();
+ initComponentsUser();
+ this.dialog = dialog;
+
+ }
+
+ private void initComponentsUser() {
+ CustomMutableTreeNode top = new CustomMutableTreeNode("");
+ read();
+ validateDialog();
+ }
+
+ @Override
+ public String getName() {
+ return AsposeConstants.API_NAME + " for Java API and Examples";
+ }
+
+ private void initComponents() {
+ ResourceBundle bundle = ResourceBundle.getBundle("Bundle");
+ jPanel1 = new JPanel();
+ jLabel2 = new JLabel();
+ componentSelection = new ComboBox();
+
+ jLabel1 = new JLabel();
+ jLabelMessage = new JLabel();
+ jLabelMessage.setOpaque(true);
+ jScrollPane1 = new JBScrollPane();
+
+ examplesTree = new Tree();
+
+ jPanel1.setBackground(new Color(255, 255, 255));
+ jPanel1.setBorder(BorderFactory.createEtchedBorder());
+ jPanel1.setForeground(new Color(255, 255, 255));
+
+ jLabel2.setIcon(icon); // NOI18N
+ jLabel2.setText("");
+
+
+ jLabel2.setHorizontalAlignment(SwingConstants.CENTER);
+ jLabel2.setDoubleBuffered(true);
+ jLabel2.setOpaque(true);
+ jLabel2.addComponentListener(new java.awt.event.ComponentAdapter() {
+ public void componentResized(java.awt.event.ComponentEvent evt) {
+ jLabel2ComponentResized(evt);
+ }
+ });
+
+
+ GroupLayout jPanel1Layout = new GroupLayout(jPanel1);
+ jPanel1.setLayout(jPanel1Layout);
+ jPanel1Layout.setHorizontalGroup(
+ jPanel1Layout.createParallelGroup()
+ .addComponent(jLabel2, GroupLayout.PREFERRED_SIZE, 390, Short.MAX_VALUE)
+ );
+ jPanel1Layout.setVerticalGroup(
+ jPanel1Layout.createParallelGroup()
+ .addGroup(GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
+ .addComponent(jLabel2)
+ .addGap(0, 0, Short.MAX_VALUE))
+ );
+ componentSelection.setModel(new DefaultComboBoxModel());
+
+
+ componentSelection.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
+ public void propertyChange(java.beans.PropertyChangeEvent evt) {
+ componentSelection_Propertychanged(evt);
+ }
+ });
+ jLabel1.setText(bundle.getString("AsposeExample.jLabel1_text"));
+ jLabelMessage.setText("");
+ examplesTree.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ examplesTree_clicked(evt);
+ }
+ });
+ jScrollPane1.setViewportView(examplesTree);
+
+ GroupLayout layout = new GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(jScrollPane1)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel1)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(componentSelection, GroupLayout.PREFERRED_SIZE, 198, GroupLayout.PREFERRED_SIZE))
+ .addComponent(jLabelMessage, GroupLayout.PREFERRED_SIZE, 361, GroupLayout.PREFERRED_SIZE)
+ .addComponent(jPanel1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jPanel1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(componentSelection, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel1, GroupLayout.PREFERRED_SIZE, 23, GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 229, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jLabelMessage, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
+ );
+ }
+
+ //=========================================================================
+ private void jLabel2ComponentResized(java.awt.event.ComponentEvent evt) {
+ int labelwidth = jLabel2.getWidth();
+ int labelheight = jLabel2.getHeight();
+ Image img = icon.getImage();
+ jLabel2.setIcon(new ImageIcon(img.getScaledInstance(labelwidth, labelheight, Image.SCALE_FAST)));
+ }
+
+ public String getSelectedProjectRootPath() {
+ return AsposeMavenProjectManager.getInstance().getProjectHandle().getBasePath();
+ }
+
+ //=========================================================================
+ void read() {
+ AsposeConstants.println(" === New File Visual Panel.read() === " + AsposeMavenProjectManager.getInstance().getProjectHandle().getBaseDir().getName());
+ retrieveAPIDependency();
+ retrieveAPIExamples();
+ }
+
+ //=========================================================================
+ private boolean retrieveAPIDependency() {
+ getComponentSelection().removeAllItems();
+ String versionNo = AsposeMavenProjectManager.getInstance().getDependencyVersionFromPOM(AsposeConstants.API_MAVEN_DEPENDENCY);
+ if (versionNo == null) {
+ getComponentSelection().addItem(AsposeConstants.API_DEPENDENCY_NOT_FOUND);
+ } else {
+ getComponentSelection().addItem(versionNo);
+ }
+ return true;
+ }
+
+ //=========================================================================
+ private void retrieveAPIExamples() {
+ final String item = (String) getComponentSelection().getSelectedItem();
+ CustomMutableTreeNode top = new CustomMutableTreeNode("");
+ DefaultTreeModel model = (DefaultTreeModel) getExamplesTree().getModel();
+ model.setRoot(top);
+ model.reload(top);
+ if (item != null && !item.equals(AsposeConstants.API_DEPENDENCY_NOT_FOUND)) {
+
+ AsposeExampleCallback callback = new AsposeExampleCallback(this, top);
+ final ModalTaskImpl modalTask = new ModalTaskImpl(AsposeMavenProjectManager.getInstance().getProjectHandle(), callback, "Please wait...");
+ ProgressManager.getInstance().run(modalTask);
+ top.setTopTreeNodeText(AsposeConstants.API_NAME);
+ model.setRoot(top);
+ model.reload(top);
+ getExamplesTree().expandPath(new TreePath(top.getPath()));
+
+ }
+
+ }
+
+//=========================================================================
+
+ @Override
+ public void validate() {
+ AsposeConstants.println("AsposeExamplePanel validate called..");
+ }
+
+ //=========================================================================
+ public boolean validateDialog() {
+ if (isExampleSelected()) {
+ if (dialog != null)
+ dialog.updateControls(true);
+ clearMessage();
+ return true;
+ }
+ final String item = (String) getComponentSelection().getSelectedItem();
+ if (item == null || item.equals(AsposeConstants.API_DEPENDENCY_NOT_FOUND)) {
+ if (dialog != null)
+ dialog.updateControls(false);
+ diplayMessage("Please first add maven dependency of " + AsposeConstants.API_NAME + " for java API", true);
+ return false;
+ } else if (!isExampleSelected()) {
+ if (dialog != null)
+ dialog.updateControls(false);
+ diplayMessage(AsposeConstants.ASPOSE_SELECT_EXAMPLE, true);
+ return false;
+ }
+ if (dialog != null)
+ dialog.updateControls(true);
+ clearMessage();
+ return true;
+ }
+
+ //=========================================================================
+
+ private boolean isExampleSelected() {
+ CustomMutableTreeNode comp = (CustomMutableTreeNode) getExamplesTree().getLastSelectedPathComponent();
+ if (comp == null) {
+ return false;
+ }
+ try {
+
+ if (!comp.isFolder()) {
+ return false;
+ }
+ } catch (Exception ex) {
+ return false;
+ }
+ return true;
+ }
+
+ //=========================================================================
+ public void diplayMessage(String message, boolean error) {
+
+ if (error) {
+ jLabelMessage.setForeground(Color.RED);
+ } else {
+ jLabelMessage.setForeground(Color.GREEN);
+ }
+ jLabelMessage.setText(message);
+ }
+
+ //=========================================================================
+ private void clearMessage() {
+ jLabelMessage.setText("");
+
+ }
+
+ //=========================================================================
+ public int showMessage(String title, String message, int buttons, int icon) {
+ int result = JOptionPane.showConfirmDialog(null, message, title, buttons, icon);
+ return result;
+ }
+
+
+ //====================================================================
+ public void populateExamplesTree(AsposeJavaAPI asposeComponent, CustomMutableTreeNode top, ProgressIndicator p)
+
+ {
+ String examplesFullPath = asposeComponent.getLocalRepositoryPath() + File.separator + AsposeConstants.SOURCE_API_EXAMPLES_LOCATION;
+ File directory = new File(examplesFullPath);
+ AsposeConstants.println(examplesFullPath+ "exists?"+directory.exists());
+ getExamplesTree().removeAll();
+ top.setExPath(examplesFullPath);
+ Queue