use of com.ericsson.otp.erlang.OtpErlangString in project erlide_eclipse by erlang.
the class GlobalParameters method hasQuickCheck.
/**
* Checks if QuickCheck is installed in the current machine.
*
* @return true if QC is installed, else false
*/
public static boolean hasQuickCheck() {
if (GlobalParameters.isQCchecked) {
return GlobalParameters.hasQuickCheck;
}
final RpcResult res = Activator.getDefault().getBackend().call_noexception("code", "which", "a", "eqc");
if (!res.isOk()) {
return false;
}
if (res.getValue() instanceof OtpErlangString) {
GlobalParameters.hasQuickCheck = true;
GlobalParameters.isQCchecked = true;
} else {
GlobalParameters.isQCchecked = true;
GlobalParameters.hasQuickCheck = false;
}
return GlobalParameters.hasQuickCheck;
}
use of com.ericsson.otp.erlang.OtpErlangString in project erlide_eclipse by erlang.
the class RenameFunctionRefactoring method getDefaultValue.
@Override
public String getDefaultValue() {
final IErlMemberSelection sel = (IErlMemberSelection) GlobalParameters.getWranglerSelection();
if (sel == null) {
return "";
}
final RpcResult res = WranglerBackendManager.getRefactoringBackend().callWithoutParser("get_fun_name_eclipse", "siixi", sel.getFilePath(), sel.getSelectionRange().getStartLine(), sel.getSelectionRange().getStartCol(), sel.getSearchPath(), GlobalParameters.getTabWidth());
if (res.getValue().getClass().equals(OtpErlangString.class)) {
return ((OtpErlangString) res.getValue()).stringValue();
}
return "";
}
use of com.ericsson.otp.erlang.OtpErlangString in project erlide_eclipse by erlang.
the class UserRefactoring method prepareUserInput.
protected OtpErlangList prepareUserInput() {
final OtpErlangObject[] params = new OtpErlangObject[parValues.size()];
int i = 0;
for (final String val : parValues) {
params[i] = new OtpErlangString(val);
i++;
}
return new OtpErlangList(params);
}
use of com.ericsson.otp.erlang.OtpErlangString in project erlide_eclipse by erlang.
the class AbstractErlSelection method getSearchPath.
@Override
public OtpErlangList getSearchPath() {
final IProject project = file.getProject();
final IErlModel model = ErlangEngine.getInstance().getModel();
final IErlProject actualProject = model.getErlangProject(project);
final IPath projectLocation = actualProject.getWorkspaceProject().getLocation();
final Collection<IPath> sourcDirs = actualProject.getProperties().getSourceDirs();
final OtpErlangString[] searchPath = new OtpErlangString[sourcDirs.size()];
int i = 0;
for (final IPath src : sourcDirs) {
searchPath[i++] = new OtpErlangString(projectLocation.append(src).toOSString());
}
return new OtpErlangList(searchPath);
}
use of com.ericsson.otp.erlang.OtpErlangString in project erlide_eclipse by erlang.
the class TraceBackend method loadDataFromFile.
/**
* Loads traces from active result set (
* {@link #setActiveResultSet(TracingResultsNode)}). Index of last trace
* which will be loaded is <code>max(number_of_traces, endIndex)</code>.
*
* @param theStartIndex
* number of first trace
* @param endIndex
* number of last trace
*/
public void loadDataFromFile(final long theStartIndex, final long endIndex) {
if (!tracing && !loading) {
synchronized (this) {
if (!tracing && !loading) {
try {
loading = true;
loadingFileInfo = false;
startIndex = theStartIndex;
handler = new TraceEventHandler();
getBackend(true);
TraceCollections.getTracesList().clear();
tracerBackend.getRuntime().registerEventListener(handler);
final OtpErlangLong start = new OtpErlangLong(theStartIndex);
final OtpErlangLong stop = new OtpErlangLong(endIndex);
tracerBackend.getOtpRpc().call(Constants.ERLANG_HELPER_MODULE, TraceBackend.FUN_LOAD, "sii", new OtpErlangString(activeResultSet.getFileName()), start, stop);
} catch (final RpcException e) {
ErlLogger.error(e);
errorObject = e;
finishLoading(TracingStatus.EXCEPTION_THROWN);
}
}
}
}
}
Aggregations