org.eclipse.swt.win32.win32.x86_3.7.2.v3740f

int width = computeSize-1-1x;
    widthHint = Math.min(width, maxWidth);
    horizontalAlignment = 4;
    grabExcessHorizontalSpace = true;
    label.setLayoutData(data);
    
    Text valueText = new Text(shell, 2048);
    if (value[0] != null) {
      valueText.setText(value[0]);
    }
    data = new GridData();
    width = computeSize-1-1x;
    if (width > maxWidth) {
      widthHint = maxWidth;
    }
    horizontalAlignment = 4;
    grabExcessHorizontalSpace = true;
    valueText.setLayoutData(data);
    
    Button[] buttons = new Button[3];
    Listener listener = new Listener()
    {
      private final Button[] val$buttons;
      private final int[] val$checkValue;
      private final String[] val$value;
      private final Text val$valueText;
      private final int[] val$result;
      private final Shell val$shell;
      
      public void handleEvent(Event event)
      {
        if (val$buttons[0] != null) {
          val$checkValue[0] = (val$buttons[0].getSelection() ? 1 : 0);
        }
        val$value[0] = val$valueText.getText();
        val$result[0] = (widget == val$buttons[1] ? 1 : 0);
        val$shell.close();
      }
    };
    if (check != null)
    {
      buttons[0] = new Button(shell, 32);
      buttons[0].setText(check);
      buttons[0].setSelection(checkValue[0] != 0);
      data = new GridData();
      horizontalAlignment = 1;
      buttons[0].setLayoutData(data);
    }
    Composite composite = new Composite(shell, 0);
    data = new GridData();
    horizontalAlignment = 2;
    composite.setLayoutData(data);
    composite.setLayout(new GridLayout(2, true));
    buttons[1] = new Button(composite, 8);
    buttons[1].setText(SWT.getMessage("SWT_OK"));
    buttons[1].setLayoutData(new GridData(768));
    buttons[1].addListener(13, listener);
    buttons[2] = new Button(composite, 8);
    buttons[2].setText(SWT.getMessage("SWT_Cancel"));
    buttons[2].setLayoutData(new GridData(768));
    buttons[2].addListener(13, listener);
    
    shell.pack();
    shell.open();
    Display display = parent.getDisplay();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
  }
  
  void promptUsernameAndPassword(String title, String text, String check, String[] user, String[] pass, int[] checkValue, int[] result)
  {
    Shell parent = getParent();
    Shell shell = new Shell(parent, 67680);
    shell.setText(title);
    GridLayout gridLayout = new GridLayout();
    shell.setLayout(gridLayout);
    Label label = new Label(shell, 64);
    label.setText(text);
    GridData data = new GridData();
    Monitor monitor = parent.getMonitor();
    int maxWidth = getBoundswidth * 2 / 3;
    int width = computeSize-1-1x;
    widthHint = Math.min(width, maxWidth);
    horizontalAlignment = 4;
    grabExcessHorizontalSpace = true;
    label.setLayoutData(data);
    
    Label userLabel = new Label(shell, 0);
    userLabel.setText(SWT.getMessage("SWT_Username"));
    
    Text userText = new Text(shell, 2048);
    if (user[0] != null) {
      userText.setText(user[0]);
    }
    data = new GridData();
    horizontalAlignment = 4;
    grabExcessHorizontalSpace = true;
    userText.setLayoutData(data);
    
    Label passwordLabel = new Label(shell, 0);
    passwordLabel.setText(SWT.getMessage("SWT_Password"));
    
    Text passwordText = new Text(shell, 4196352);
    if (pass[0] != null) {
      passwordText.setText(pass[0]);
    }
    data = new GridData();
    horizontalAlignment = 4;
    grabExcessHorizontalSpace = true;
    passwordText.setLayoutData(data);
    
    Button[] buttons = new Button[3];
    Listener listener = new Listener()
    {
      private final Button[] val$buttons;
      private final int[] val$checkValue;
      private final String[] val$user;
      private final Text val$userText;
      private final String[] val$pass;
      private final Text val$passwordText;
      private final int[] val$result;
      private final Shell val$shell;
      
      public void handleEvent(Event event)
      {
        if (val$buttons[0] != null) {
          val$checkValue[0] = (val$buttons[0].getSelection() ? 1 : 0);
        }
        val$user[0] = val$userText.getText();
        val$pass[0] = val$passwordText.getText();
        val$result[0] = (widget == val$buttons[1] ? 1 : 0);
        val$shell.close();
      }
    };
    if (check != null)
    {
      buttons[0] = new Button(shell, 32);
      buttons[0].setText(check);
      buttons[0].setSelection(checkValue[0] != 0);
      data = new GridData();
      horizontalAlignment = 1;
      buttons[0].setLayoutData(data);
    }
    Composite composite = new Composite(shell, 0);
    data = new GridData();
    horizontalAlignment = 2;
    composite.setLayoutData(data);
    composite.setLayout(new GridLayout(2, true));
    buttons[1] = new Button(composite, 8);
    buttons[1].setText(SWT.getMessage("SWT_OK"));
    buttons[1].setLayoutData(new GridData(768));
    buttons[1].addListener(13, listener);
    buttons[2] = new Button(composite, 8);
    buttons[2].setText(SWT.getMessage("SWT_Cancel"));
    buttons[2].setLayoutData(new GridData(768));
    buttons[2].addListener(13, listener);
    
    shell.setDefaultButton(buttons[1]);
    shell.pack();
    shell.open();
    Display display = parent.getDisplay();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.PromptDialog
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import org.eclipse.swt.internal.mozilla.XPCOMObject;

class PromptService2$1
  extends XPCOMObject
{
  final PromptService2 this$0;
  
  PromptService2$1(PromptService2 paramPromptService2, int[] $anonymous0)
  {
    super($anonymous0);this$0 = paramPromptService2;
  }
  
  public int method0(int[] args)
  {
    return this$0.QueryInterface(args[0], args[1]);
  }
  
  public int method1(int[] args)
  {
    return this$0.AddRef();
  }
  
  public int method2(int[] args)
  {
    return this$0.Release();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.PromptService2.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import org.eclipse.swt.internal.mozilla.XPCOMObject;

class PromptService2$2
  extends XPCOMObject
{
  final PromptService2 this$0;
  
  PromptService2$2(PromptService2 paramPromptService2, int[] $anonymous0)
  {
    super($anonymous0);this$0 = paramPromptService2;
  }
  
  public int method0(int[] args)
  {
    return this$0.QueryInterface(args[0], args[1]);
  }
  
  public int method1(int[] args)
  {
    return this$0.AddRef();
  }
  
  public int method2(int[] args)
  {
    return this$0.Release();
  }
  
  public int method3(int[] args)
  {
    return this$0.Alert(args[0], args[1], args[2]);
  }
  
  public int method4(int[] args)
  {
    return this$0.AlertCheck(args[0], args[1], args[2], args[3], args[4]);
  }
  
  public int method5(int[] args)
  {
    return this$0.Confirm(args[0], args[1], args[2], args[3]);
  }
  
  public int method6(int[] args)
  {
    return this$0.ConfirmCheck(args[0], args[1], args[2], args[3], args[4], args[5]);
  }
  
  public int method7(int[] args)
  {
    return this$0.ConfirmEx(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]);
  }
  
  public int method8(int[] args)
  {
    return this$0.Prompt(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  }
  
  public int method9(int[] args)
  {
    return this$0.PromptUsernameAndPassword(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
  }
  
  public int method10(int[] args)
  {
    return this$0.PromptPassword(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  }
  
  public int method11(int[] args)
  {
    return this$0.Select(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.PromptService2.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import org.eclipse.swt.internal.mozilla.XPCOMObject;

class PromptService2$3
  extends XPCOMObject
{
  final PromptService2 this$0;
  
  PromptService2$3(PromptService2 paramPromptService2, int[] $anonymous0)
  {
    super($anonymous0);this$0 = paramPromptService2;
  }
  
  public int method0(int[] args)
  {
    return this$0.QueryInterface(args[0], args[1]);
  }
  
  public int method1(int[] args)
  {
    return this$0.AddRef();
  }
  
  public int method2(int[] args)
  {
    return this$0.Release();
  }
  
  public int method3(int[] args)
  {
    return this$0.Alert(args[0], args[1], args[2]);
  }
  
  public int method4(int[] args)
  {
    return this$0.AlertCheck(args[0], args[1], args[2], args[3], args[4]);
  }
  
  public int method5(int[] args)
  {
    return this$0.Confirm(args[0], args[1], args[2], args[3]);
  }
  
  public int method6(int[] args)
  {
    return this$0.ConfirmCheck(args[0], args[1], args[2], args[3], args[4], args[5]);
  }
  
  public int method7(int[] args)
  {
    return this$0.ConfirmEx(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]);
  }
  
  public int method8(int[] args)
  {
    return this$0.Prompt(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  }
  
  public int method9(int[] args)
  {
    return this$0.PromptUsernameAndPassword(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
  }
  
  public int method10(int[] args)
  {
    return this$0.PromptPassword(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  }
  
  public int method11(int[] args)
  {
    return this$0.Select(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  }
  
  public int method12(int[] args)
  {
    return this$0.PromptAuth(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  }
  
  public int method13(int[] args)
  {
    return this$0.AsyncPromptAuth(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.PromptService2.3
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import org.eclipse.swt.SWT;
import org.eclipse.swt.internal.C;
import org.eclipse.swt.internal.Compatibility;
import org.eclipse.swt.internal.mozilla.XPCOM;
import org.eclipse.swt.internal.mozilla.XPCOMObject;
import org.eclipse.swt.internal.mozilla.nsEmbedString;
import org.eclipse.swt.internal.mozilla.nsIAuthInformation;
import org.eclipse.swt.internal.mozilla.nsIChannel;
import org.eclipse.swt.internal.mozilla.nsID;
import org.eclipse.swt.internal.mozilla.nsIDOMWindow;
import org.eclipse.swt.internal.mozilla.nsIMemory;
import org.eclipse.swt.internal.mozilla.nsIPromptService;
import org.eclipse.swt.internal.mozilla.nsIPromptService2;
import org.eclipse.swt.internal.mozilla.nsIServiceManager;
import org.eclipse.swt.internal.mozilla.nsISupports;
import org.eclipse.swt.internal.mozilla.nsIURI;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;

class PromptService2
{
  XPCOMObject supports;
  XPCOMObject promptService;
  XPCOMObject promptService2;
  int refCount = 0;
  static final String[] certErrorCodes = {
    "ssl_error_bad_cert_domain", 
    "sec_error_ca_cert_invalid", 
    "sec_error_expired_certificate", 
    "sec_error_expired_issuer_certificate", 
    "sec_error_inadequate_key_usage", 
    "sec_error_unknown_issuer", 
    "sec_error_untrusted_cert", 
    "sec_error_untrusted_issuer" };
  
  PromptService2()
  {
    createCOMInterfaces();
  }
  
  int AddRef()
  {
    refCount += 1;
    return refCount;
  }
  
  void createCOMInterfaces()
  {
    supports = new XPCOMObject(new int[] { 2 })
    {
      public int method0(int[] args)
      {
        return QueryInterface(args[0], args[1]);
      }
      
      public int method1(int[] args)
      {
        return AddRef();
      }
      
      public int method2(int[] args)
      {
        return Release();
      }
    };
    promptService = new XPCOMObject(new int[] { 2, 0, 0, 3, 5, 4, 6, 10, 7, 8, 7, 7 })
    {
      public int method0(int[] args)
      {
        return QueryInterface(args[0], args[1]);
      }
      
      public int method1(int[] args)
      {
        return AddRef();
      }
      
      public int method2(int[] args)
      {
        return Release();
      }
      
      public int method3(int[] args)
      {
        return Alert(args[0], args[1], args[2]);
      }
      
      public int method4(int[] args)
      {
        return AlertCheck(args[0], args[1], args[2], args[3], args[4]);
      }
      
      public int method5(int[] args)
      {
        return Confirm(args[0], args[1], args[2], args[3]);
      }
      
      public int method6(int[] args)
      {
        return ConfirmCheck(args[0], args[1], args[2], args[3], args[4], args[5]);
      }
      
      public int method7(int[] args)
      {
        return ConfirmEx(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]);
      }
      
      public int method8(int[] args)
      {
        return Prompt(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
      }
      
      public int method9(int[] args)
      {
        return PromptUsernameAndPassword(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
      }
      
      public int method10(int[] args)
      {
        return PromptPassword(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
      }
      
      public int method11(int[] args)
      {
        return Select(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
      }
    };
    promptService2 = new XPCOMObject(new int[] { 2, 0, 0, 3, 5, 4, 6, 10, 7, 8, 7, 7, 7, 9 })
    {
      public int method0(int[] args)
      {
        return QueryInterface(args[0], args[1]);
      }
      
      public int method1(int[] args)
      {
        return AddRef();
      }
      
      public int method2(int[] args)
      {
        return Release();
      }
      
      public int method3(int[] args)
      {
        return Alert(args[0], args[1], args[2]);
      }
      
      public int method4(int[] args)
      {
        return AlertCheck(args[0], args[1], args[2], args[3], args[4]);
      }
      
      public int method5(int[] args)
      {
        return Confirm(args[0], args[1], args[2], args[3]);
      }
      
      public int method6(int[] args)
      {
        return ConfirmCheck(args[0], args[1], args[2], args[3], args[4], args[5]);
      }
      
      public int method7(int[] args)
      {
        return ConfirmEx(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]);
      }
      
      public int method8(int[] args)
      {
        return Prompt(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
      }
      
      public int method9(int[] args)
      {
        return PromptUsernameAndPassword(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
      }
      
      public int method10(int[] args)
      {
        return PromptPassword(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
      }
      
      public int method11(int[] args)
      {
        return Select(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
      }
      
      public int method12(int[] args)
      {
        return PromptAuth(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
      }
      
      public int method13(int[] args)
      {
        return AsyncPromptAuth(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
      }
    };
  }
  
  void disposeCOMInterfaces()
  {
    if (supports != null)
    {
      supports.dispose();
      supports = null;
    }
    if (promptService != null)
    {
      promptService.dispose();
      promptService = null;
    }
    if (promptService2 != null)
    {
      promptService2.dispose();
      promptService2 = null;
    }
  }
  
  int getAddress()
  {
    return promptService2.getAddress();
  }
  
  int QueryInterface(int riid, int ppvObject)
  {
    if ((riid == 0) || (ppvObject == 0)) {
      return -2147467262;
    }
    nsID guid = new nsID();
    XPCOM.memmove(guid, riid, 16);
    if (guid.Equals(nsISupports.NS_ISUPPORTS_IID))
    {
      XPCOM.memmove(ppvObject, new int[] { supports.getAddress() }, C.PTR_SIZEOF);
      AddRef();
      return 0;
    }
    if (guid.Equals(nsIPromptService.NS_IPROMPTSERVICE_IID))
    {
      XPCOM.memmove(ppvObject, new int[] { promptService.getAddress() }, C.PTR_SIZEOF);
      AddRef();
      return 0;
    }
    if (guid.Equals(nsIPromptService2.NS_IPROMPTSERVICE2_IID))
    {
      XPCOM.memmove(ppvObject, new int[] { promptService2.getAddress() }, C.PTR_SIZEOF);
      AddRef();
      return 0;
    }
    XPCOM.memmove(ppvObject, new int[1], C.PTR_SIZEOF);
    return -2147467262;
  }
  
  int Release()
  {
    refCount -= 1;
    if (refCount == 0) {
      disposeCOMInterfaces();
    }
    return refCount;
  }
  
  Browser getBrowser(int aDOMWindow)
  {
    if (aDOMWindow == 0) {
      return null;
    }
    nsIDOMWindow window = new nsIDOMWindow(aDOMWindow);
    return Mozilla.findBrowser(window);
  }
  
  String getLabel(int buttonFlag, int index, int buttonTitle)
  {
    String label = null;
    int flag = (buttonFlag & 255 * index) / index;
    switch (flag)
    {
    case 2: 
      label = SWT.getMessage("SWT_Cancel"); break;
    case 4: 
      label = SWT.getMessage("SWT_No"); break;
    case 1: 
      label = SWT.getMessage("SWT_OK"); break;
    case 5: 
      label = SWT.getMessage("SWT_Save"); break;
    case 3: 
      label = SWT.getMessage("SWT_Yes"); break;
    case 127: 
      int length = XPCOM.strlen_PRUnichar(buttonTitle);
      char[] dest = new char[length];
      XPCOM.memmove(dest, buttonTitle, length * 2);
      label = new String(dest);
    }
    return label;
  }
  
  int Alert(int aParent, int aDialogTitle, int aText)
  {
    Browser browser = getBrowser(aParent);
    
    int length = XPCOM.strlen_PRUnichar(aDialogTitle);
    char[] dest = new char[length];
    XPCOM.memmove(dest, aDialogTitle, length * 2);
    String titleLabel = new String(dest);
    
    length = XPCOM.strlen_PRUnichar(aText);
    dest = new char[length];
    XPCOM.memmove(dest, aText, length * 2);
    String textLabel = new String(dest);
    if (browser != null) {
      for (int i = 0; i < certErrorCodes.length; i++) {
        if (textLabel.indexOf(certErrorCodes[i]) != -1)
        {
          Mozilla mozilla = (Mozilla)webBrowser;
          isRetrievingBadCert = true;
          browser.setUrl(lastNavigateURL);
          return 0;
        }
      }
    }
    Shell shell = browser == null ? new Shell() : browser.getShell();
    MessageBox messageBox = new MessageBox(shell, 40);
    messageBox.setText(titleLabel);
    messageBox.setMessage(textLabel);
    messageBox.open();
    return 0;
  }
  
  int AlertCheck(int aParent, int aDialogTitle, int aText, int aCheckMsg, int aCheckState)
  {
    Browser browser = getBrowser(aParent);
    
    int length = XPCOM.strlen_PRUnichar(aDialogTitle);
    char[] dest = new char[length];
    XPCOM.memmove(dest, aDialogTitle, length * 2);
    String titleLabel = new String(dest);
    
    length = XPCOM.strlen_PRUnichar(aText);
    dest = new char[length];
    XPCOM.memmove(dest, aText, length * 2);
    String textLabel = new String(dest);
    
    length = XPCOM.strlen_PRUnichar(aCheckMsg);
    dest = new char[length];
    XPCOM.memmove(dest, aCheckMsg, length * 2);
    String checkLabel = new String(dest);
    
    Shell shell = browser == null ? new Shell() : browser.getShell();
    PromptDialog dialog = new PromptDialog(shell);
    int[] check = new int[1];
    if (aCheckState != 0) {
      XPCOM.memmove(check, aCheckState, 4);
    }
    dialog.alertCheck(titleLabel, textLabel, checkLabel, check);
    if (aCheckState != 0) {
      XPCOM.memmove(aCheckState, check, 4);
    }
    return 0;
  }
  
  int AsyncPromptAuth(int aParent, int aChannel, int aCallback, int aContext, int level, int authInfo, int checkboxLabel, int checkValue, int _retval)
  {
    return -2147467263;
  }
  
  int Confirm(int aParent, int aDialogTitle, int aText, int _retval)
  {
    Browser browser = getBrowser(aParent);
    if ((browser != null) && (webBrowser).ignoreAllMessages))
    {
      XPCOM.memmove(_retval, new int[] { 1 }, 4);
      return 0;
    }
    int length = XPCOM.strlen_PRUnichar(aDialogTitle);
    char[] dest = new char[length];
    XPCOM.memmove(dest, aDialogTitle, length * 2);
    String titleLabel = new String(dest);
    
    length = XPCOM.strlen_PRUnichar(aText);
    dest = new char[length];
    XPCOM.memmove(dest, aText, length * 2);
    String textLabel = new String(dest);
    
    Shell shell = browser == null ? new Shell() : browser.getShell();
    MessageBox messageBox = new MessageBox(shell, 292);
    messageBox.setText(titleLabel);
    messageBox.setMessage(textLabel);
    int id = messageBox.open();
    int[] result = { id == 32 ? 1 : 0 };
    XPCOM.memmove(_retval, result, 4);
    return 0;
  }
  
  int ConfirmCheck(int aParent, int aDialogTitle, int aText, int aCheckMsg, int aCheckState, int _retval)
  {
    return -2147467263;
  }
  
  int ConfirmEx(int aParent, int aDialogTitle, int aText, int aButtonFlags, int aButton0Title, int aButton1Title, int aButton2Title, int aCheckMsg, int aCheckState, int _retval)
  {
    Browser browser = getBrowser(aParent);
    
    int length = XPCOM.strlen_PRUnichar(aDialogTitle);
    char[] dest = new char[length];
    XPCOM.memmove(dest, aDialogTitle, length * 2);
    String titleLabel = new String(dest);
    
    length = XPCOM.strlen_PRUnichar(aText);
    dest = new char[length];
    XPCOM.memmove(dest, aText, length * 2);
    String textLabel = new String(dest);
    
    String checkLabel = null;
    if (aCheckMsg != 0)
    {
      length = XPCOM.strlen_PRUnichar(aCheckMsg);
      dest = new char[length];
      XPCOM.memmove(dest, aCheckMsg, length * 2);
      checkLabel = new String(dest);
    }
    String button0Label = getLabel(aButtonFlags, 1, aButton0Title);
    String button1Label = getLabel(aButtonFlags, 256, aButton1Title);
    String button2Label = getLabel(aButtonFlags, 65536, aButton2Title);
    
    int defaultIndex = 0;
    if ((aButtonFlags & 0x1000000) != 0) {
      defaultIndex = 1;
    } else if ((aButtonFlags & 0x2000000) != 0) {
      defaultIndex = 2;
    }
    Shell shell = browser == null ? new Shell() : browser.getShell();
    PromptDialog dialog = new PromptDialog(shell);
    int[] check = new int[1];int[] result = new int[1];
    if (aCheckState != 0) {
      XPCOM.memmove(check, aCheckState, 4);
    }
    dialog.confirmEx(titleLabel, textLabel, checkLabel, button0Label, button1Label, button2Label, defaultIndex, check, result);
    if (aCheckState != 0) {
      XPCOM.memmove(aCheckState, check, 4);
    }
    XPCOM.memmove(_retval, result, 4);
    return 0;
  }
  
  int Prompt(int aParent, int aDialogTitle, int aText, int aValue, int aCheckMsg, int aCheckState, int _retval)
  {
    Browser browser = getBrowser(aParent);
    String titleLabel = null;String checkLabel = null;
    String[] valueLabel = new String[1];
    if (aDialogTitle != 0)
    {
      int length = XPCOM.strlen_PRUnichar(aDialogTitle);
      char[] dest = new char[length];
      XPCOM.memmove(dest, aDialogTitle, length * 2);
      titleLabel = new String(dest);
    }
    int length = XPCOM.strlen_PRUnichar(aText);
    char[] dest = new char[length];
    XPCOM.memmove(dest, aText, length * 2);
    String textLabel = new String(dest);
    
    int[] valueAddr = new int[1];
    XPCOM.memmove(valueAddr, aValue, C.PTR_SIZEOF);
    if (valueAddr[0] != 0)
    {
      length = XPCOM.strlen_PRUnichar(valueAddr[0]);
      dest = new char[length];
      XPCOM.memmove(dest, valueAddr[0], length * 2);
      valueLabel[0] = new String(dest);
    }
    if (aCheckMsg != 0)
    {
      length = XPCOM.strlen_PRUnichar(aCheckMsg);
      if (length > 0)
      {
        dest = new char[length];
        XPCOM.memmove(dest, aCheckMsg, length * 2);
        checkLabel = new String(dest);
      }
    }
    Shell shell = browser == null ? new Shell() : browser.getShell();
    PromptDialog dialog = new PromptDialog(shell);
    int[] check = new int[1];int[] result = new int[1];
    if (aCheckState != 0) {
      XPCOM.memmove(check, aCheckState, 4);
    }
    dialog.prompt(titleLabel, textLabel, checkLabel, valueLabel, check, result);
    
    XPCOM.memmove(_retval, result, 4);
    if (result[0] == 1) {
      if (valueLabel[0] != null)
      {
        int[] result2 = new int[1];
        int rc = XPCOM.NS_GetServiceManager(result2);
        if (rc != 0) {
          SWT.error(rc);
        }
        if (result2[0] == 0) {
          SWT.error(-2147467262);
        }
        nsIServiceManager serviceManager = new nsIServiceManager(result2[0]);
        result2[0] = 0;
        byte[] aContractID = MozillaDelegate.wcsToMbcs(null, "@mozilla.org/xpcom/memory-service;1", true);
        rc = serviceManager.GetServiceByContractID(aContractID, nsIMemory.NS_IMEMORY_IID, result2);
        if (rc != 0) {
          SWT.error(rc);
        }
        if (result2[0] == 0) {
          SWT.error(-2147467262);
        }
        serviceManager.Release();
        
        nsIMemory memory = new nsIMemory(result2[0]);
        result2[0] = 0;
        
        int cnt = valueLabel[0].length();
        char[] buffer = new char[cnt + 1];
        valueLabel[0].getChars(0, cnt, buffer, 0);
        int size = buffer.length * 2;
        int ptr = memory.Alloc(size);
        XPCOM.memmove(ptr, buffer, size);
        XPCOM.memmove(aValue, new int[] { ptr }, C.PTR_SIZEOF);
        if (valueAddr[0] != 0) {
          memory.Free(valueAddr[0]);
        }
        memory.Release();
      }
    }
    if (aCheckState != 0) {
      XPCOM.memmove(aCheckState, check, 4);
    }
    return 0;
  }
  
  int PromptAuth(int aParent, int aChannel, int level, int authInfo, int checkboxLabel, int checkboxValue, int _retval)
  {
    nsIAuthInformation auth = new nsIAuthInformation(authInfo);
    
    Browser browser = getBrowser(aParent);
    if (browser != null)
    {
      Mozilla mozilla = (Mozilla)webBrowser;
      if (authCount++ < 3) {
        for (int i = 0; i < authenticationListeners.length; i++)
        {
          AuthenticationEvent event = new AuthenticationEvent(browser);
          location = lastNavigateURL;
          authenticationListeners[i].authenticate(event);
          if (!doit)
          {
            XPCOM.memmove(_retval, new int[1], 4);
            return 0;
          }
          if ((user != null) && (password != null))
          {
            nsEmbedString string = new nsEmbedString(user);
            int rc = auth.SetUsername(string.getAddress());
            if (rc != 0) {
              SWT.error(rc);
            }
            string.dispose();
            string = new nsEmbedString(password);
            rc = auth.SetPassword(string.getAddress());
            if (rc != 0) {
              SWT.error(rc);
            }
            string.dispose();
            XPCOM.memmove(_retval, new int[] { 1 }, 4);
            return 0;
          }
        }
      }
    }
    String checkLabel = null;
    int[] checkValue = new int[1];
    String[] userLabel = new String[1];String[] passLabel = new String[1];
    
    String title = SWT.getMessage("SWT_Authentication_Required");
    if ((checkboxLabel != 0) && (checkboxValue != 0))
    {
      int length = XPCOM.strlen_PRUnichar(checkboxLabel);
      char[] dest = new char[length];
      XPCOM.memmove(dest, checkboxLabel, length * 2);
      checkLabel = new String(dest);
      XPCOM.memmove(checkValue, checkboxValue, 4);
    }
    int ptr = XPCOM.nsEmbedString_new();
    int rc = auth.GetUsername(ptr);
    if (rc != 0) {
      SWT.error(rc);
    }
    int length = XPCOM.nsEmbedString_Length(ptr);
    int buffer = XPCOM.nsEmbedString_get(ptr);
    char[] chars = new char[length];
    XPCOM.memmove(chars, buffer, length * 2);
    userLabel[0] = new String(chars);
    XPCOM.nsEmbedString_delete(ptr);
    
    ptr = XPCOM.nsEmbedString_new();
    rc = auth.GetPassword(ptr);
    if (rc != 0) {
      SWT.error(rc);
    }
    length = XPCOM.nsEmbedString_Length(ptr);
    buffer = XPCOM.nsEmbedString_get(ptr);
    chars = new char[length];
    XPCOM.memmove(chars, buffer, length * 2);
    passLabel[0] = new String(chars);
    XPCOM.nsEmbedString_delete(ptr);
    
    ptr = XPCOM.nsEmbedString_new();
    rc = auth.GetRealm(ptr);
    if (rc != 0) {
      SWT.error(rc);
    }
    length = XPCOM.nsEmbedString_Length(ptr);
    buffer = XPCOM.nsEmbedString_get(ptr);
    chars = new char[length];
    XPCOM.memmove(chars, buffer, length * 2);
    String realm = new String(chars);
    XPCOM.nsEmbedString_delete(ptr);
    
    nsIChannel channel = new nsIChannel(aChannel);
    int[] uri = new int[1];
    rc = channel.GetURI(uri);
    if (rc != 0) {
      SWT.error(rc);
    }
    if (uri[0] == 0) {
      Mozilla.error(-2147467262);
    }
    nsIURI nsURI = new nsIURI(uri[0]);
    int host = XPCOM.nsEmbedCString_new();
    rc = nsURI.GetHost(host);
    if (rc != 0) {
      SWT.error(rc);
    }
    length = XPCOM.nsEmbedCString_Length(host);
    buffer = XPCOM.nsEmbedCString_get(host);
    byte[] bytes = new byte[length];
    XPCOM.memmove(bytes, buffer, length);
    String hostString = new String(bytes);
    XPCOM.nsEmbedCString_delete(host);
    nsURI.Release();
    String message;
    String message;
    if ((realm.length() > 0) && (hostString.length() > 0)) {
      message = Compatibility.getMessage("SWT_Enter_Username_and_Password", new String[] { realm, hostString });
    } else {
      message = "";
    }
    Shell shell = browser == null ? new Shell() : browser.getShell();
    PromptDialog dialog = new PromptDialog(shell);
    int[] result = new int[1];
    dialog.promptUsernameAndPassword(title, message, checkLabel, userLabel, passLabel, checkValue, result);
    
    XPCOM.memmove(_retval, result, 4);
    if (result[0] == 1)
    {
      nsEmbedString string = new nsEmbedString(userLabel[0]);
      rc = auth.SetUsername(string.getAddress());
      if (rc != 0) {
        SWT.error(rc);
      }
      string.dispose();
      
      string = new nsEmbedString(passLabel[0]);
      rc = auth.SetPassword(string.getAddress());
      if (rc != 0) {
        SWT.error(rc);
      }
      string.dispose();
    }
    if (checkboxValue != 0) {
      XPCOM.memmove(checkboxValue, checkValue, 4);
    }
    return 0;
  }
  
  int PromptUsernameAndPassword(int aParent, int aDialogTitle, int aText, int aUsername, int aPassword, int aCheckMsg, int aCheckState, int _retval)
  {
    Browser browser = getBrowser(aParent);
    String user = null;String password = null;
    if (browser != null)
    {
      Mozilla mozilla = (Mozilla)webBrowser;
      if (authCount++ < 3) {
        for (int i = 0; i < authenticationListeners.length; i++)
        {
          AuthenticationEvent event = new AuthenticationEvent(browser);
          location = lastNavigateURL;
          authenticationListeners[i].authenticate(event);
          if (!doit)
          {
            XPCOM.memmove(_retval, new int[1], 4);
            return 0;
          }
          if ((user != null) && (password != null))
          {
            user = user;
            password = password;
            XPCOM.memmove(_retval, new int[] { 1 }, 4);
            break;
          }
        }
      }
    }
    if (user == null)
    {
      String checkLabel = null;
      String[] userLabel = new String[1];String[] passLabel = new String[1];
      String titleLabel;
      String titleLabel;
      if (aDialogTitle != 0)
      {
        int length = XPCOM.strlen_PRUnichar(aDialogTitle);
        char[] dest = new char[length];
        XPCOM.memmove(dest, aDialogTitle, length * 2);
        titleLabel = new String(dest);
      }
      else
      {
        titleLabel = SWT.getMessage("SWT_Authentication_Required");
      }
      int length = XPCOM.strlen_PRUnichar(aText);
      char[] dest = new char[length];
      XPCOM.memmove(dest, aText, length * 2);
      String textLabel = new String(dest);
      
      int[] userAddr = new int[1];
      XPCOM.memmove(userAddr, aUsername, C.PTR_SIZEOF);
      if (userAddr[0] != 0)
      {
        length = XPCOM.strlen_PRUnichar(userAddr[0]);
        dest = new char[length];
        XPCOM.memmove(dest, userAddr[0], length * 2);
        userLabel[0] = new String(dest);
      }
      int[] passAddr = new int[1];
      XPCOM.memmove(passAddr, aPassword, C.PTR_SIZEOF);
      if (passAddr[0] != 0)
      {
        length = XPCOM.strlen_PRUnichar(passAddr[0]);
        dest = new char[length];
        XPCOM.memmove(dest, passAddr[0], length * 2);
        passLabel[0] = new String(dest);
      }
      if (aCheckMsg != 0)
      {
        length = XPCOM.strlen_PRUnichar(aCheckMsg);
        if (length > 0)
        {
          dest = new char[length];
          XPCOM.memmove(dest, aCheckMsg, length * 2);
          checkLabel = new String(dest);
        }
      }
      Shell shell = browser == null ? new Shell() : browser.getShell();
      PromptDialog dialog = new PromptDialog(shell);
      int[] check = new int[1];int[] result = new int[1];
      if (aCheckState != 0) {
        XPCOM.memmove(check, aCheckState, 4);
      }
      dialog.promptUsernameAndPassword(titleLabel, textLabel, checkLabel, userLabel, passLabel, check, result);
      
      XPCOM.memmove(_retval, result, 4);
      if (result[0] == 1)
      {
        user = userLabel[0];
        password = passLabel[0];
      }
      if (aCheckState != 0) {
        XPCOM.memmove(aCheckState, check, 4);
      }
    }
    if (user != null)
    {
      int[] userAddr = new int[1];
      XPCOM.memmove(userAddr, aUsername, C.PTR_SIZEOF);
      int[] passAddr = new int[1];
      XPCOM.memmove(passAddr, aPassword, C.PTR_SIZEOF);
      
      int[] result = new int[1];
      int rc = XPCOM.NS_GetServiceManager(result);
      if (rc != 0) {
        SWT.error(rc);
      }
      if (result[0] == 0) {
        SWT.error(-2147467262);
      }
      nsIServiceManager serviceManager = new nsIServiceManager(result[0]);
      result[0] = 0;
      byte[] aContractID = MozillaDelegate.wcsToMbcs(null, "@mozilla.org/xpcom/memory-service;1", true);
      rc = serviceManager.GetServiceByContractID(aContractID, nsIMemory.NS_IMEMORY_IID, result);
      if (rc != 0) {
        SWT.error(rc);
      }
      if (result[0] == 0) {
        SWT.error(-2147467262);
      }
      serviceManager.Release();
      
      nsIMemory memory = new nsIMemory(result[0]);
      result[0] = 0;
      if (userAddr[0] != 0) {
        memory.Free(userAddr[0]);
      }
      if (passAddr[0] != 0) {
        memory.Free(passAddr[0]);
      }
      memory.Release();
      
      int cnt = user.length();
      char[] buffer = new char[cnt + 1];
      user.getChars(0, cnt, buffer, 0);
      int size = buffer.length * 2;
      int ptr = C.malloc(size);
      XPCOM.memmove(ptr, buffer, size);
      XPCOM.memmove(aUsername, new int[] { ptr }, C.PTR_SIZEOF);
      
      cnt = password.length();
      buffer = new char[cnt + 1];
      password.getChars(0, cnt, buffer, 0);
      size = buffer.length * 2;
      ptr = C.malloc(size);
      XPCOM.memmove(ptr, buffer, size);
      XPCOM.memmove(aPassword, new int[] { ptr }, C.PTR_SIZEOF);
    }
    return 0;
  }
  
  int PromptPassword(int aParent, int aDialogTitle, int aText, int aPassword, int aCheckMsg, int aCheckState, int _retval)
  {
    return -2147467263;
  }
  
  int Select(int aParent, int aDialogTitle, int aText, int aCount, int aSelectList, int aOutSelection, int _retval)
  {
    return -2147467263;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.PromptService2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import org.eclipse.swt.internal.mozilla.XPCOMObject;

class PromptService2Factory$1
  extends XPCOMObject
{
  final PromptService2Factory this$0;
  
  PromptService2Factory$1(PromptService2Factory paramPromptService2Factory, int[] $anonymous0)
  {
    super($anonymous0);this$0 = paramPromptService2Factory;
  }
  
  public int method0(int[] args)
  {
    return this$0.QueryInterface(args[0], args[1]);
  }
  
  public int method1(int[] args)
  {
    return this$0.AddRef();
  }
  
  public int method2(int[] args)
  {
    return this$0.Release();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.PromptService2Factory.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import org.eclipse.swt.internal.mozilla.XPCOMObject;

class PromptService2Factory$2
  extends XPCOMObject
{
  final PromptService2Factory this$0;
  
  PromptService2Factory$2(PromptService2Factory paramPromptService2Factory, int[] $anonymous0)
  {
    super($anonymous0);this$0 = paramPromptService2Factory;
  }
  
  public int method0(int[] args)
  {
    return this$0.QueryInterface(args[0], args[1]);
  }
  
  public int method1(int[] args)
  {
    return this$0.AddRef();
  }
  
  public int method2(int[] args)
  {
    return this$0.Release();
  }
  
  public int method3(int[] args)
  {
    return this$0.CreateInstance(args[0], args[1], args[2]);
  }
  
  public int method4(int[] args)
  {
    return this$0.LockFactory(args[0]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.PromptService2Factory.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import org.eclipse.swt.internal.C;
import org.eclipse.swt.internal.mozilla.XPCOM;
import org.eclipse.swt.internal.mozilla.XPCOMObject;
import org.eclipse.swt.internal.mozilla.nsID;
import org.eclipse.swt.internal.mozilla.nsIFactory;
import org.eclipse.swt.internal.mozilla.nsISupports;

class PromptService2Factory
{
  XPCOMObject supports;
  XPCOMObject factory;
  int refCount = 0;
  
  PromptService2Factory()
  {
    createCOMInterfaces();
  }
  
  int AddRef()
  {
    refCount += 1;
    return refCount;
  }
  
  void createCOMInterfaces()
  {
    supports = new XPCOMObject(new int[] { 2 })
    {
      public int method0(int[] args)
      {
        return QueryInterface(args[0], args[1]);
      }
      
      public int method1(int[] args)
      {
        return AddRef();
      }
      
      public int method2(int[] args)
      {
        return Release();
      }
    };
    factory = new XPCOMObject(new int[] { 2, 0, 0, 3, 1 })
    {
      public int method0(int[] args)
      {
        return QueryInterface(args[0], args[1]);
      }
      
      public int method1(int[] args)
      {
        return AddRef();
      }
      
      public int method2(int[] args)
      {
        return Release();
      }
      
      public int method3(int[] args)
      {
        return CreateInstance(args[0], args[1], args[2]);
      }
      
      public int method4(int[] args)
      {
        return LockFactory(args[0]);
      }
    };
  }
  
  void disposeCOMInterfaces()
  {
    if (supports != null)
    {
      supports.dispose();
      supports = null;
    }
    if (factory != null)
    {
      factory.dispose();
      factory = null;
    }
  }
  
  int getAddress()
  {
    return factory.getAddress();
  }
  
  int QueryInterface(int riid, int ppvObject)
  {
    if ((riid == 0) || (ppvObject == 0)) {
      return -2147467262;
    }
    nsID guid = new nsID();
    XPCOM.memmove(guid, riid, 16);
    if (guid.Equals(nsISupports.NS_ISUPPORTS_IID))
    {
      XPCOM.memmove(ppvObject, new int[] { supports.getAddress() }, C.PTR_SIZEOF);
      AddRef();
      return 0;
    }
    if (g
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd