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

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


   */
  public void createPartControl(Composite parent) {

    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());

    hookDoubleClickCommand();
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) {
        contentProvider.removeEntry(obj);
      }

    }
    return null;
  }
View Full Code Here

        new DummyInputValidator());
    passwordDialog.open();
    String password = passwordDialog.getValue();

    if (file.isFile() && file.canRead()) {
      PWListContentProvider contentProvider = (PWListContentProvider) view
          .getContentProvider();
      try {
        contentProvider.loadEncryptedFile(password, file);
      } catch (Exception e) {
        MessageDialog.openError(shell, "Cannot open file",
            "Failed to load XML from file "
                + file.getAbsolutePath());
        e.printStackTrace();
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();

    } catch (Exception e) {
      e.printStackTrace();
      MessageDialog.openError(shell, "Cannot save file to file", e
          .getMessage());
View Full Code Here

        new DummyInputValidator());
    passwordDialog.open();
    String password = passwordDialog.getValue();

    if (file.isFile() && file.canRead()) {
      PWListContentProvider contentProvider = (PWListContentProvider) view
          .getContentProvider();
      try {
        contentProvider.mergeWithFile(password, file);
      } catch (Exception e) {
        MessageDialog.openError(shell, "Cannot open file",
            "Failed to load XML from file "
                + file.getAbsolutePath());
        e.printStackTrace();
View Full Code Here

  public Object execute(ExecutionEvent event) throws ExecutionException {
    // 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.addEntry();
    } catch (Exception e) {
      e.printStackTrace();
      throw new ExecutionException("Failed to add a new element", e);
    }
    return null;
View Full Code Here

      passwordDialog.open();
      String password2 = passwordDialog.getValue();

      if (password1.equals(password2)) {
        String password = password1;
        PWListContentProvider contentProvider = (PWListContentProvider) view
            .getContentProvider();
        try {
          contentProvider.saveEncryptedFile(password, file);
        } catch (ParserConfigurationException e) {
          MessageDialog.openError(shell, "Cannot save file",
              "Failed to write XML to file "
                  + file.getAbsolutePath());
          e.printStackTrace();
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) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      throw new ExecutionException("Creating new Content failed", e);
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.syncyoursecrets.gui.rcp.model.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.