Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Implement Help View (displaying the help text).
2. Add org.apache.commons.io dependency to product files 3. Replace cassandra's FileUtils class on apache classes.
- Loading branch information
1 parent
049f221
commit 6132596
Showing
12 changed files
with
137 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
org.semanticsoft.vaaclipsedemo.cassandra.app/data/Help.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,40 @@ | |||
<p><strong>Cassandra</strong> is the IDE-like demo environment allowing you to browse and learn its own code and demonstrating some <em>Vaaclipse</em> features. You can obtain <strong>Cassandra</strong> sources from <a href="https://github.com/semanticsoft/vaaclipse">Vaaclipse repository</a>.</p> | |||
|
|||
<h3>Bundles</h3> | |||
|
|||
<ul> | |||
<li> | |||
<em>org.semanticsoft.vaaclipsedemo.cassandra.app</em> - application bundle providing product, demo implementation, resources and compiled widgetset.</li> | |||
<li> | |||
<em>org.semanticsoft.vaaclipsedemo.cassandra.vaadinaddons</em> - provides the vaadin addon binaires used in this demo.</li> | |||
</ul><h3>Product configuration</h3> | |||
|
|||
<p>Open file <em>plugin.xml</em>. The extension point <em>org.eclipse.core.runtime.products</em> contains the product configuration. Read about product configuration in <a href="https://github.com/semanticsoft/vaaclipse/wiki/Project-configuration">Project configuration guid</a>.</p> | |||
|
|||
<ul> | |||
<li> | |||
<em>applicationXMI</em> - this file contains the application model. You can browse it using reach UI in <em>Eclipse Model Editor</em>.</li> | |||
<li> | |||
<em>applicationWidgetset</em> - the location of application widgetset. As you can see this application uses widgetset is located in <em>widgetset/cassandra.widgetset.CassandraWidgetset</em>.</li> | |||
<li> | |||
<em>cssTheme</em> - the identifier of theme used by application. <strong>Cassandra</strong> uses the <em>reindeer</em> theme.</li> | |||
<li> | |||
<em>applicationHeaderIcon</em> - you can see this icon in the browser window title.</li> | |||
</ul><h3>Theme configuration</h3> | |||
|
|||
<p>Open file <em>plugin.xml</em>. The extension point <em>org.semanticsoft.vaaclipse.theme</em> contains the theme configuration. This extension point introduces the theme contribution <em>org.semanticsoft.vaaclipsedemo.cassandra.app.maincontrib</em> that extends the <em>reindeer</em> theme with stylesheet <em>"css/default.css"</em> and resources in <em>"img/"</em>. The another contribution <em>org.semanticsoft.vaaclipse.resources</em> contains stylesheet used by Vaaclipse. Read about themes and theme contributions in <a href="https://github.com/semanticsoft/vaaclipse/wiki/Resource-system">Resource system guide</a>. Shortly, theme contribution extends the given themes with resources and styles. Theme contributions help us to build modular applications. Contributions are counterparts to theme inheritance (that has more limited use). For example, we can create the new theme with our resources and styles and inherit it from <em>reindeer</em> theme or use the <em>reindeer</em> theme itself extending with our resources and styles. The second way is more preferable (see <em>Contribution vs inheritance</em> section of <a href="https://github.com/semanticsoft/vaaclipse/wiki/Resource-system">Resource system guide</a>).</p> | |||
|
|||
<h3>Java code</h3> | |||
|
|||
<p>Package <em>org.semanticsoft.vaaclipsedemo.cassandra.app</em></p> | |||
|
|||
<ul> | |||
<li> | |||
<em>.views</em> contains the contribution classes for parts. For example, <em>PackageExplorer</em> class contains the contribution for part with elementId = <em>org.semanticsoft.vaaclipsedemo.cassandra.app.part.packageexplorer</em>.</li> | |||
<li> | |||
<em>.editors</em> contains the contribution classes for editors. The editors in this demo don't allow editing source code, but you can familiarize with editors infrastructure on this sample.</li> | |||
<li> | |||
<em>.toolitems</em> contains the contributions for <em>Tool Items</em>.</li> | |||
<li> | |||
<em>.handlers</em> contains the contributions classes for handlers. For example, <em>CollapseAll</em> class contains the contribution for Direct Tool Item with elementId = <em>org.semanticsoft.vaaclipsedemo.cassandra.app.directtoolitem.collapseall</em>.</li> | |||
</ul> |
36 changes: 0 additions & 36 deletions
36
...emo.cassandra.app/src/org/semanticsoft/vaaclipsedemo/cassandra/app/editors/FileUtils.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
...clipsedemo.cassandra.app/src/org/semanticsoft/vaaclipsedemo/cassandra/app/views/Help.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,68 @@ | |||
/** | |||
* | |||
*/ | |||
package org.semanticsoft.vaaclipsedemo.cassandra.app.views; | |||
|
|||
import java.io.FileInputStream; | |||
import org.apache.commons.io.IOUtils; | |||
|
|||
import java.util.Scanner; | |||
|
|||
import java.io.IOException; | |||
|
|||
import java.io.InputStream; | |||
|
|||
import java.net.URL; | |||
|
|||
import java.net.URI; | |||
|
|||
import javax.annotation.PostConstruct; | |||
|
|||
import com.vaadin.ui.Label; | |||
import com.vaadin.ui.Panel; | |||
import com.vaadin.ui.VerticalLayout; | |||
import javax.inject.Inject; | |||
import org.eclipse.e4.core.contexts.IEclipseContext; | |||
|
|||
/** | |||
* @author rushan | |||
* | |||
*/ | |||
public class Help | |||
{ | |||
private Panel panel; | |||
private Label content; | |||
|
|||
@Inject | |||
public void Help(VerticalLayout parent, IEclipseContext context) | |||
{ | |||
panel = new Panel(); | |||
panel.setSizeFull(); | |||
panel.setScrollable(true); | |||
parent.addComponent(panel); | |||
} | |||
|
|||
@PostConstruct | |||
public void loadHelpText() | |||
{ | |||
String helpPath = "platform:/plugin/org.semanticsoft.vaaclipsedemo.cassandra.app/data/Help.html"; | |||
try { | |||
URL cssUrl = new URL(helpPath); | |||
InputStream is = cssUrl.openStream(); | |||
|
|||
try { | |||
String contentString = IOUtils.toString(is); | |||
content = new Label(contentString, Label.CONTENT_XHTML); | |||
} finally { | |||
IOUtils.closeQuietly(is); | |||
} | |||
} | |||
catch (IOException ex) | |||
{ | |||
ex.printStackTrace(); | |||
content = new Label("Can not open file " + helpPath); | |||
} | |||
|
|||
panel.addComponent(content); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters