com.google.gwt.user.client.ui.AcceptsOneWidget Java Examples

The following examples show how to use com.google.gwt.user.client.ui.AcceptsOneWidget. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Importing.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    ImportPresenter importPresenter = presenterFactory.getImportPresenter();
    importPresenter.bind();
    switch (importPlace.getType()) {
        case CONTENT:
            importPresenter.importFolder();
            break;
        case EDIT_ITEMS:
            importPresenter.updateImportedObjects(importPlace.getBatchId());
            break;
        case EDIT_PARENT:
            importPresenter.selectParent(importPlace.getBatchId());
            break;
        default: // HISTORY
            importPresenter.selectBatchFromHistory();
            break;
    }
    panel.setWidget(importPresenter.getUI());
}
 
Example #2
Source File: InjectPresenterCreator.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void initComposer(ClassSourceFileComposerFactory composerFactory) {
	composerFactory.addImport(Place.class.getName());
	composerFactory.addImport(Presenter.class.getName());
	for (JMethod presenterMethod : this.presenterMethods) {
		if (presenterMethod.getParameters().length > 0) {
			JType placeType = presenterMethod.getParameters()[0].getType();
			composerFactory.addImport(placeType.getQualifiedSourceName());
			if (placeType instanceof JParameterizedType) {
				JParameterizedType parameterizedType = (JParameterizedType) placeType;
				for (JType paramType : parameterizedType.getTypeArgs()) {
					composerFactory.addImport(paramType.getQualifiedSourceName());
				}
			}
		}
	}

	composerFactory.addImplementedInterface(Presenter.class.getSimpleName());
	composerFactory.addImport(AcceptsOneWidget.class.getName());
}
 
Example #3
Source File: InjectMvpDescriptionCreator.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void writeEntryPoint(SourceWriter srcWriter) {
	srcWriter.println("MvpController mvpController = MvpController.get();");
	srcWriter.println("AcceptsOneWidget mvpDisplay = null;");
	if (this.display != null && !AcceptsOneWidget.class.equals(this.display)) {
		srcWriter.println("mvpDisplay = GWT.create(%s.class);", InjectCreatorUtil.toClassName(this.display));
	}
	srcWriter.println("if(mvpDisplay != null){");
	srcWriter.indent();
	srcWriter.println("mvpController.setDisplay(mvpDisplay);");
	srcWriter.outdent();
	srcWriter.println("}");
	srcWriter.println("if(mvpDisplay instanceof IsWidget){");
	srcWriter.indent();
	srcWriter.println("RootPanel.get().add((IsWidget) mvpDisplay);");
	srcWriter.outdent();
	srcWriter.println("}");

	if (this.defaultPlace != null && !Place.class.equals(this.defaultPlace)) {
		srcWriter.println("mvpController.setDefaultPlace(new %s());", InjectCreatorUtil.toClassName(this.defaultPlace));
	}
	for (Class<?> activity : this.activities) {
		srcWriter.println("mvpController.registerActivity(GWT.<ActivityFactory> create(%s.class));",
			InjectCreatorUtil.toClassName(activity));
	}
}
 
Example #4
Source File: TransactionActivity.java    From bitcoin-transaction-explorer with MIT License 6 votes vote down vote up
@Override
protected void doDeferredStart(final AcceptsOneWidget panel, final TransactionInformation transactionInformation) {
  panel.setWidget(view);
  
  final Transaction transactionFromHex = ParseUtil.getTransactionFromHex(transactionInformation.getRawHex());

  view.setTransaction(transactionFromHex, transactionHasError);

  // If an error occurred while parsing, don't bother getting the tx info
  if (transactionHasError) {
    return;
  }

  if (transactionInformation.getState() != null) {
    view.setTransactionInformation(transactionInformation);
  } else {
    service.getTransactionInformation(Str.toString(Hex.encode(transactionFromHex.getTransactionId())), new AppAsyncCallback<TransactionInformation>() {
      @Override
      public void onSuccess(final TransactionInformation result) {
        view.setTransactionInformation(result);
      }
    });
  }
}
 
Example #5
Source File: LookupActivity.java    From bitcoin-transaction-explorer with MIT License 6 votes vote down vote up
@Override
public void start(final AcceptsOneWidget panel, final EventBus eventBus) {
  if(!mustPerformLookup(place)) {
    doDeferredStart(panel, createInfo(place));
  } else {
    doLookup(place, new AsyncCallback<E>() {
      @Override
      public void onSuccess(final E result) {
        doDeferredStart(panel, result);
      }

      @Override
      public void onFailure(final Throwable caught) {
        doDeferredError(panel, caught);
      }
    });
  }
}
 
Example #6
Source File: DigitalObjectEditing.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    panel.setWidget(editor.getUI());
    Record[] digitalObjects = place.getDigitalObjects();
    if (digitalObjects != null) {
        editor.edit(place.getEditorId(), digitalObjects);
    } else {
        editor.edit(place.getEditorId(), place.getPids());
    }
}
 
Example #7
Source File: ConfigActivity.java    From bitcoin-transaction-explorer with MIT License 5 votes vote down vote up
@Override
public void start(final AcceptsOneWidget panel, final EventBus eventBus) {
  view.setPresenter(this);

  service.isPasswordPresent(new AppAsyncCallback<Boolean>() {
    @Override
    public void onSuccess(final Boolean result) {
      panel.setWidget(view);

      view.setCreatePassword(!result);
    }
  });
}
 
Example #8
Source File: StartActivityEvent.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 5 votes vote down vote up
private StartActivityEvent(Activity activity, Place place, AcceptsOneWidget container, IsWidget view) {
	this.setSource(place);
	this.activity = activity;
	this.place = place;
	this.container = container;
	this.view = view;
}
 
Example #9
Source File: InjectMvpDescriptionCreator.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void initComposer(ClassSourceFileComposerFactory composerFactory) {
	composerFactory.addImport(EntryPoint.class.getName());
	composerFactory.addImport(MvpController.class.getName());
	composerFactory.addImport(ActivityFactory.class.getName());
	composerFactory.addImport(EntryPoint.class.getName());
	composerFactory.addImport(AcceptsOneWidget.class.getName());
	composerFactory.addImport(IsWidget.class.getName());
	composerFactory.addImport(RootPanel.class.getName());

	composerFactory.addImplementedInterface(EntryPoint.class.getName());
}
 
Example #10
Source File: BinaryDataActivity.java    From requestor with Apache License 2.0 5 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    view.setHandler(this);
    Page.setTitle("Binary Data");
    Page.setDescription("Easily transfer binary data from/to server.");
    panel.setWidget(view);
    scrollToSection();
}
 
Example #11
Source File: SerializationActivity.java    From requestor with Apache License 2.0 5 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    view.setHandler(this);

    deserializerRegistration = requestor.register(new MyDeserializer());
    serializerRegistration = requestor.register(new MySerializer());
    serdesRegistration = requestor.register(new MyJsonSerdes());

    Page.setTitle("Serialization");
    Page.setDescription("Exchange any media type with a powerful serialization mechanism.");
    panel.setWidget(view);
    scrollToSection();
}
 
Example #12
Source File: SendingRequestsActivity.java    From requestor with Apache License 2.0 5 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    Page.setTitle("Sending Requests");
    Page.setDescription("Know the options for sending a request.");
    panel.setWidget(view);
    scrollToSection();
}
 
Example #13
Source File: GettingStartedActivity.java    From requestor with Apache License 2.0 5 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    Page.setTitle("Getting Started");
    Page.setDescription("The steps to download, install and set up Requestor.");
    panel.setWidget(gettingStarted);
    scrollToSection();
}
 
Example #14
Source File: FormActivity.java    From requestor with Apache License 2.0 5 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    view.setHandler(this);
    Page.setTitle("Form Data");
    Page.setDescription("Submit AJAX Forms easily.");
    panel.setWidget(view);
    scrollToSection();
}
 
Example #15
Source File: AuthActivity.java    From requestor with Apache License 2.0 5 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    view.setHandler(this);
    Page.setTitle("Authentication & Authorization");
    Page.setDescription("See how to authenticate/authorize requests in practice.");
    panel.setWidget(view);
    scrollToSection();
}
 
Example #16
Source File: BuildingRequestsActivity.java    From requestor with Apache License 2.0 5 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    Page.setTitle("Building Requests");
    Page.setDescription("Know the options for building a request.");
    panel.setWidget(view);
    scrollToSection();
}
 
Example #17
Source File: RequestingActivity.java    From requestor with Apache License 2.0 5 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    view.setHandler(this);
    Page.setTitle("Requesting");
    Page.setDescription("A quick intro on how to request with Requestor.");
    panel.setWidget(view);
    scrollToSection();
}
 
Example #18
Source File: InterceptorsActivity.java    From requestor with Apache License 2.0 5 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    view.setHandler(this);
    Page.setTitle("Interceptors");
    Page.setDescription("Transform incoming and outgoing payloads.");
    panel.setWidget(view);
    scrollToSection();
}
 
Example #19
Source File: FiltersActivity.java    From requestor with Apache License 2.0 5 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    view.setHandler(this);
    Page.setTitle("Filters");
    Page.setDescription("Explore the power of managing your requests by applying filters.");
    panel.setWidget(view);
    scrollToSection();
}
 
Example #20
Source File: ScriptActivity.java    From bitcoin-transaction-explorer with MIT License 5 votes vote down vote up
@Override
protected void doDeferredStart(final AcceptsOneWidget panel, final ScriptInformation scriptInformation) {
  panel.setWidget(view);

  final StackMachine machine = StackMachineFactory.createStackMachine(scriptInformation);

  view.setScript(scriptInformation, machine);
}
 
Example #21
Source File: AddressActivity.java    From bitcoin-transaction-explorer with MIT License 5 votes vote down vote up
@Override
public void start(final AcceptsOneWidget panel, final EventBus eventBus) {
  address = AddressParseUtil.parseAddress(place.getPayload());

  panel.setWidget(view);

  if(address == null) {
    return;
  }

  view.setAddress(address);

  super.start(panel, eventBus);
}
 
Example #22
Source File: BlockActivity.java    From bitcoin-transaction-explorer with MIT License 5 votes vote down vote up
@Override
protected void doDeferredStart(final AcceptsOneWidget panel, final BlockInformation blockInformation) {
  panel.setWidget(view);

  if(blockInformation == null) {
    return;
  }

  height = blockInformation.getHeight();

  view.setBlock(blockInformation);
}
 
Example #23
Source File: LazyLookupActivity.java    From bitcoin-transaction-explorer with MIT License 5 votes vote down vote up
@Override
public void start(final AcceptsOneWidget panel, final EventBus eventBus) {
  doLookup(place, new AsyncCallback<E>() {
    @Override
    public void onSuccess(final E result) {
      doDeferredStart(panel, result);
    }

    @Override
    public void onFailure(final Throwable caught) {
      doDeferredError(panel, caught);
    }
  });
}
 
Example #24
Source File: ScriptActivity.java    From bitcoin-transaction-explorer with MIT License 4 votes vote down vote up
@Override
protected void doDeferredError(final AcceptsOneWidget panel, final Throwable caught) {
  // Not supported
}
 
Example #25
Source File: DigitalObjectCreating.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    DigitalObjectCreator doc = presenters.getDigitalObjectCreator();
    panel.setWidget(doc.getUI());
    doc.newObject(place.getModel(), place.getParent());
}
 
Example #26
Source File: DigitalObjectManaging.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    DigitalObjectManager presenter = presenterFactory.getDigitalObjectManager();
    panel.setWidget(presenter.getUI());
    presenter.init();
}
 
Example #27
Source File: HomeActivity.java    From requestor with Apache License 2.0 4 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    Page.setTitle("Requestor", true);
    Page.setDescription("Requesting made easy for GWT.", true);
    panel.setWidget(home);
}
 
Example #28
Source File: DeviceManaging.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    DeviceManager presenter = presenterFactory.getDeviceManager();
    panel.setWidget(presenter.getUI());
    presenter.init();
}
 
Example #29
Source File: UserManaging.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {
    UsersView presenter = presenterFactory.getUsers();
    panel.setWidget(presenter.asWidget());
    presenter.onShow();
}
 
Example #30
Source File: AddressActivity.java    From bitcoin-transaction-explorer with MIT License 4 votes vote down vote up
@Override
protected void doDeferredError(final AcceptsOneWidget panel, final Throwable caught) {
  // Not supported
  GWT.log("boohoo " + caught.getMessage());
}