Showing posts with label plugins. Show all posts
Showing posts with label plugins. Show all posts

Tuesday, May 12, 2009

Grid Plugins

Additions to the grids like the Row Numberer, checkboxes, Row Expander are added as plugins to the Grid.

Adding Row Expander:

  1: XTemplate tpl = XTemplate.create("<p><b>Company:</b> {name}</p><br><p><b>Summary:</b> {desc}</p>");
  2: RowExpander expander = new RowExpander();
  3: expander.setTemplate(tpl);  

and then we need to add the plugin to the grid. We cannot apply a rowExpander to a Summary Grid.

grid.addPlugin(expander);

The XTemplate contains the information that has to be displayed when the “+” is clicked.

Adding Row Numberer:

  1: RowNumberer r = new RowNumberer();
  2: List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
  3: configs.add(r);  

and then add the plugin to the grid.

grid.addPlugin(r);
Adding Checkboxes:
  1: CheckBoxSelectionModel sm = new CheckBoxSelectionModel();
  2: configs.add(sm.getColumn());

Add the plugin to the grid

grid.addPlugin(sm);
Adding the grid plugin will provide automatic reorganization when the grid store values have changed.

Saturday, December 1, 2007

creating an eclipse plugin

hey, today lets talk about creating a basic eclipse plug in 1) start an eclipse application, go to file -> new.. -> Other.. -> Plugin Development -> Plug in Project 2) Select a name for the plug in project click next and fill in the details for the plug in 3) click next and choose from the different types of templates and click finish. Well now we have the plug in displayed in the package explorer 4) right click on the plugin.xml file and select pde tools -> ant build file. We now have an ant script generated by name build.xml 5) So far we created the sample "Hello World" plug in 6) To run the application open the run dialog and create a new configuration of "Eclipse application" 7) we can now see that a new eclipse application is opened and an additional menu bar is added or a tool bar button is generated based on the template that we choose during the plugin project creation 8) Clicking on that application will have the plug in started This is just a basic plug in application where additional functionalities can be added to the application to make more complex plug ins