use of org.eclipse.scout.rt.client.ui.desktop.outline.IOutline in project scout.rt by eclipse.
the class AbstractDesktop method closeInternal.
@Override
public void closeInternal() {
setOpenedInternal(false);
detachGui();
List<IForm> showedForms = new ArrayList<IForm>();
// Remove showed forms
for (IForm form : m_formStore.values()) {
hideForm(form);
showedForms.add(form);
}
// extensions
for (IDesktopExtension ext : getDesktopExtensions()) {
try {
ContributionCommand cc = ext.desktopClosingDelegate();
if (cc == ContributionCommand.Stop) {
break;
}
} catch (RuntimeException | PlatformError t) {
LOG.error("extension {}", ext, t);
}
}
// close messageboxes
for (IMessageBox m : getMessageBoxes()) {
if (m != null) {
try {
m.getUIFacade().setResultFromUI(IMessageBox.CANCEL_OPTION);
} catch (RuntimeException | PlatformError e) {
LOG.error("Exception while closing messagebox", e);
}
}
}
// close filechoosers
for (IFileChooser f : getFileChoosers()) {
if (f != null) {
try {
f.getUIFacade().setResultFromUI(Collections.<BinaryResource>emptyList());
} catch (RuntimeException | PlatformError e) {
LOG.error("Exception while closing filechooser", e);
}
}
}
// close client callbacks
for (ClientCallback<?> c : CollectionUtility.arrayList(m_pendingPositionResponses)) {
if (c != null) {
try {
c.cancel(true);
c.failed(new ThreadInterruptedError("desktop is closing"));
} catch (RuntimeException | PlatformError e) {
LOG.error("Exception while closing client callback", e);
}
}
}
// close open forms
for (IForm form : showedForms) {
if (form != null) {
try {
form.doClose();
} catch (RuntimeException | PlatformError e) {
LOG.error("Exception while closing form", e);
}
}
}
// dispose outlines
for (IOutline outline : getAvailableOutlines()) {
try {
outline.disposeTree();
} catch (RuntimeException | PlatformError e) {
LOG.warn("Exception while disposing outline.", e);
}
}
ActionUtility.disposeActions(getActions());
fireDesktopClosed();
}
use of org.eclipse.scout.rt.client.ui.desktop.outline.IOutline in project scout.rt by eclipse.
the class AbstractDesktop method setOutlineInternal.
protected void setOutlineInternal(IOutline newOutline) {
final IOutline oldOutline = m_outline;
if (oldOutline != null) {
if (m_activeOutlineListener != null) {
oldOutline.removePropertyChangeListener(m_activeOutlineListener);
m_activeOutlineListener = null;
}
m_outline.deactivate();
}
// set new outline to set facts
m_outline = newOutline;
// deactivate old page
if (oldOutline != null) {
oldOutline.clearContextPage();
}
final ClientRunContext ctx;
if (m_outline == null) {
ctx = ClientRunContexts.copyCurrent().withOutline(null, true);
} else {
ctx = m_outline.createDisplayParentRunContext();
}
ctx.run(new IRunnable() {
@Override
public void run() throws Exception {
if (m_outline != null) {
m_activeOutlineListener = new P_ActiveOutlineListener();
m_outline.addPropertyChangeListener(m_activeOutlineListener);
setBrowserHistoryEntry(BEANS.get(OutlineDeepLinkHandler.class).createBrowserHistoryEntry(m_outline));
}
// This change is needed for the "on/off semantics" of the tool tab buttons to work correctly.
if (m_outline == null) {
setPageDetailForm(null);
setPageDetailTable(null);
setPageSearchForm(null, true);
}
// </bsh>
updateActiveFormOnOutlineChanged();
fireOutlineChanged(oldOutline, m_outline);
onOutlineChangedInternal();
fireOutlineContentActivate();
}
});
}
use of org.eclipse.scout.rt.client.ui.desktop.outline.IOutline in project scout.rt by eclipse.
the class AbstractDesktop method activateForm.
@Override
public void activateForm(IForm form) {
if (form == null) {
setActiveForm(form);
return;
}
if (!m_formStore.contains(form)) {
// only dialogs or views can be activated.
return;
}
IDisplayParent displayParent = form.getDisplayParent();
if (displayParent instanceof IForm) {
activateForm((IForm) displayParent);
} else if (displayParent instanceof IOutline && !displayParent.equals(getOutline())) {
activateOutline(((IOutline) displayParent));
}
setActiveForm(form);
fireFormActivate(form);
}
use of org.eclipse.scout.rt.client.ui.desktop.outline.IOutline in project scout.rt by eclipse.
the class AbstractDesktop method ensureProposalChoosersClosed.
/**
* Avoid that proposal choosers from content assist fields are still opened in the Java model after the UI has been
* reloaded by pressing Ctrl + R. This is only required for the 'old' smart-field, the new smart-field (2) has no
* model representation of the proposal chooser anymore. That means when the UI is reloaded, the proposal chooser is
* gone. Thus, this method mimics the behavior of the new smart-field. #216067
*
* @deprecated will be removed with 7.1
*/
@Deprecated
protected void ensureProposalChoosersClosed() {
closeProposalChoosers(getActiveForm());
IOutline outline = getOutline();
if (outline != null) {
closeProposalChoosers(outline.getDetailForm());
closeProposalChoosers(outline.getSearchForm());
}
}
use of org.eclipse.scout.rt.client.ui.desktop.outline.IOutline in project scout.rt by eclipse.
the class AbstractDesktopExtension method contributeOutlines.
@Override
public void contributeOutlines(OrderedCollection<IOutline> outlines) {
List<Class<? extends IOutline>> contributedOutlines = getConfiguredOutlines();
if (contributedOutlines == null) {
return;
}
for (Class<? extends IOutline> element : contributedOutlines) {
try {
IOutline o = element.newInstance();
outlines.addOrdered(o);
} catch (Exception t) {
BEANS.get(ExceptionHandler.class).handle(new ProcessingException("error creating instance of class '" + element.getName() + "'.", t));
}
}
}
Aggregations