Code Search for Developers
 
 
  

ThinkcapAction.java from ThinkCap Collaborative Knowledge Portal at Krugle


Show ThinkcapAction.java syntax highlighted

package org.integratedmodelling.thinkcap;


import org.integratedmodelling.thinkcap.exceptions.ThinkcapException;
import org.integratedmodelling.thinklab.KnowledgeManager;
import org.integratedmodelling.thinklab.command.Command;
import org.integratedmodelling.thinklab.exception.ThinklabException;
import org.integratedmodelling.thinklab.interfaces.IAction;
import org.integratedmodelling.thinklab.value.Value;

public abstract class ThinkcapAction implements IAction {

	public abstract void execute(ThinkcapCommand command, ThinkcapAnswer value) throws ThinklabException;
	
	final public Value execute(Command cmd, KnowledgeManager km)
			throws ThinklabException {
		
		// shouldn't happen, unless user implements some strange command loop. Anyway...
		if (cmd.getClass() != ThinkcapCommand.class)
			throw new ThinkcapException("internal: Thinkcap cannot handle non-thinkcap command " + cmd);

		ThinkcapCommand tc = (ThinkcapCommand)cmd;
		
		// set everything needed into the answer value 
		ThinkcapAnswer ret = new ThinkcapAnswer(tc.context);
		
		// call virtual; redirect exception to Thinkcap reporting 
		execute((ThinkcapCommand)tc, ret);
		
		return ret;
	}

}




See more files for this project here

ThinkCap Collaborative Knowledge Portal

A portal to explore and edit the knowledge contained in a set of ontologies in intuitive ways. Presents a Dictionary view (a Google-like interface), a Thesaurus view (a graphical display with simplified relationships) and a full graphical Concept view.

Project homepage: http://sourceforge.net/projects/thinkcap
Programming language(s): Java,JavaScript,XML
License: other

  basecommands/
    StreamResource.java
    StreamTemplate.java
    ThinkcapMain.java
  exceptions/
    ThinkcapException.java
    ThinkcapWidgetException.java
  portfolio/
    ThinkcapPortfolio.java
  widget/
    HtmlLink.java
    IItemDecorator.java
    IThinkcapWidget.java
    IWidgetPublisher.java
    ImageDecorator.java
    PopupMenu.java
    ThinkcapInputWidget.java
    ThinkcapWidgetManager.java
  PageSpecs.java
  ResultContainer.java
  TemplateProcessor.java
  ThinkCap.java
  ThinkcapAction.java
  ThinkcapAnswer.java
  ThinkcapCommand.java
  ThinkcapManager.java
  ThinkcapPlugin.java
  ThinkcapSession.java
  ThinkcapSessionListener.java