|
Monday, October 27, 2014
SocketTest
Monday, August 25, 2014
How to continue code review effectively
Code Review Data Structure:
https://blog.jetbrains.com/upsource/2015/08/20/what-to-look-for-in-a-code-review-data-structures/interesting blog post to read:
http://www.infoq.com/news/2008/03/code-review-antipatterns
http://server.dzone.com/articles/dont-waste-time-code-reviews
Code review tools for Eclipse:
FindBugs plug-in:web: http://findbugs.cs.umd.edu/eclipse/
update site: http://findbugs.cs.umd.edu/eclipse
PMD:
web: http://pmd.sourceforge.net/
update site: http://sourceforge.net/projects/pmd/files/pmd-eclipse/update-site/
Gerrit:
Gerrit is a web based code review system, facilitating online code reviews for projects using the Git version control system.
http://scn.sap.com/docs/DOC-42271
http://www.infoq.com/articles/Gerrit-jenkins-hudson
More Details :
https://blog.jetbrains.com/upsource/category/practices/How to find a view in Eclipse RCP
The following technique can be used to get the currently active page and any view within that page.
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); IViewPart view = page.findView(MyView.ID);
The MyView.ID specified the ID of the view as declared in the plugin.xml file.
Open a perspective in a new window
Using the following code we can use a perspective in a separate window:
String myPerspectiveid = "dk.bording.viking.rcp.ui.till.editor.TillDesignerPerspective";
PlatformUI.getWorkbench().getActiveWorkbenchWindow().openPage(myPerspectiveid , null);
Sunday, August 24, 2014
Eclipse RCP: How to Hide or Remove a Contribution Item from a toolbar or Menubar
Using the following code we can hide or remove a Contribution item from a toolbar or menubar
private void hidePinbuttonFromPropertySheet() { IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IViewPart view = page.findView(IPageLayout.ID_PROP_SHEET); String id = "";
if(view!=null)
{
for ( IContributionItem item : view.getViewSite().getActionBars().getToolBarManager().getItems()) {
if (item.getId().indexOf("PinPropertySheetAction")!=-1) { id = item.getId();
break;
}
}
view.getViewSite().getActionBars().getToolBarManager().remove(id);
view.getViewSite().getActionBars().getToolBarManager().update(false); } }
private void hidePinbuttonFromPropertySheet() { IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IViewPart view = page.findView(IPageLayout.ID_PROP_SHEET); String id = "";
if(view!=null)
{
for ( IContributionItem item : view.getViewSite().getActionBars().getToolBarManager().getItems()) {
if (item.getId().indexOf("PinPropertySheetAction")!=-1) { id = item.getId();
break;
}
}
view.getViewSite().getActionBars().getToolBarManager().remove(id);
view.getViewSite().getActionBars().getToolBarManager().update(false); } }
Thursday, May 2, 2013
Copy Resources from Eclipse Plug-in to Local File System
If we need to read a resource from an eclipse plugin and want to save it to local file system we can use following code :
Following code will copy basicTemplate.diagram to local-file system:
private void copyTemplateToLocalDirectory() {
URI diagramTemplateFileUri = URI.createPlatformPluginURI(
"/dk.bording.viking.rcp.ui.till.editor/templates/basicTemplate.diagram", true);
URIConverter uriConverter = new ExtensibleURIConverterImpl();
try {
InputStream infile = uriConverter.createInputStream(diagramTemplateFileUri);
FileOutputStream file = new FileOutputStream( new File(Platform.getInstanceLocation().getURL().getPath()+File.separator+NewFileName.diagram"));
file.write(ByteStreams.toByteArray(infile));
file.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
Following code will copy basicTemplate.diagram to local-file system:
private void copyTemplateToLocalDirectory() {
URI diagramTemplateFileUri = URI.createPlatformPluginURI(
"/dk.bording.viking.rcp.ui.till.editor/templates/basicTemplate.diagram", true);
URIConverter uriConverter = new ExtensibleURIConverterImpl();
try {
InputStream infile = uriConverter.createInputStream(diagramTemplateFileUri);
FileOutputStream file = new FileOutputStream( new File(Platform.getInstanceLocation().getURL().getPath()+File.separator+NewFileName.diagram"));
file.write(ByteStreams.toByteArray(infile));
file.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
PopertyTesters : Requesting Evaluation of Expressions
The command framework is quite lazy. It doesn't really care about your expressions and your wishes about when handlers should be enabled or not. It’s your duty to refresh the enabled state of your handlers by telling the
using the following code we can Request Evalueation of our Expressoin:
IEvaluationService
. It’s not wise to refresh the commands regularly as it can be quite expensive. Instead triggering the refresh on events is the way to go.using the following code we can Request Evalueation of our Expressoin:
protected void requestRefresh() { IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); IEvaluationService evaluationService = (IEvaluationService) window.getService(IEvaluationService.class); if (evaluationService != null) { evaluationService.requestEvaluation(PROPERTY_NAMESPACE + "." + PROPERTY_CAN_FOO); evaluationService.requestEvaluation(PROPERTY_NAMESPACE + "." + PROPERTY_CAN_BAR); } }
More information can be found:
http://www.robertwloch.net/2011/01/eclipse-tips-tricks-property-testers-with-command-core-expressions/
Subscribe to:
Posts (Atom)
5 Strategies for Getting More Work Done in Less Time
Summary. You’ve got more to do than could possibly get done with your current work style. You’ve prioritized. You’ve planned. You’ve dele...

-
Sometimes just to get a quick success build you might need to disable/ignore/skip some of the munit test cases. you can do you by double ...
-
Some times you might need to return static response from nginx. for example validating file upload limit error_page 413 @413_x...
-
Install ActiveMQ Step 1: Download Apache Active MQ 5.x.x (5.15.8 Latest Version Up to Feb 2019) Step 2: Install ActiveMQ Run the Active...