× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Frank Knubben wrote:
In RDi 7.5 this class seems to have been replaced with the

QSYSEditableRemoteSourceFileMember

class so that is what I am using, with the same method, passing in the
read-only is true value.

But I am getting some strange results...most of the time the editor is
opened in browse mode as expected, but sometimes as soon as the source is
visible in the editor it is already marked as dirty and the asterisk is
visible to the left of the source file member name. And very occasionally
the asterisk is not visible at all, but when I close the editor the "Save
Resource" dialog pops up, indicating that the member has been change.

I've encountered this exact situation! And I resolved it.

How are you getting your editable remote object?

Here's (roughly) what I'm doing ...

IBMiConnection connection = getConnection();

IQSYSMember mbr = connection.getMember(sourceLibrary, sourceFile,
sourceMember, new NullProgressMonitor());

IAdaptable item = (IAdaptable)mbr;

ISystemRemoteElementAdapter adapter =
(ISystemRemoteElementAdapter) item .getAdapter(ISystemRemoteElementAdapter.class);

ISystemEditableRemoteObject remoteObject = adapter.getEditableRemoteObject(item);

QSYSEditableRemoteSourceFileMember editableMember =
(QSYSEditableRemoteSourceFileMember)remoteObject;


(appologies if this code doesn't work, it's being copied & pasted from a bunch of different routines).

IIRC, I found that trying to open the member for edit when it was already open for browse could cause problems. To that end, the following routines came in handy so I would just activate an existing editor (edit or browse) if it was already open.


protected final boolean isOpenInEditor(ISystemEditableRemoteObject editable)
throws CoreException {
int openStatus = editable.checkOpenInEditor();

boolean open = (openStatus != ISystemEditableRemoteObject.NOT_OPEN);

return open;
}

/**
* Activates the editor for a specific remote editable object.
*
* @param editable remote editable object to activate
*/
protected final void activateEditor(ISystemEditableRemoteObject editable) {
IEditorPart editor = editable.getEditorPart();
IWorkbenchPartSite site = editor.getSite();
IWorkbenchPage page = site.getPage();
page.activate(editor);
}

david


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.