public View getLoadingSpinnerView() {
    View loadView = null;

    if (support.getRootView() != null)
      loadView = support.getRootView().findViewById(R.id.loading_spinner);

    return loadView;
  }
  private void showLoadingSpinner() {
    if (support.getRootView() != null) {
      final View spinner = getLoadingSpinnerView();
      if (spinner != null) spinner.setVisibility(View.VISIBLE);

      final View contentView = support.getContentView();
      if (contentView != null) contentView.setVisibility(View.GONE);
    }
  }
 public final void support(Trouble trouble) {
   for (Support obj = this; true; obj = obj.next) {
     if (obj.resolve(trouble)) {
       obj.done(trouble);
       break;
     } else if (obj.next == null) {
       obj.fail(trouble);
       break;
     }
   }
 }
  private void inflateErrorWithIcon(ViewGroup container, int errorMsgResId, Object... params) {
    final View view =
        LayoutInflater.from(support.getSherlockActivity())
            .inflate(R.layout.error_with_icon, container, true);
    final TextView text = (TextView) view.findViewById(R.id.title_with_text_text);
    final String msg =
        support.getSherlockActivity().getResources().getString(errorMsgResId, params);
    text.setText(msg);

    MolokoApp.Log.e(MolokoApp.class, msg);
  }
示例#5
0
 public void propertyChange(PropertyChangeEvent event) {
   if ("pageLoaded".equals(event.getPropertyName())) {
     int pagenumber = ((Integer) event.getNewValue()).intValue();
     // System.err.println("pageLoaded "+pagenumber);
     // if (pagenumber == -1)
     //    System.err.println("all pages loaded");
     Support support = supportmap.remove(pagenumber < 0 ? null : Integer.valueOf(pagenumber));
     if (support != null) {
       support.close();
     }
   }
 }
  private void showContent() {
    if (support.getRootView() != null) {
      final View spinner = getLoadingSpinnerView();
      if (spinner != null) spinner.setVisibility(View.GONE);

      final ViewGroup content = support.getContentView();
      if (content != null) {
        support.initContentAfterDataLoaded(content);
        content.setVisibility(View.VISIBLE);
      }
    }
  }
  public final void support(Trouble trouble) { // 트러블 해결의 수순
    Support current = this;

    while (current != null) {
      if (current.resolve(trouble)) {
        current.done(trouble);
        break;
      } else if (current.next == null) {
        current.fail(trouble);
      }
      current = current.next;
    }
  }
  private void showElementNotFoundError() {
    if (support.getRootView() != null) {
      final View spinner = getLoadingSpinnerView();
      if (spinner != null) spinner.setVisibility(View.GONE);

      final ViewGroup content = support.getContentView();
      if (content != null) {
        content.removeAllViews();

        inflateErrorWithIcon(content, R.string.err_entity_not_found, support.getLoaderDataName());
        content.setVisibility(View.VISIBLE);
      }
    }
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (getLoaderData() == null && support.isReadyToStartLoader()) {
      startLoader();
    }
  }
示例#10
0
  public static void main(String[] args) {

    double tal1, tal2;
    double minst = 0;

    Scanner sc = new Scanner(System.in);
    System.out.println("Skriv in ett tal: ");
    tal1 = sc.nextDouble();

    System.out.println("Skriv in ett till tal: ");
    tal2 = sc.nextDouble();

    Support svar = new Support();
    minst = svar.talMetod(tal1, tal2);

    System.out.println("Minsta talet är: " + minst);
  }
  protected Action processActionCreate(
      HttpServletRequest request, HttpServletResponse response, ActionMapping mapping)
      throws IOException {

    Action instance = super.processActionCreate(request, response, mapping);
    if (instance instanceof Support) {
      ((Support) instance).setDaoFactory(daoFactory);
    }
    return (instance);
  }
示例#12
0
 private void invokeOnPageLoad(final int pagenumber, final Runnable r, final boolean dialog) {
   if (!SwingUtilities.isEventDispatchThread()) {
     SwingUtilities.invokeLater(
         new Runnable() {
           public void run() {
             invokeOnPageLoad(pagenumber, r, dialog);
           }
         });
   } else {
     Support support = supportmap.get(pagenumber < 0 ? null : Integer.valueOf(pagenumber));
     if (support == null) {
       r.run();
     } else {
       if (dialog) {
         triggerLoad(pagenumber);
       }
       support.enqueue(r, dialog);
     }
   }
 }
示例#13
0
 @Override
 public int[] getRemoteStyleableArrayFromLocal(int[] localStyleableArray) {
   int localStyleableId = Arrays.hashCode(localStyleableArray);
   int indexOfRemoteArray = mStyleableArrayMapping.indexOfKey(localStyleableId);
   if (indexOfRemoteArray >= 0) return mStyleableArrayMapping.valueAt(indexOfRemoteArray);
   AddOnImpl addOn = mAddOnWeakReference.get();
   if (addOn == null) return new int[0];
   Context askContext = addOn.mAskAppContext;
   Context remoteContext = addOn.getPackageContext();
   if (remoteContext == null) return new int[0];
   int[] remoteAttrIds =
       Support.createBackwardCompatibleStyleable(
           localStyleableArray, askContext, remoteContext, mAttributesMapping);
   mStyleableArrayMapping.put(localStyleableId, remoteAttrIds);
   return remoteAttrIds;
 }
示例#14
0
 public Cursor<S> fetch(FilterValues<S> values, Query.Controller controller)
     throws FetchException {
   return mSupport.fetchOne(mIndex, values.getValuesFor(mKeyFilter), controller);
 }
示例#15
0
 public Cursor<S> fetch(FilterValues<S> values) throws FetchException {
   return mSupport.fetchOne(mIndex, values.getValuesFor(mKeyFilter));
 }