Package net.sourceforge.syncyoursecrets.gui.rcp.model.list

Examples of net.sourceforge.syncyoursecrets.gui.rcp.model.list.PWListContentProvider


   */
  public void createPartControl(Composite parent) {
    logger.debug("entering createPartControl");
    viewer = new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL
        | SWT.V_SCROLL);
    contentProvider = new PWListContentProvider(viewer);
    viewer.setContentProvider(contentProvider);
    viewer.setLabelProvider(new PWListLabelProvider());
    viewer.setInput(getViewSite());

    hookSelectionListener();
View Full Code Here


    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
    IWorkbenchPage page = window.getActivePage();
    View view = (View) page.findView(View.ID);

    // get the content provider and fill it with an empty list
    PWListContentProvider contentProvider = (PWListContentProvider) view
        .getContentProvider();
    try {
      contentProvider.createNew();
    } catch (ParserConfigurationException e) {

      String msg = "Creating new Content failed";

      MessageDialog.showUnexpectedErrorMessage(msg, logger, e);
View Full Code Here

    IWorkbenchPage page = window.getActivePage();
    View view = (View) page.findView(View.ID);
    TableViewer viewer = view.getViewer();

    // Get the selection
    PWListContentProvider contentProvider = (PWListContentProvider) view
        .getContentProvider();
    ISelection selection = viewer.getSelection();
    if (selection instanceof IStructuredSelection) {
      Object obj = ((IStructuredSelection) selection).getFirstElement();
      if (obj != null) {
        logger.debug("Removing 1 Object");
        contentProvider.removeEntry(obj);
      }

    } else {
      // error handling: Unexpected case no IStructuredSelection
      String msg = "Selected Element is not an instance of IStructuredSelection";
View Full Code Here

    String password = passwordDialog.getValue();

    logger.debug("Password entered, length is" + password.length());

    if (file.isFile() && file.canRead()) {
      PWListContentProvider contentProvider = (PWListContentProvider) view
          .getContentProvider();
      try {
        contentProvider.loadEncryptedFile(password, file);
      } catch (Exception e) {

        String msg = "Cannot open file"
            + "Failed to load XML from file "
            + file.getAbsolutePath();
View Full Code Here

    // Get the view
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
    IWorkbenchPage page = window.getActivePage();
    View view = (View) page.findView(View.ID);

    PWListContentProvider contentProvider = (PWListContentProvider) view
        .getContentProvider();
    try {

      contentProvider.save();
      MessageDialog.showInfoMessage("File successfully saved",
          "File saved", logger);
    } catch (SysGenericException e) {
      String msg = "Cannot save file to file " + e.getMessage();
      MessageDialog.showExpectedErrorMessage(msg, logger, e);
View Full Code Here

    passwordDialog.open();
    String password = passwordDialog.getValue();
    logger.debug("Password entered, length is " + password.length());

    if (file.isFile() && file.canRead()) {
      PWListContentProvider contentProvider = (PWListContentProvider) view
          .getContentProvider();
      try {
        contentProvider.mergeWithFile(password, file);
      } catch (Exception e) {

        String msg = "Cannot merge file"
            + "Failed to load XML from file "
            + file.getAbsolutePath();
View Full Code Here

      logger.debug("Entered password for the 1st time, length is "
          + password1.length());
      if (password1.equals(password2)) {
        logger.info("Entered passwords match, OK");
        String password = password1;
        PWListContentProvider contentProvider = (PWListContentProvider) view
            .getContentProvider();
        try {
          contentProvider.saveEncryptedFile(password, file);
          MessageDialog.showInfoMessage("Successfully saved to "
              + file.getAbsolutePath(), "File saved", logger);
        } catch (SysGenericException e) {
          String msg = "Cannot save file to file " + e.getMessage();
          MessageDialog.showExpectedErrorMessage(msg, logger, e);
View Full Code Here

TOP

Related Classes of net.sourceforge.syncyoursecrets.gui.rcp.model.list.PWListContentProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.