/** * Setup a default task for this screen. * @param application The application for the new task. */ public void setupDefaultTask(Application application) { this.getScreenFieldView().setupDefaultTask(application); } public boolean showHelpScreen(String strURL, int iOptions)
public boolean showHelpScreen(String strURL, int iOptions) { return this.getScreenFieldView().showDocument(strURL, iOptions); } /**
public boolean showHelpScreen(String strURL, int iOptions) { return this.getScreenFieldView().showDocument(strURL, iOptions); } /**
/** * Setup a default task for this screen. * @param application The application for the new task. */ public void setupDefaultTask(App application) { this.getScreenFieldView().setupDefaultTask(application); } public boolean showHelpScreen(String strURL, int iOptions)
/** * Get the environment to use for this record owner. * @return Record owner's environment, or null to use the default enviroment. */ public Task getTask() { Task task = super.getTask(); if (task != null) return task; if (this.getScreenFieldView() != null) if (this.getScreenFieldView().getControl() != null) return (Task)this.getScreenFieldView().getControl(); // The JAppletScreen is the root task for this screen. return null; //?return m_Applet; // Never } /**
/** * Get the environment to use for this record owner. * @return Record owner's environment, or null to use the default enviroment. */ public Task getTask() { Task task = super.getTask(); if (task != null) return task; if (this.getScreenFieldView() != null) if (this.getScreenFieldView().getControl() != null) return (Task)this.getScreenFieldView().getControl(); // The JAppletScreen is the root task for this screen. return null; //?return m_Applet; // Never } /**
url = new URL(path); } catch (MalformedURLException ex) { BaseApplet applet = (BaseApplet)this.getAppletScreen().getScreenFieldView().getControl(); BaseApplication app = (BaseApplication)this.getRootScreen().getTask().getApplication(); if ((url == null) && (path != null))
/** * Push this command onto the history stack. * @param strHistory The history command to push onto the stack. */ public void pushHistory(String strHistory, boolean bPushToBrowser) { if (m_vHistory == null) m_vHistory = new Vector<String>(); m_vHistory.addElement(strHistory); String strHelp = Utility.fixDisplayURL(strHistory, true, true, true, this); if (this.getAppletScreen() != null) if (this.getAppletScreen().getScreenFieldView() != null) this.getAppletScreen().getScreenFieldView().showDocument(strHelp, MenuConstants.HELP_WINDOW_CHANGE); if (bPushToBrowser) if (this.getAppletScreen() != null) if (this.getAppletScreen().getTask() instanceof BaseAppletReference) ((BaseAppletReference)this.getAppletScreen().getTask()).pushBrowserHistory(strHistory, this.getTitle(), bPushToBrowser); // Let browser know about the new screen } /**
if (this.getScreenFieldView() != null) return this.getScreenFieldView().doCommand(strCommand); // Instead I do this return bFlag;
if (this.getScreenFieldView() != null) return this.getScreenFieldView().doCommand(strCommand); // Instead I do this return bFlag;
/** * Push this command onto the history stack. * @param strHistory The history command to push onto the stack. */ public void pushHistory(String strHistory, boolean bPushToBrowser) { if (m_vHistory == null) m_vHistory = new Vector<String>(); m_vHistory.addElement(strHistory); String strHelp = Utility.fixDisplayURL(strHistory, true, true, true, this); if (this.getAppletScreen() != null) if (this.getAppletScreen().getScreenFieldView() != null) this.getAppletScreen().getScreenFieldView().showDocument(strHelp, MenuConstants.HELP_WINDOW_CHANGE); if (bPushToBrowser) if (this.getAppletScreen() != null) if (this.getAppletScreen().getTask() instanceof BaseApplet) if (((BaseApplet)this.getAppletScreen().getTask()).getBrowserManager() != null) // Let browser know about the new screen ((BaseApplet)this.getAppletScreen().getTask()).getBrowserManager().pushBrowserHistory(strHistory, this.getTitle()); // Let browser know about the new screen } /**
/** * Get the command string that will restore this screen. * @return The URL for the current screen. */ public String getScreenURL() { String strURL = super.getScreenURL(); if (m_strMenu != null) strURL = this.addURLParam(strURL, DBParams.MENU, m_strMenu); else if ((this.getAppletScreen() != null) && (this.getAppletScreen().getScreenFieldView().getControl() != null)) { String strMenu = this.getProperty(DBParams.MENU); if (strMenu == null) strMenu = Constants.BLANK; strURL = this.addURLParam(strURL, DBParams.MENU, strMenu); } return strURL; } /**
/** * Get the command string that will restore this screen. * @return The URL for the current screen. */ public String getScreenURL() { String strURL = super.getScreenURL(); if (m_strMenu != null) strURL = this.addURLParam(strURL, DBParams.MENU, m_strMenu); else if ((this.getAppletScreen() != null) && (this.getAppletScreen().getScreenFieldView().getControl() != null)) { String strMenu = this.getProperty(DBParams.MENU); if (strMenu == null) strMenu = Constants.BLANK; strURL = this.addURLParam(strURL, DBParams.MENU, strMenu); } return strURL; } /**
/** * Process the "Help" toolbar command. * @param bUseSameWindow Use the same window? * @retrun true if successful. */ public boolean onHelp(int iOptions) { String strPrevAction = this.getScreenURL(); if ((strPrevAction == null) || (strPrevAction.length() == 0)) return false; // Can't handle help if I'm not the target screen. // Note: The following is a hack to make the demo screen stop displaying after the first help is pressed if (this.getProperty("displayInitialHelp") != null) if ((this.getProperty("helplanguage") != null) && (this.getProperty("helplanguage").length() > 0)) if (this.getTask() != null) if (this.getTask().getApplication() != null) this.getTask().getApplication().setProperty("helplanguage", this.getTask().getApplication().getLanguage(true)); strPrevAction = Utility.fixDisplayURL(strPrevAction, true, true, true, this); BaseApplet applet = null; if (this.getAppletScreen() != null) if (this.getAppletScreen().getScreenFieldView() != null) applet = (BaseApplet)this.getAppletScreen().getScreenFieldView().getControl(); if (applet != null) iOptions = applet.getHelpPageOptions(iOptions); if ((MenuConstants.HELP_WEB_OPTION & iOptions) == MenuConstants.HELP_WEB_OPTION) return this.getScreenFieldView().showDocument(strPrevAction, iOptions & 1); // Not standalone else return this.getAppletScreen().showHelpScreen(strPrevAction, iOptions); } /**
/** * Process the "Help" toolbar command. * @param bUseSameWindow Use the same window? * @retrun true if successful. */ public boolean onHelp(int iOptions) { String strPrevAction = this.getScreenURL(); if ((strPrevAction == null) || (strPrevAction.length() == 0)) return false; // Can't handle help if I'm not the target screen. // Note: The following is a hack to make the demo screen stop displaying after the first help is pressed if (this.getProperty("displayInitialHelp") != null) if ((this.getProperty("helplanguage") != null) && (this.getProperty("helplanguage").length() > 0)) if (this.getTask() != null) if (this.getTask().getApplication() != null) this.getTask().getApplication().setProperty("helplanguage", this.getTask().getApplication().getLanguage(true)); strPrevAction = Utility.fixDisplayURL(strPrevAction, true, true, true, this); BaseAppletReference applet = null; if (this.getAppletScreen() != null) if (this.getAppletScreen().getScreenFieldView() != null) applet = (BaseAppletReference)this.getAppletScreen().getScreenFieldView().getControl(); if (applet != null) iOptions = applet.getHelpPageOptions(iOptions); if ((MenuConstants.HELP_WEB_OPTION & iOptions) == MenuConstants.HELP_WEB_OPTION) return this.getScreenFieldView().showDocument(strPrevAction, iOptions & 1); // Not standalone else return this.getAppletScreen().showHelpScreen(strPrevAction, iOptions); } /**
public Object doGetData() { Object data = super.doGetData(); if ((data == null) || (DBConstants.BLANK.equals(data))) { if (NONE_BUTTON == null) { String NONE = "None"; if (getRecord().getRecordOwner() instanceof BaseScreen) if (((BaseScreen)getRecord().getRecordOwner()).getParentScreen() != null) if (((BaseScreen)getRecord().getRecordOwner()).getParentScreen().getAppletScreen() != null) NONE_BUTTON = ((BaseApplet)((BaseScreen)getRecord().getRecordOwner()).getParentScreen().getAppletScreen().getScreenFieldView().getControl()).loadImageIcon(NONE, null); } return NONE_BUTTON; } return data; } };
public Object doGetData() { Object data = super.doGetData(); if ((data == null) || (DBConstants.BLANK.equals(data))) { if (NONE_BUTTON == null) { String NONE = "None"; if (getRecord().getRecordOwner() instanceof BaseScreen) if (((BaseScreen)getRecord().getRecordOwner()).getParentScreen() != null) if (((BaseScreen)getRecord().getRecordOwner()).getParentScreen().getAppletScreen() != null) NONE_BUTTON = ((BaseApplet)((BaseScreen)getRecord().getRecordOwner()).getParentScreen().getAppletScreen().getScreenFieldView().getControl()).loadImageIcon(NONE, null); } return NONE_BUTTON; } return data; } };
/** * SetupSFields Method. */ public void setupSFields() { // This is not used as get item is implemented, but this is needed for propert toolbar alignment this.getMainRecord().getField(BookingDetail.DETAIL_DATE).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getMainRecord().getField(BookingDetail.DETAIL_END_DATE).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getMainRecord().getField(BookingDetail.PRODUCT_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getMainRecord().getField(BookingDetail.PRODUCT_STATUS_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); if (this.getScreenFieldView().getControl() instanceof CalendarPanel) { // Always CalendarPanel calpanel = (CalendarPanel)this.getScreenFieldView().getControl(); BaseApplet applet = (BaseApplet)this.getAppletScreen().getScreenFieldView().getControl(); calpanel.setPopupComponent(new JPopupPanel(applet, (VScreenField)this.getScreenFieldView())); } } /**