JBoss Tools SVN: r28836 - trunk/build/aggregate/site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-02-01 13:55:45 -0500 (Tue, 01 Feb 2011)
New Revision: 28836
Modified:
trunk/build/aggregate/site/index-template.html
trunk/build/aggregate/site/index.html
Log:
tweak copy per http://www.jboss.org/tools/download/dev#noteBirt and https://issues.jboss.org/browse/JBIDE-8089
Modified: trunk/build/aggregate/site/index-template.html
===================================================================
--- trunk/build/aggregate/site/index-template.html 2011-02-01 18:05:53 UTC (rev 28835)
+++ trunk/build/aggregate/site/index-template.html 2011-02-01 18:55:45 UTC (rev 28836)
@@ -35,13 +35,11 @@
<tr class="dark-row" style="height: 90px">
<td class="bodyText">
- <p class="bodyText"><b class="bodyText" style="color: red;">NOTE:</b> Some
- features (such as BIRT, Maven, or GWT) require additional third-party
- prerequisites not available from Eclipse.org or JBoss.org. These can
- be installed from the following update sites, which may already be
- listed - but not enabled - in your Eclipse's list of Available
- Software Sites. Simply right-click the link(s) below from which you'd like to
- install, copy the link, and paste it into Eclipse's Update or Install Manager:</p>
+ <p class="bodyText"><b class="bodyText" style="color: red;">NOTE:</b>
+<!-- see http://www.jboss.org/tools/download/dev#noteBirt for matching copy -->
+Some features (such as BIRT, Maven, or GWT) require additional third-party prerequisites not available from Eclipse.org or JBoss.org. These can be installed from the following update sites, which should be added automatically when you add the JBoss Tools update site to your Eclipse's list of Available Software Sites. To verify which sites are enabled, open <code><strong>Window > Preferences > Install/Update > Available Software Sites</strong></code>. To add sites, Click the <code><strong>Add...</strong></code> button, then right-click the link(s) below, copy the link(s), and paste them into Eclipse one by one as needed.
+ </p>
+
<ul>
<li><a href="http://download.eclipse.org//birt/update-site/2.6/">BIRT 2.6 Update Site</a></li>
<li><a href="http://m2eclipse.sonatype.org/sites/m2e/">m2eclipse 0.10 Release</a></li>
Modified: trunk/build/aggregate/site/index.html
===================================================================
--- trunk/build/aggregate/site/index.html 2011-02-01 18:05:53 UTC (rev 28835)
+++ trunk/build/aggregate/site/index.html 2011-02-01 18:55:45 UTC (rev 28836)
@@ -35,13 +35,11 @@
<tr class="dark-row" style="height: 90px">
<td class="bodyText">
- <p class="bodyText"><b class="bodyText" style="color: red;">NOTE:</b> Some
- features (such as BIRT, Maven, or GWT) require additional third-party
- prerequisites not available from Eclipse.org or JBoss.org. These can
- be installed from the following update sites, which may already be
- listed - but not enabled - in your Eclipse's list of Available
- Software Sites. Simply right-click the link(s) below from which you'd like to
- install, copy the link, and paste it into Eclipse's Update or Install Manager:</p>
+ <p class="bodyText"><b class="bodyText" style="color: red;">NOTE:</b>
+<!-- see http://www.jboss.org/tools/download/dev#noteBirt for matching copy -->
+Some features (such as BIRT, Maven, or GWT) require additional third-party prerequisites not available from Eclipse.org or JBoss.org. These can be installed from the following update sites, which should be added automatically when you add the JBoss Tools update site to your Eclipse's list of Available Software Sites. To verify which sites are enabled, open <code><strong>Window > Preferences > Install/Update > Available Software Sites</strong></code>. To add sites, Click the <code><strong>Add...</strong></code> button, then right-click the link(s) below, copy the link(s), and paste them into Eclipse one by one as needed.
+ </p>
+
<ul>
<li><a href="http://download.eclipse.org//birt/update-site/2.6/">BIRT 2.6 Update Site</a></li>
<li><a href="http://m2eclipse.sonatype.org/sites/m2e/">m2eclipse 0.10 Release</a></li>
13 years, 10 months
JBoss Tools SVN: r28835 - trunk/jsf/docs/jsf_tools_ref_guide/en-US.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2011-02-01 13:05:53 -0500 (Tue, 01 Feb 2011)
New Revision: 28835
Modified:
trunk/jsf/docs/jsf_tools_ref_guide/en-US/jsf_support.xml
trunk/jsf/docs/jsf_tools_ref_guide/en-US/projects.xml
Log:
Fix typos
Modified: trunk/jsf/docs/jsf_tools_ref_guide/en-US/jsf_support.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_ref_guide/en-US/jsf_support.xml 2011-02-01 17:24:20 UTC (rev 28834)
+++ trunk/jsf/docs/jsf_tools_ref_guide/en-US/jsf_support.xml 2011-02-01 18:05:53 UTC (rev 28835)
@@ -164,7 +164,7 @@
<title>Code assist for Facelets</title>
<para>
- JSF Tools provides Facelets code assistance, which can be assessed by pressing <keycombo><keycap>Ctrl</keycap><keycap>Space</keycap></keycombo>. It is available for <property>Facelets tags</property> while editing <filename>.xhtml</filename> files.
+ JSF Tools provides Facelets code assistance, which can be accessed by pressing <keycombo><keycap>Ctrl</keycap><keycap>Space</keycap></keycombo>. It is available for <property>Facelets tags</property> while editing <filename>.xhtml</filename> files.
</para>
<figure>
Modified: trunk/jsf/docs/jsf_tools_ref_guide/en-US/projects.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_ref_guide/en-US/projects.xml 2011-02-01 17:24:20 UTC (rev 28834)
+++ trunk/jsf/docs/jsf_tools_ref_guide/en-US/projects.xml 2011-02-01 18:05:53 UTC (rev 28835)
@@ -170,7 +170,7 @@
</mediaobject>
</figure>
- <para>When you are all done, you should see that the project has been appeared in the Package Explorer view:</para>
+ <para>When you are all done, you should see that the project has appeared in the Package Explorer view:</para>
<figure>
<title>A New Project in the Package Explorer</title>
<mediaobject>
13 years, 10 months
JBoss Tools SVN: r28834 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools: internal/deltacloud/ui/wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-01 12:24:20 -0500 (Tue, 01 Feb 2011)
New Revision: 28834
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
Log:
[JBIDE-8148] moved cloud creation and cloud edit to background jobs
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2011-02-01 17:11:20 UTC (rev 28833)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2011-02-01 17:24:20 UTC (rev 28834)
@@ -241,7 +241,7 @@
}
protected abstract ITableContentAndLabelProvider<CLOUDELEMENT> getContentAndLabelProvider();
-
+
private void setViewerInput(DeltaCloud cloud) {
viewer.setInput(cloud);
}
@@ -306,9 +306,10 @@
return clouds[cloudIndex];
}
- private void createColumns(ITableContentAndLabelProvider<CLOUDELEMENT> provider, TableColumnLayout tableLayout, Table table) {
+ private void createColumns(ITableContentAndLabelProvider<CLOUDELEMENT> provider, TableColumnLayout tableLayout,
+ Table table) {
Columns<CLOUDELEMENT> columns = provider.getColumns();
-
+
for (int i = 0; i < columns.getSize(); ++i) {
Column<CLOUDELEMENT> c = columns.getColumn(i);
TableColumn tc = new TableColumn(table, SWT.NONE);
@@ -373,27 +374,33 @@
container.layout(true, true);
}
- public void cloudsChanged(int type, DeltaCloud cloud) {
- DeltaCloud[] clouds = getClouds();
- switch (type) {
- case IDeltaCloudManagerListener.REMOVE_EVENT:
- onCloudRemoved(cloud, clouds);
- break;
- default:
- }
-
- int index = getCloudIndex(currentCloud, clouds);
- String[] cloudNames = toCloudNames(clouds);
- setCloudSelectorItems(cloudNames, currentCloudSelector);
+ public void cloudsChanged(final int type, final DeltaCloud cloud) {
+ UIUtils.getActiveShell().getDisplay().syncExec(new Runnable() {
- if (cloudNames.length > 0) {
- currentCloudSelector.setText(cloudNames[index]);
- setViewerInput(currentCloud);
- } else {
- currentCloudSelector.setText("");
- setViewerInput(null);
+ @Override
+ public void run() {
+ DeltaCloud[] clouds = getClouds();
+ switch (type) {
+ case IDeltaCloudManagerListener.REMOVE_EVENT:
+ onCloudRemoved(cloud, clouds);
+ break;
+ default:
+ }
+
+ int index = getCloudIndex(currentCloud, clouds);
+ String[] cloudNames = toCloudNames(clouds);
+ setCloudSelectorItems(cloudNames, currentCloudSelector);
+
+ if (cloudNames.length > 0) {
+ currentCloudSelector.setText(cloudNames[index]);
+ setViewerInput(currentCloud);
+ } else {
+ currentCloudSelector.setText("");
+ setViewerInput(null);
+ }
+ container.layout(true, true);
}
- container.layout(true, true);
+ });
}
private void onCloudRemoved(DeltaCloud cloud, DeltaCloud[] clouds) {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java 2011-02-01 17:11:20 UTC (rev 28833)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java 2011-02-01 17:24:20 UTC (rev 28834)
@@ -62,7 +62,7 @@
};
try {
WizardUtils.runInWizard(job, getContainer());
- return job.getResult().getCode() != IStatus.ERROR;
+ return job.getResult() != null && job.getResult().getCode() != IStatus.ERROR;
} catch (Exception e) {
return false;
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java 2011-02-01 17:11:20 UTC (rev 28833)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java 2011-02-01 17:24:20 UTC (rev 28834)
@@ -142,7 +142,7 @@
};
try {
WizardUtils.runInWizard(job, getContainer());
- return job.getResult().getCode() != IStatus.ERROR;
+ return job.getResult() != null && job.getResult().getCode() != IStatus.ERROR;
} catch (Exception e) {
return false;
}
13 years, 10 months
JBoss Tools SVN: r28833 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/internal/deltacloud/ui/wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-01 12:11:20 -0500 (Tue, 01 Feb 2011)
New Revision: 28833
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
Log:
[JBIDE-8148] moved cloud creation and cloud edit to background jobs
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-02-01 16:34:37 UTC (rev 28832)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-02-01 17:11:20 UTC (rev 28833)
@@ -1,3 +1,13 @@
+2011-02-01 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
+ (performFinish):
+ (createCloud):
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java
+ (performFinish):
+ (editCloud):
+ [JBIDE-8148] moved cloud creation and cloud edit to background jobs
+
2011-01-31 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java (createControl):
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java 2011-02-01 16:34:37 UTC (rev 28832)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java 2011-02-01 17:11:20 UTC (rev 28833)
@@ -12,9 +12,15 @@
import java.text.MessageFormat;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.jboss.tools.common.log.StatusFactory;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudDriver;
-import org.jboss.tools.deltacloud.ui.ErrorUtils;
+import org.jboss.tools.deltacloud.ui.Activator;
+import org.jboss.tools.internal.deltacloud.ui.utils.WizardUtils;
/**
* @author Jeff Johnston
@@ -35,14 +41,31 @@
String username = mainPage.getUsername();
String password = mainPage.getPassword();
DeltaCloudDriver driver = mainPage.getDriver();
+ return editCloud(name, url, username, password, driver);
+ }
+
+ private boolean editCloud(final String name, final String url, final String username, final String password,
+ final DeltaCloudDriver driver) {
+ Job job = new Job(MessageFormat.format("Create cloud \"{0}\"", name)) {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ initialCloud.update(name, url, username, password, driver);
+ return Status.OK_STATUS;
+ } catch (Exception e) {
+ // TODO internationalize strings
+ return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
+ MessageFormat.format("Could not edit create cloud {0}", name), e);
+ }
+ }
+ };
try {
- initialCloud.update(name, url, username, password, driver);
+ WizardUtils.runInWizard(job, getContainer());
+ return job.getResult().getCode() != IStatus.ERROR;
} catch (Exception e) {
- // TODO internationalize strings
- ErrorUtils.handleError("Error",
- MessageFormat.format("Could not edit cloud \"{0}\"", initialCloud.getName()),
- e, getShell());
+ return false;
}
- return true;
}
+
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java 2011-02-01 16:34:37 UTC (rev 28832)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java 2011-02-01 17:11:20 UTC (rev 28833)
@@ -12,10 +12,15 @@
import java.text.MessageFormat;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
+import org.jboss.tools.common.log.StatusFactory;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudDriver;
import org.jboss.tools.deltacloud.core.DeltaCloudException;
@@ -24,6 +29,7 @@
import org.jboss.tools.deltacloud.ui.ErrorUtils;
import org.jboss.tools.internal.deltacloud.ui.preferences.IPreferenceKeys;
import org.jboss.tools.internal.deltacloud.ui.preferences.StringPreferenceValue;
+import org.jboss.tools.internal.deltacloud.ui.utils.WizardUtils;
/**
* @author Jeff Johnston
@@ -103,24 +109,42 @@
@Override
public boolean performFinish() {
- String name = mainPage.getConnectionName();
- String url = mainPage.getUrl();
+ final String name = mainPage.getConnectionName();
+ final String url = mainPage.getUrl();
new StringPreferenceValue(IPreferenceKeys.LAST_URL, Activator.PLUGIN_ID)
.store(url);
- String username = mainPage.getUsername();
- String password = mainPage.getPassword();
- DeltaCloudDriver driver = mainPage.getDriver();
+ final String username = mainPage.getUsername();
+ final String password = mainPage.getPassword();
+ final DeltaCloudDriver driver = mainPage.getDriver();
+ return createCloud(name, url, username, password, driver);
+ }
+
+ private boolean createCloud(final String name, final String url, final String username, final String password,
+ final DeltaCloudDriver driver) {
+ Job job = new Job(MessageFormat.format("Create cloud \"{0}\"", name)) {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ DeltaCloud newCloud = new DeltaCloud(name, url, username, password, driver);
+ DeltaCloudManager.getDefault().addCloud(newCloud);
+ return Status.OK_STATUS;
+ } catch (Exception e) {
+ // TODO internationalize strings
+ return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
+ MessageFormat.format("Could not create cloud {0}", name), e);
+ }
+ }
+
+ };
try {
- DeltaCloud newCloud = new DeltaCloud(name, url, username, password, driver);
- DeltaCloudManager.getDefault().addCloud(newCloud);
+ WizardUtils.runInWizard(job, getContainer());
+ return job.getResult().getCode() != IStatus.ERROR;
} catch (Exception e) {
- // TODO internationalize strings
- ErrorUtils
- .handleError("Error", MessageFormat.format("Could not create cloud {0}", name), e, getShell());
+ return false;
}
- return true;
}
}
13 years, 10 months
JBoss Tools SVN: r28832 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-01 11:34:37 -0500 (Tue, 01 Feb 2011)
New Revision: 28832
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
Log:
[JBIDE-8148]
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2011-02-01 16:15:06 UTC (rev 28831)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2011-02-01 16:34:37 UTC (rev 28832)
@@ -77,7 +77,7 @@
private static final String NAME_PROPOSAL_KEY = "cloud/name";
private static final String USERNAME_PROPOSAL_KEY = "cloud/username";
private static final String URL_PROPOSAL_KEY = "cloud/url";
-
+
private static final int CLOUDTYPE_CHECK_DELAY = 1000;
private static final String DESCRIPTION = "CloudConnection.desc"; //$NON-NLS-1$
@@ -306,7 +306,8 @@
}
public CloudConnectionPage(String pageName, String defaultName, String defaultUrl, String defaultUsername,
- String defaultPassword, DeltaCloudDriver defaultDriver, CloudConnection cloudConnection) throws MalformedURLException {
+ String defaultPassword, DeltaCloudDriver defaultDriver, CloudConnection cloudConnection)
+ throws MalformedURLException {
super(pageName);
this.connectionModel =
new CloudConnectionPageModel(defaultName, defaultUrl, defaultUsername, defaultPassword, defaultDriver);
@@ -547,7 +548,8 @@
IObservableValue cloudTypeObservable = urlToCloudTypeConverter.getCloudTypeObservable();
Object value = cloudTypeObservable.getValue();
Assert.isTrue(value == null || value instanceof DeltaCloudDriver);
- DeltaCloudTypeLabelAdapter cloudTypeAdapter = new DeltaCloudTypeLabelAdapter((DeltaCloudDriver) value, typeLabel);
+ DeltaCloudTypeLabelAdapter cloudTypeAdapter = new DeltaCloudTypeLabelAdapter((DeltaCloudDriver) value,
+ typeLabel);
cloudTypeObservable.addValueChangeListener(cloudTypeAdapter);
ControlDecorationSupport.create(urlTypeBinding, SWT.LEFT | SWT.TOP);
@@ -576,7 +578,23 @@
ControlDecorationSupport.create(nameTextBinding, SWT.LEFT | SWT.TOP);
}
- public CloudConnectionPageModel getModel() {
- return connectionModel;
+ public String getUrl() {
+ return connectionModel.getUrl();
}
+
+ public String getConnectionName() {
+ return connectionModel.getName();
+ }
+
+ public String getUsername() {
+ return connectionModel.getUsername();
+ }
+
+ public String getPassword() {
+ return connectionModel.getPassword();
+ }
+
+ public DeltaCloudDriver getDriver() {
+ return connectionModel.getDriver();
+ }
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java 2011-02-01 16:15:06 UTC (rev 28831)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java 2011-02-01 16:34:37 UTC (rev 28832)
@@ -30,11 +30,11 @@
@Override
public boolean performFinish() {
- String name = mainPage.getModel().getName();
- String url = mainPage.getModel().getUrl();
- String username = mainPage.getModel().getUsername();
- String password = mainPage.getModel().getPassword();
- DeltaCloudDriver driver = mainPage.getModel().getDriver();
+ String name = mainPage.getConnectionName();
+ String url = mainPage.getUrl();
+ String username = mainPage.getUsername();
+ String password = mainPage.getPassword();
+ DeltaCloudDriver driver = mainPage.getDriver();
try {
initialCloud.update(name, url, username, password, driver);
} catch (Exception e) {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java 2011-02-01 16:15:06 UTC (rev 28831)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java 2011-02-01 16:34:37 UTC (rev 28832)
@@ -17,9 +17,9 @@
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudDriver;
import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudManager;
-import org.jboss.tools.deltacloud.core.DeltaCloudDriver;
import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.deltacloud.ui.ErrorUtils;
import org.jboss.tools.internal.deltacloud.ui.preferences.IPreferenceKeys;
@@ -82,10 +82,10 @@
}
public boolean performTest() {
- String name = mainPage.getModel().getName();
- String url = mainPage.getModel().getUrl();
- String username = mainPage.getModel().getUsername();
- String password = mainPage.getModel().getPassword();
+ String name = mainPage.getConnectionName();
+ String url = mainPage.getUrl();
+ String username = mainPage.getUsername();
+ String password = mainPage.getPassword();
try {
DeltaCloud newCloud = new DeltaCloud(name, url, username, password);
return newCloud.testCredentials();
@@ -103,15 +103,15 @@
@Override
public boolean performFinish() {
- String name = mainPage.getModel().getName();
- String url = mainPage.getModel().getUrl();
+ String name = mainPage.getConnectionName();
+ String url = mainPage.getUrl();
new StringPreferenceValue(IPreferenceKeys.LAST_URL, Activator.PLUGIN_ID)
.store(url);
- String username = mainPage.getModel().getUsername();
- String password = mainPage.getModel().getPassword();
- DeltaCloudDriver driver = mainPage.getModel().getDriver();
+ String username = mainPage.getUsername();
+ String password = mainPage.getPassword();
+ DeltaCloudDriver driver = mainPage.getDriver();
try {
DeltaCloud newCloud = new DeltaCloud(name, url, username, password, driver);
13 years, 10 months
JBoss Tools SVN: r28831 - in branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-01 11:15:06 -0500 (Tue, 01 Feb 2011)
New Revision: 28831
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java
Log:
[JBIDE-8292] Server Adapter and RSE now use instance alias as name
Modified: branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java
===================================================================
--- branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java 2011-02-01 16:06:59 UTC (rev 28830)
+++ branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java 2011-02-01 16:15:06 UTC (rev 28831)
@@ -15,7 +15,6 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
@@ -29,7 +28,6 @@
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.model.SystemStartHere;
import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PartInitException;
@@ -66,7 +64,7 @@
public static String createConnectionName(DeltaCloudInstance instance) {
Assert.isLegal(instance != null, "Cannot create connection name: instance is not defined");
- return instance.getName() + " [" + instance.getId() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+ return instance.getAlias();
}
public static String createHostName(DeltaCloudInstance instance) {
Modified: branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java
===================================================================
--- branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java 2011-02-01 16:06:59 UTC (rev 28830)
+++ branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java 2011-02-01 16:15:06 UTC (rev 28831)
@@ -218,7 +218,7 @@
String rtId = data[1];
IRuntime runtime = ServerCore.findRuntime(rtId);
IServer newServer = null;
- newServer = ServerCreationUtils.createServer2(imageId, runtime);
+ newServer = ServerCreationUtils.createServer2(instance.getAlias(), runtime);
newServer = RSEUtils.setServerToRSEMode(newServer, host, home, config);
return newServer;
}
@@ -270,7 +270,7 @@
String config = data[1];
String rtId = data[2];
IRuntime runtime = ServerCore.findRuntime(rtId);
- IServer newServer = ServerCreationUtils.createServer2(imageId, runtime);
+ IServer newServer = ServerCreationUtils.createServer2(instance.getAlias(), runtime);
newServer = RSEUtils.setServerToRSEMode(newServer, host, home, config);
return newServer;
}
13 years, 10 months
JBoss Tools SVN: r28830 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-01 11:06:59 -0500 (Tue, 01 Feb 2011)
New Revision: 28830
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/ChangeLog
Log:
[JBIDE-8291] Server adapter is not created by default any more
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/ChangeLog 2011-02-01 16:02:24 UTC (rev 28829)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/ChangeLog 2011-02-01 16:06:59 UTC (rev 28830)
@@ -1,5 +1,10 @@
2011-02-01 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+ * src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java
+ (CREATE_RSE_PREF_KEY):
+ (CREATE_SERVER_PREF_KEY):
+ (createControl):
+ [JBIDE-8291] Server adapter is not created by default any more
* src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java
(createServerCheckRemoteDetails):
(createServerSetDetailsNow):
13 years, 10 months
JBoss Tools SVN: r28829 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration: src/org/jboss/tools/deltacloud/integration/rse/util and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-01 11:02:24 -0500 (Tue, 01 Feb 2011)
New Revision: 28829
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java
Log:
[JBIDE-8292] Server Adapter and RSE now use instance alias as name
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/ChangeLog 2011-02-01 15:46:25 UTC (rev 28828)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/ChangeLog 2011-02-01 16:02:24 UTC (rev 28829)
@@ -1,3 +1,11 @@
+2011-02-01 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java
+ (createServerCheckRemoteDetails):
+ (createServerSetDetailsNow):
+ * src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java (createConnectionName):
+ [JBIDE-8292] Server Adapter and RSE now use instance alias as name
+
2010-12-27 adietisheim <adietisheim@adietisheim-thinkpad>
* META-INF/MANIFEST.MF:
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java 2011-02-01 15:46:25 UTC (rev 28828)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java 2011-02-01 16:02:24 UTC (rev 28829)
@@ -15,7 +15,6 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
@@ -29,7 +28,6 @@
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.model.SystemStartHere;
import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PartInitException;
@@ -66,7 +64,7 @@
public static String createConnectionName(DeltaCloudInstance instance) {
Assert.isLegal(instance != null, "Cannot create connection name: instance is not defined");
- return instance.getName() + " [" + instance.getId() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+ return instance.getAlias();
}
public static String createHostName(DeltaCloudInstance instance) {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java 2011-02-01 15:46:25 UTC (rev 28828)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java 2011-02-01 16:02:24 UTC (rev 28829)
@@ -219,7 +219,7 @@
String rtId = data[1];
IRuntime runtime = ServerCore.findRuntime(rtId);
IServer newServer = null;
- newServer = ServerCreationUtils.createServer2(imageId, runtime);
+ newServer = ServerCreationUtils.createServer2(instance.getAlias(), runtime);
newServer = RSEUtils.setServerToRSEMode(newServer, host, home, config);
return newServer;
}
@@ -271,7 +271,7 @@
String config = data[1];
String rtId = data[2];
IRuntime runtime = ServerCore.findRuntime(rtId);
- IServer newServer = ServerCreationUtils.createServer2(imageId, runtime);
+ IServer newServer = ServerCreationUtils.createServer2(instance.getAlias(), runtime);
newServer = RSEUtils.setServerToRSEMode(newServer, host, home, config);
return newServer;
}
13 years, 10 months
JBoss Tools SVN: r28828 - in trunk/vpe/plugins: org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-02-01 10:46:25 -0500 (Tue, 01 Feb 2011)
New Revision: 28828
Removed:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualCaretInfo.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
Log:
https://jira.jboss.org/browse/JBIDE-8115 : Support for multiple selection in visual part.
- removed some unreferenced methods and classes related to VPE selection
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2011-02-01 15:26:27 UTC (rev 28827)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2011-02-01 15:46:25 UTC (rev 28828)
@@ -1,1074 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.editor;
-
-import static org.jboss.tools.vpe.xulrunner.util.XPCOM.queryInterface;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.xml.core.internal.document.CommentImpl;
-import org.jboss.tools.vpe.VpeDebug;
-import org.jboss.tools.vpe.VpePlugin;
-import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
-import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
-import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
-import org.jboss.tools.vpe.editor.selection.VpeSelectionController;
-import org.jboss.tools.vpe.editor.template.VpePseudoContentCreator;
-import org.jboss.tools.vpe.editor.util.HTML;
-import org.jboss.tools.vpe.editor.util.TextUtil;
-import org.jboss.tools.vpe.editor.util.VisualDomUtil;
-import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
-import org.mozilla.interfaces.nsIDOMElement;
-import org.mozilla.interfaces.nsIDOMEvent;
-import org.mozilla.interfaces.nsIDOMMouseEvent;
-import org.mozilla.interfaces.nsIDOMNSUIEvent;
-import org.mozilla.interfaces.nsIDOMNode;
-import org.mozilla.interfaces.nsIDOMNodeList;
-import org.mozilla.interfaces.nsIDOMRange;
-import org.mozilla.interfaces.nsISelection;
-import org.mozilla.interfaces.nsISelectionController;
-import org.mozilla.interfaces.nsISelectionDisplay;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- *
- * @deprecated
- *
- */
-public class VpeSelectionBuilder {
- private static int HUGE_DISTANCE = 999999;
- private VpeDomMapping domMapping;
- private VpeSourceDomBuilder sourceBuilder;
- private VpeVisualDomBuilder visualBuilder;
- // TODO Sergey Vasilyev figure out with press shell and selection controller
-// private nsIPresShell presShell;
- private VpeSelectionController visualSelectionController;
-
- VpeSelectionBuilder(VpeDomMapping domMapping, VpeSourceDomBuilder sourceBuilder, VpeVisualDomBuilder visualBuilder, VpeSelectionController visualSelectionController) {
-// VpeSelectionBuilder(VpeDomMapping domMapping, VpeSourceDomBuilder sourceBuilder, VpeVisualDomBuilder visualBuilder, nsIPresShell presShell, nsISelectionController visualSelectionController) {
- this.domMapping = domMapping;
- this.sourceBuilder = sourceBuilder;
- this.visualBuilder = visualBuilder;
- // TODO Sergey Vasilyev figure out with selection controller and press shell
-// this.presShell = presShell;
- this.visualSelectionController = visualSelectionController;
- visualSelectionController.setSelectionFlags(nsISelectionDisplay.DISPLAY_ALL);
- }
-
- void setVisualSelection(Node sourceNode, int caretPosition) {
- setSelection(sourceNode, caretPosition, false);
- }
-
- public void setSelection(nsISelection selection) {
-
-// VpeTemplate vpeTemplate = SelectionUtil
-// .getTemplateByVisualSelection(visualBuilder.getPageContext(),
-// SelectionUtil.getSelectedNode(selection));
-// if (vpeTemplate instanceof ITemplateSelectionManager) {
-// ((ITemplateSelectionManager) vpeTemplate).setSelection(
-// visualBuilder.getPageContext(), selection);
-// return;
-// }
-
- if (selection.getIsCollapsed()) {
- VisualSelectionInfo info = getVisualFocusSelectedInfo(selection);
- if (info != null) {
- nsIDOMNode visualNode = info.node;
- Node node = domMapping.getSourceNode(visualNode);
- Node sourceNode;
- if (node == null) {
- sourceNode = domMapping.getNearSourceNode(visualNode);
- } else {
- sourceNode = node;
- }
- nsIDOMNode visualSelectedNode = domMapping.getVisualNode(sourceNode);
- if (visualSelectedNode == null) {
- visualSelectedNode = visualNode;
- }
- if (VpeDebug.PRINT_VISUAL_SELECTION_EVENT) {
- System.out.println(" visualNode: " + visualSelectedNode.getNodeName() + "(" + visualSelectedNode + ") sourceNode: " + (sourceNode == null ? null : sourceNode.getNodeName()) + " node: " + node); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- if (sourceNode != null) {
- switch (visualSelectedNode.getNodeType()) {
- case nsIDOMNode.TEXT_NODE:
- nsIDOMElement visualParentElement = queryInterface(visualSelectedNode.getParentNode(), nsIDOMElement.class);
- visualBuilder.setSelectionRectangle(visualParentElement, false);
-// int pos = DataHelper.textPos(visualSelectedNode.getNodeValue(), selection.getFocusOffset());
- int pos = selection.getFocusOffset();
-
- try{
- IndexedRegion region = (IndexedRegion)sourceNode;
- String text = sourceBuilder.getStructuredTextViewer().getDocument().get(region.getStartOffset(), region.getEndOffset()-region.getStartOffset());
- pos = TextUtil.sourcePosition(text, visualSelectedNode.getNodeValue(), selection.getFocusOffset());
- }catch(BadLocationException ex){
- VpePlugin.reportProblem(ex);
- }
- sourceBuilder.setSelection(sourceNode, pos, 0);
- break;
- case nsIDOMNode.ELEMENT_NODE:
- if (VpeVisualDomBuilder.isIncludeElement(queryInterface(visualSelectedNode, nsIDOMElement.class))) {
- visualBuilder.setSelectionRectangle(queryInterface(visualSelectedNode, nsIDOMElement.class), false);
- visualSelectionController.setCaretEnabled(false);
- sourceBuilder.setSelection(sourceNode, 0, 0);
- } else if (sourceNode.getNodeType() == Node.COMMENT_NODE) {
- visualBuilder.setSelectionRectangle(queryInterface(visualSelectedNode, nsIDOMElement.class), false);
-// pos = DataHelper.textPos(visualNode.getNodeValue(), selection.getFocusOffset());
- pos = selection.getFocusOffset();
- try{
- IndexedRegion region = (IndexedRegion)sourceNode;
- String text = sourceBuilder.getStructuredTextViewer().getDocument().get(region.getStartOffset(), region.getEndOffset()-region.getStartOffset());
- pos = TextUtil.sourcePosition(text, visualSelectedNode.getNodeValue(), selection.getFocusOffset());
- }catch(BadLocationException ex){
- VpePlugin.reportProblem(ex);
- }
- sourceBuilder.setSelection(sourceNode, pos, 0);
- } else if (visualBuilder.isContentArea(visualSelectedNode) && visualBuilder.isEmptyDocument()) {
- visualBuilder.setSelectionRectangle(queryInterface(visualSelectedNode, nsIDOMElement.class), false);
- sourceBuilder.setSelectionAtDocumentEnd();
- } else {
- nsIDOMNode containerForPseudoContent = VpePseudoContentCreator.getContainerForPseudoContent(visualNode);
- if (containerForPseudoContent != null) {
- sourceNode = domMapping.getNearSourceNode(containerForPseudoContent);
- visualBuilder.setSelectionRectangle(queryInterface(containerForPseudoContent, nsIDOMElement.class), false);
- sourceBuilder.setSelection(sourceNode, 0, 0, true);
- visualSelectionController.setCaretEnabled(false);
- } else {
- boolean border = false;
- if(domMapping.getNodeMapping(visualSelectedNode) instanceof VpeElementMapping){
- VpeElementMapping element = (VpeElementMapping)domMapping.getNodeMapping(visualSelectedNode);
- if(element.isBorder(visualNode)){
- info.startFlag = true;
- border = true;
- }
- }
-
- if (!border && visualNode.getNodeType() == Node.TEXT_NODE && node == null) {
- visualBuilder.setSelectionRectangle(queryInterface(visualSelectedNode, nsIDOMElement.class), false);
- sourceBuilder.setAttributeSelection(visualNode, selection.getFocusOffset(), 0);
- if (!visualBuilder.isTextEditable(visualNode)) {
- visualSelectionController.setCaretEnabled(false);
- }
- } else {
- if (info.startFlag) {
- visualBuilder.setSelectionRectangle(queryInterface(visualSelectedNode, nsIDOMElement.class), false);
- } else {
- visualParentElement = queryInterface(visualSelectedNode.getParentNode(), nsIDOMElement.class);
- visualBuilder.setSelectionRectangle(visualParentElement, false);
- }
- int offset = info.startFlag ? 0 : ((IndexedRegion)sourceNode).getEndOffset() -
- ((IndexedRegion)sourceNode).getStartOffset();
- if (info.startFlag && info.isPseudoElement()) {
- sourceBuilder.setSelection(sourceNode, 0, 0, true);
- } else {
- sourceBuilder.setSelection(sourceNode, offset, 0);
- }
- }
- }
- }
- break;
- }
- }
- }
- } else {
- nsIDOMRange range = selection.getRangeAt(0);
- nsIDOMNode visualAncestor = range.getCommonAncestorContainer();
-
- Node sourceAncestor = domMapping.getNearSourceNode(visualAncestor);
- nsIDOMNode visualSelectedAncestor = domMapping.getVisualNode(sourceAncestor);
-
- if (visualSelectedAncestor == null) {
- visualSelectedAncestor = visualAncestor;
- }
-
- boolean border = false;
- VpeNodeMapping nodeMapping = domMapping.getNodeMapping(visualSelectedAncestor);
-
- if (visualSelectedAncestor.getNodeType() == Node.ELEMENT_NODE){
- if (nodeMapping != null && (nodeMapping instanceof VpeElementMapping) && ((VpeElementMapping)nodeMapping).isBorder(visualAncestor)){
- visualSelectedAncestor = ((VpeElementMapping)nodeMapping).getBorder();
- border = true;
- }
- }
-
- if (sourceAncestor != null) {
- switch (visualSelectedAncestor.getNodeType()) {
- case Node.TEXT_NODE:
- nsIDOMElement visualParentElement = queryInterface(visualSelectedAncestor.getParentNode(), nsIDOMElement.class);
- visualBuilder.setSelectionRectangle(visualParentElement, false);
-
-// int start = DataHelper.textPos(visualSelectedAncestor.getNodeValue(), selection.getAnchorOffset());
-// int end = DataHelper.textPos(visualSelectedAncestor.getNodeValue(), selection.getFocusOffset());
- int start = selection.getAnchorOffset();
- int end = selection.getFocusOffset();
- try{
- IndexedRegion region = (IndexedRegion)sourceAncestor;
- String text = sourceBuilder.getStructuredTextViewer().getDocument().get(region.getStartOffset(), region.getEndOffset()-region.getStartOffset());
- start = TextUtil.sourcePosition(text, visualSelectedAncestor.getNodeValue(), selection.getAnchorOffset());
- end = TextUtil.sourcePosition(text, visualSelectedAncestor.getNodeValue(), selection.getFocusOffset());
- }catch(BadLocationException ex){
- VpePlugin.reportProblem(ex);
- }
-
- sourceBuilder.setSelection(sourceAncestor, start, end - start);
- break;
- case Node.ELEMENT_NODE:
- if (sourceAncestor.getNodeType() == Node.COMMENT_NODE) {
- visualBuilder.setSelectionRectangle(queryInterface(visualSelectedAncestor, nsIDOMElement.class), false);
-// start = DataHelper.textPos(sourceAncestor.getNodeValue(), selection.getAnchorOffset());
-// end = DataHelper.textPos(sourceAncestor.getNodeValue(), selection.getFocusOffset());
- start = selection.getAnchorOffset();
- end = selection.getFocusOffset();
- try{
- IndexedRegion region = (IndexedRegion)sourceAncestor;
- String text = sourceBuilder.getStructuredTextViewer().getDocument().get(region.getStartOffset(), region.getEndOffset()-region.getStartOffset());
- start = TextUtil.sourcePosition(text, sourceAncestor.getNodeValue(), selection.getAnchorOffset());
- end = TextUtil.sourcePosition(text, sourceAncestor.getNodeValue(), selection.getFocusOffset());
- }catch(BadLocationException ex){
- VpePlugin.reportProblem(ex);
- }
- sourceBuilder.setSelection(sourceAncestor, start, end - start);
- } else {
- nsIDOMNode visualAnchorNode = selection.getAnchorNode();
- int visualAnchorOffset = selection.getAnchorOffset();
- nsIDOMNode visualFocusNode = selection.getFocusNode();
-
- int visualFocusOffset = selection.getFocusOffset();
- if (visualFocusNode.equals(visualAnchorNode) && visualFocusOffset - visualAnchorOffset == 1 && visualFocusNode.getNodeType() == Node.ELEMENT_NODE) {
- VisualSelectionInfo info = getVisualSelectedInfo(visualAnchorNode, visualAnchorOffset);
- if (info != null) {
- nsIDOMNode visualNode = info.node;
- visualBuilder.setSelectionRectangle(queryInterface(visualNode, nsIDOMElement.class), false);
- Node sourceNode = domMapping.getNearSourceNode(visualNode);
- int sourceStartOffset = ((IndexedRegion)sourceNode).getStartOffset();
- int sourceEndOffset = ((IndexedRegion)sourceNode).getEndOffset();
- sourceBuilder.setSelection(sourceNode, 0, sourceEndOffset - sourceStartOffset);
- }
- } else {
- visualBuilder.setSelectionRectangle(queryInterface(visualSelectedAncestor, nsIDOMElement.class), false);
-
- if (!border && visualAncestor.getNodeType() == Node.TEXT_NODE) {
- sourceBuilder.setAttributeSelection(visualAncestor, visualAnchorOffset, visualFocusOffset - visualAnchorOffset);
- } else {
- int sourceAncestorOffset = ((IndexedRegion)sourceAncestor).getStartOffset();
- int sourceAnchorOffset = getSourceOffset(visualAnchorNode, visualAnchorOffset);
- int sourceFocusOffset = getSourceOffset(visualFocusNode, visualFocusOffset);
- sourceBuilder.setSelection(sourceAncestor, sourceAnchorOffset - sourceAncestorOffset, sourceFocusOffset - sourceAnchorOffset);
- }
- }
- }
- break;
- }
- }
- }
- }
-
- private int getSourceOffset(nsIDOMNode visualPrmNode, int visualPrmOffset) {
- VisualSelectionInfo info = getVisualSelectedInfo(visualPrmNode, visualPrmOffset);
- if (info != null) {
- nsIDOMNode visualNode = info.node;
- Node sourceNode = domMapping.getNearSourceNode(visualNode);
- if (sourceNode != null) {
- switch (sourceNode.getNodeType()) {
- case Node.TEXT_NODE:
- try{
- IndexedRegion region = (IndexedRegion)sourceNode;
- int start = region.getStartOffset();
- String sourceText = sourceBuilder.getStructuredTextViewer().getDocument().get(start, region.getEndOffset() - start);
- if (visualPrmNode.getNodeType() == Node.TEXT_NODE) {
- return start + TextUtil.sourcePosition(sourceText, visualNode.getNodeValue(), visualPrmOffset);
- } else if (info.startFlag) {
- return start;
- } else {
- String visualValue = visualNode.getNodeValue();
- return start + TextUtil.sourcePosition(sourceText, visualValue, visualValue.length());
- }
- } catch(BadLocationException ex){
- VpePlugin.reportProblem(ex);
- return 0;
- }
- case Node.ELEMENT_NODE:
- return info.startFlag ? ((IndexedRegion)sourceNode).getStartOffset() : ((IndexedRegion)sourceNode).getEndOffset();
- case Node.COMMENT_NODE:
- return ((IndexedRegion)sourceNode).getStartOffset() + visualPrmOffset + 4;
- }
- }
- }
- return 0;
- }
-
- void setClickSelection(nsIDOMNode visualNode) {
- Node sourceNode = domMapping.getNearSourceNode(visualNode);
- nsIDOMNode visualSelectedNode = domMapping.getVisualNode(sourceNode);
- if (visualSelectedNode == null) {
- visualSelectedNode = visualNode;
- }
- setVisualSelectionAtVisualNode(visualSelectedNode, 0);
- sourceBuilder.setSelection(sourceNode, 0, 0);
- }
-
- void _setClickContentAreaSelection() {
- Node sourceNode = sourceBuilder.getSelectedNode();
- if (sourceNode != null) {
- int caretPosition = sourceBuilder.getCaretPosition();
- setSelection(sourceNode, caretPosition, true);
- }
- }
-
- void setClickContentAreaSelection() {
- nsISelection selection = visualSelectionController.getSelection(nsISelectionController.SELECTION_NORMAL);
- setSelection(selection);
- }
-
- void setClickContentAreaSelection(nsIDOMMouseEvent mouseEvent) {
-// Node visualNode = mouseEvent.getTargetNode();
-// nsISelection selection = visualSelectionController.getSelection(nsISelectionController.SELECTION_NORMAL);
-// Node anchorNode = selection.getAnchorNode();
-// Node focusNode = selection.getFocusNode();
- }
-
- Node setContextMenuSelection(nsIDOMNode visualNode) {
- if (VpeDebug.PRINT_VISUAL_CONTEXTMENU_EVENT) {
- System.out.println(">>>>>>>>>>>>>> onShowContextMenu visualNode: " + visualNode.getNodeName() + "(" + visualNode + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- visualSelectionController.setCaretEnabled(false);
-
- nsIDOMNode visualParentNode = visualNode.getParentNode();
- if (visualParentNode.getNodeType() == Node.DOCUMENT_NODE) {
- visualNode = visualBuilder.getContentArea();
- }
- Node selectedText = getSelectedTextOnly(visualNode);
- if (selectedText != null) {
- return selectedText;
- } else {
- return setContextMenuElementSelection(visualNode);
- }
- }
-
- private Node setContextMenuElementSelection(nsIDOMNode visualNode) {
- Node sourceNode = domMapping.getNearSourceNode(visualNode);
- nsIDOMNode visualSelectedNode = domMapping.getVisualNode(sourceNode);
- if (visualSelectedNode == null) {
- visualSelectedNode = visualNode;
- }
- setVisualSelectionAtVisualNode(visualSelectedNode, 0);
- //added by Max Areshkau in scope of JBIDE-1209
- if(sourceNode.getNodeType()!=Node.TEXT_NODE) {
- sourceBuilder.setSelection(sourceNode, 0, 0);
- } else if(sourceNode.getNodeType()==Node.TEXT_NODE) {
- IndexedRegion region = (IndexedRegion)sourceNode;
- sourceBuilder.setSelection(sourceNode, 0, region.getLength());
- }
- return sourceNode;
- }
-
- private Node getSelectedTextOnly(nsIDOMNode element) {
- Node selectedText = null;
- nsISelection selection = visualSelectionController.getSelection(nsISelectionController.SELECTION_NORMAL);
- if (!selection.getIsCollapsed()) {
- nsIDOMNode anchorNode = selection.getAnchorNode();
- nsIDOMNode focusNode = selection.getFocusNode();
- if (anchorNode != null && anchorNode.getNodeType() == Node.TEXT_NODE && anchorNode.equals(focusNode)) {
- nsIDOMNode anchorParent = anchorNode.getParentNode();
- if (anchorParent != null) {
- if (anchorParent.equals(element)) {
- selectedText = domMapping.getSourceNode(anchorNode);
- }
- }
- }
- }
- return selectedText;
- }
-
- private void setVisualSelectionAtVisualNode(nsIDOMNode visualNode, int offset) {
- nsISelection selection = visualSelectionController.getSelection(nsISelectionController.SELECTION_NORMAL);
- if (visualNode != null) {
- switch (visualNode.getNodeType()) {
- case nsIDOMNode.TEXT_NODE:
- if (offset > visualNode.getNodeValue().length()) {
- offset = visualNode.getNodeValue().length();
- }
- selection.collapse(visualNode, offset);
- nsIDOMElement visualParentElement = queryInterface(visualNode.getParentNode(), nsIDOMElement.class);
- visualBuilder.setSelectionRectangle(visualParentElement);
- break;
- case nsIDOMNode.ELEMENT_NODE:
- Node node = domMapping.getSourceNode(visualNode);
- if (node != null && node.getNodeType() == Node.COMMENT_NODE) {
- nsIDOMNodeList visualNodes = visualNode.getChildNodes();
- long len = visualNodes.getLength();
- if (len > 0) {
- nsIDOMNode visualText = visualNodes.item(0);
- String text = visualText.getNodeValue();
- if (offset > text.length()) {
- offset = text.length();
- }
- selection.collapse(visualText, offset);
- visualBuilder.setSelectionRectangle(queryInterface(visualNode, nsIDOMElement.class));
- }
- } else {
- if (offset == 0) {
- offset = (int)VisualDomUtil.getOffset(visualNode);
- nsIDOMNode visualParentNode = visualNode.getParentNode();
- if (visualParentNode != null && visualParentNode.getNodeType() == Node.ELEMENT_NODE) {
- selection.collapse(visualParentNode, offset);
- visualBuilder.setSelectionRectangle(queryInterface(visualNode, nsIDOMElement.class));
- } else {
- selection.removeAllRanges();
- visualBuilder.setSelectionRectangle(null);
- }
- } else if (offset == 1) {
- nsIDOMNode appreciableVisualChild = VpeVisualDomBuilder.getLastAppreciableVisualChild(visualNode);
- if (appreciableVisualChild != null) {
- if (appreciableVisualChild.getNodeType() == nsIDOMNode.TEXT_NODE) {
- offset = appreciableVisualChild.getNodeValue().length();
- selection.collapse(appreciableVisualChild, offset);
- visualBuilder.setSelectionRectangle(queryInterface(visualNode, nsIDOMElement.class));
- } else {
- offset = (int)VisualDomUtil.getOffset(appreciableVisualChild) + 1;
- selection.collapse((nsIDOMNode)visualNode, offset);
- visualBuilder.setSelectionRectangle(queryInterface(visualNode, nsIDOMElement.class));
- }
- } else {
- offset = 0;
- selection.collapse(visualNode, offset);
- visualBuilder.setSelectionRectangle(queryInterface(visualNode, nsIDOMElement.class));
- }
- } else {
- offset = (int)VisualDomUtil.getOffset(visualNode);
- nsIDOMNode visualParentNode = visualNode.getParentNode();
- if (visualParentNode.getNodeType() == nsIDOMNode.ELEMENT_NODE) {
- selection.collapse(visualParentNode, offset);
- visualBuilder.setSelectionRectangle(queryInterface(visualParentNode, nsIDOMElement.class));
- } else {
- selection.removeAllRanges();
- visualBuilder.setSelectionRectangle(null);
- }
- }
- }
- break;
- default:
- selection.removeAllRanges();
- visualBuilder.setSelectionRectangle(null);
- }
- } else {
- selection.removeAllRanges();
- visualBuilder.setSelectionRectangle(null);
- }
- }
-
- private VisualSelectionInfo getVisualFocusSelectedInfo(nsISelection selection) {
- nsIDOMNode focusNode = selection.getFocusNode();
- if (focusNode != null && focusNode.getNodeType() == Node.TEXT_NODE) {
- nsIDOMNode parent = focusNode.getParentNode();
- if (parent == null) {
- return null;
- }
- }
- VisualSelectionInfo info = getVisualSelectedInfo(focusNode, selection.getFocusOffset());
- return info;
- }
-
- private VisualSelectionInfo getVisualSelectedInfo(nsIDOMNode visualNode, int visualOffset) {
- if (visualNode != null) {
- switch (visualNode.getNodeType()) {
- case nsIDOMNode.TEXT_NODE:
- return new VisualSelectionInfo(visualNode);
- case nsIDOMNode.ELEMENT_NODE:
- nsIDOMNodeList visualNodes = visualNode.getChildNodes();
- nsIDOMNode visualChild;
- boolean startFlag = true;
- long len = visualNodes.getLength();
- if (visualOffset < len) {
- visualChild = visualNodes.item(visualOffset);
- if (visualOffset > 0 && visualChild != null && visualChild.getNodeType() == Node.TEXT_NODE) {
- nsIDOMNode visualPrevChild = visualNodes.item(visualOffset - 1);
- if (visualPrevChild != null && visualPrevChild.getNodeType() != Node.TEXT_NODE) {
- visualChild = visualPrevChild;
- startFlag = false;
- }
- }
- } else if (len > 0) {
- visualChild = visualNodes.item(len - 1);
- startFlag = false;
- } else {
- visualChild = visualNode;
- }
- return new VisualSelectionInfo(visualChild, startFlag);
- }
- }
- return null;
- }
-
- private void setSelection(Node sourceNode, int caretPosition, boolean showCaret) {
- nsIDOMNode visualNode = domMapping.getNearVisualNode(sourceNode);
- int startOffset = ((IndexedRegion)sourceNode).getStartOffset();
- int endOffset = ((IndexedRegion)sourceNode).getEndOffset();
- if (caretPosition >= startOffset && caretPosition <= endOffset) {
- int offset = caretPosition - ((IndexedRegion)sourceNode).getStartOffset();
- if (sourceNode.getNodeType() == Node.TEXT_NODE && offset > sourceNode.getNodeValue().length()) {
- offset = sourceNode.getNodeValue().length();
- }
- if (!showCaret) {
- visualSelectionController.setCaretEnabled(false);
- }
- setVisualSelectionAtVisualNode(visualNode, offset);
- }
- }
-
- public void setVisualSelection(Node sourceAnchorNode, int sourceAnchorOffset, Node sourceFocusNode, int sourceFocusOffset, boolean reversionFlag, boolean showCaret) {
- setVisualSelection(sourceAnchorNode, sourceAnchorOffset, sourceFocusNode, sourceFocusOffset, reversionFlag, showCaret, false);
- }
-
- public void setVisualSelection(Node sourceAnchorNode, int sourceAnchorOffset, Node sourceFocusNode, int sourceFocusOffset, boolean reversionFlag, boolean showCaret, boolean into) {
-// if (sourceAnchorNode.getNodeType() == Node.TEXT_NODE) {
-// sourceAnchorOffset = DataHelper.focusPos(sourceAnchorNode.getNodeValue(), sourceAnchorOffset);
-// }
-// if (sourceFocusNode.getNodeType() == Node.TEXT_NODE) {
-// sourceFocusOffset = DataHelper.focusPos(sourceFocusNode.getNodeValue(), sourceFocusOffset);
-// }
- if (!showCaret) {
- visualSelectionController.setCaretEnabled(false);
- }
- nsISelection selection = visualSelectionController.getSelection(nsISelectionController.SELECTION_NORMAL);
- if (sourceAnchorNode == null || sourceFocusNode == null) {
- selection.removeAllRanges();
- visualBuilder.setSelectionRectangle(null);
- } else if (sourceAnchorNode == sourceFocusNode && sourceAnchorOffset == sourceFocusOffset) {
- nsIDOMNode visualNode = domMapping.getNearVisualNode(sourceAnchorNode);
- if (visualNode != null) {
- if (sourceAnchorNode.getNodeType() == Node.TEXT_NODE) {
- if (visualNode.getNodeType() != Node.TEXT_NODE) {
- sourceAnchorOffset = 1;
- } else if (sourceAnchorOffset > sourceAnchorNode.getNodeValue().length()) {
- sourceAnchorOffset = sourceAnchorNode.getNodeValue().length();
- }
- }
- if (into && visualNode != null && visualNode.getChildNodes().getLength() == 1) {
- nsIDOMNode br = VisualDomUtil.getChildNode(visualNode, 0);
- if (HTML.TAG_BR.equalsIgnoreCase(br.getNodeName())) {
- visualNode = VisualDomUtil.getChildNode(visualNode, 0);
- sourceAnchorOffset = 2;
- }
- }
- } else if (sourceAnchorNode.getNodeType() == Node.ATTRIBUTE_NODE) {
- visualNode = visualBuilder.getOutputTextNode((Attr)sourceAnchorNode);
- if (visualNode != null) {
- if (!visualBuilder.isTextEditable(visualNode)) {
- sourceAnchorOffset = 0;
- }
- } else {
- visualNode = domMapping.getNearVisualNode(((Attr)sourceAnchorNode).getOwnerElement());
- sourceAnchorOffset = 0;
- }
- }
- // comment selection was changed
- if(sourceAnchorNode instanceof CommentImpl){
- sourceAnchorOffset=0;
- }
- setVisualSelectionAtVisualNode(visualNode, sourceAnchorOffset);
- } else {
- nsIDOMNode visualAnchorNode = null;
- nsIDOMNode visualFocusNode = null;
- boolean anchorStartFlag = false;
- boolean focusStartFlag = false;
- boolean anchorDirectFlag = true;
- boolean focusDirectFlag = true;
-
- if (!reversionFlag) {
- VisualSelectionInfo anchorInfo = getStartSelectionInfo(sourceAnchorNode, sourceAnchorOffset == 0);
- if (anchorInfo != null) {
- visualAnchorNode = anchorInfo.node;
- anchorStartFlag = anchorInfo.startFlag;
- anchorDirectFlag = anchorInfo.directFlag;
- }
- VisualSelectionInfo focusInfo = getEndSelectionInfo(sourceFocusNode, sourceFocusOffset == 0);
- if (focusInfo != null) {
- visualFocusNode = focusInfo.node;
- focusStartFlag = focusInfo.startFlag;
- focusDirectFlag = focusInfo.directFlag;
- }
- } else {
- VisualSelectionInfo anchorInfo = getEndSelectionInfo(sourceAnchorNode, sourceAnchorOffset == 0);
- if (anchorInfo != null) {
- visualAnchorNode = anchorInfo.node;
- anchorStartFlag = anchorInfo.startFlag;
- anchorDirectFlag = anchorInfo.directFlag;
- }
- VisualSelectionInfo focusInfo = getStartSelectionInfo(sourceFocusNode, sourceFocusOffset == 0);
- if (focusInfo != null) {
- visualFocusNode = focusInfo.node;
- focusStartFlag = focusInfo.startFlag;
- focusDirectFlag = focusInfo.directFlag;
- }
- }
-
- if (visualAnchorNode == null || visualFocusNode == null) {
- selection.removeAllRanges();
- visualBuilder.setSelectionRectangle(null);
- return;
- }
-
- nsIDOMNode visualAnchorContainer = null;
- long visualAnchorOffset = 0;
- if (visualAnchorNode.getNodeType() == Node.TEXT_NODE) {
- visualAnchorContainer = visualAnchorNode;
- if (anchorDirectFlag && sourceAnchorNode.getNodeType() == Node.TEXT_NODE) {
- if (sourceAnchorOffset > sourceAnchorNode.getNodeValue().length()) {
- visualAnchorOffset = sourceAnchorNode.getNodeValue().length();
- } else {
- visualAnchorOffset = sourceAnchorOffset;
- }
- if (visualAnchorOffset > visualAnchorNode.getNodeValue().length()) {
- visualAnchorOffset = visualAnchorNode.getNodeValue().length();
- }
- } else {
- if (anchorStartFlag) {
- visualAnchorOffset = 0;
- } else {
- visualAnchorOffset = visualAnchorNode.getNodeValue().length();
- }
- }
- } else if (sourceAnchorNode.getNodeType() == Node.COMMENT_NODE) {
- nsIDOMNodeList visualNodes = visualAnchorNode.getChildNodes();
- long len = visualNodes.getLength();
- if (len > 0) {
- visualAnchorContainer = visualNodes.item(0);
- String text = visualAnchorContainer.getNodeValue();
- if (text!=null&& sourceAnchorOffset <= text.length()) {
- visualAnchorOffset = sourceAnchorOffset;
- } else if (text!=null) {
- visualAnchorOffset = text.length();
- }
- }
- } else {
- visualAnchorContainer = visualAnchorNode.getParentNode();
- visualAnchorOffset = VisualDomUtil.getOffset(visualAnchorNode);
- if (!anchorStartFlag) visualAnchorOffset++;
- }
- if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
- System.out.println("setVisualSelection"); //$NON-NLS-1$
- System.out.println(" visualAnchorNode: " + visualAnchorNode.getNodeName() + "(" + visualAnchorNode + ") visualAnchorContainer: " + visualAnchorContainer.getNodeName() + "(" + visualAnchorContainer + ") visualAnchorOffset: " + visualAnchorOffset + " anchorStartFlag: " + anchorStartFlag); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
- }
-
- nsIDOMNode visualFocusContainer = null;
- long visualFocusOffset = 0;
- if (visualFocusNode.getNodeType() == Node.TEXT_NODE) {
- visualFocusContainer = visualFocusNode;
- if (focusDirectFlag && sourceFocusNode.getNodeType() == Node.TEXT_NODE) {
- if (sourceFocusOffset > sourceFocusNode.getNodeValue().length()) {
- visualFocusOffset = sourceFocusNode.getNodeValue().length();
- } else {
- visualFocusOffset = sourceFocusOffset;
- }
- if (visualFocusOffset > visualFocusNode.getNodeValue().length()) {
- visualFocusOffset = visualFocusNode.getNodeValue().length();
- }
- } else {
- if (focusStartFlag) {
- visualFocusOffset = 0;
- } else {
- visualFocusOffset = visualFocusNode.getNodeValue().length();
- }
- }
- } else if (sourceFocusNode.getNodeType() == Node.COMMENT_NODE) {
- nsIDOMNodeList visualNodes = visualFocusNode.getChildNodes();
- long len = visualNodes.getLength();
- if (len > 0) {
- visualFocusContainer = visualNodes.item(0);
- String text = visualFocusContainer.getNodeValue();
- if (text!=null&&sourceFocusOffset <= text.length()) {
- visualFocusOffset = sourceFocusOffset;
- } else if(text!=null) {
- visualFocusOffset = text.length();
- }
- }
- } else {
- visualFocusContainer = visualFocusNode.getParentNode();
- visualFocusOffset = VisualDomUtil.getOffset(visualFocusNode);
- if (!focusStartFlag) visualFocusOffset++;
- }
- if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
- System.out.println(" visualFocusNode: " + //$NON-NLS-1$
- (visualFocusNode != null ?
- visualFocusNode.getNodeName() + "(" + visualFocusNode + ")" : null) + //$NON-NLS-1$ //$NON-NLS-2$
- " visualFocusContainer: " + //$NON-NLS-1$
- (visualFocusContainer != null ?
- visualFocusContainer.getNodeName() + "(" + visualFocusContainer + ") visualFocusOffset: " + visualFocusOffset + " focusStartFlag: " + focusStartFlag : null)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
-// Ed tmp
-if (visualAnchorContainer == null || visualFocusContainer == null) {
- return;
-}
-
- if (visualAnchorContainer.equals((visualFocusContainer)) && visualAnchorOffset == visualFocusOffset) {
- if (!reversionFlag) {
- setVisualSelectionAtVisualNode(visualFocusNode, 0);
- } else {
- setVisualSelectionAtVisualNode(visualAnchorNode, 0);
- }
- } else {
- selection.collapse(visualAnchorContainer, (int)visualAnchorOffset);
- selection.extend(visualFocusContainer, (int)visualFocusOffset);
- nsIDOMElement commonElement = getVisualCommonElement(visualAnchorNode, visualFocusNode);
- visualBuilder.setSelectionRectangle(commonElement);
- if (commonElement != null && !commonElement.equals(visualAnchorNode) && !commonElement.equals(visualFocusNode) &&
- !commonElement.equals(visualAnchorContainer) && !commonElement.equals(visualFocusContainer)) {
- }
- }
- }
- }
-
- private VisualSelectionInfo getStartSelectionInfo(Node sourceNode, boolean initialStartFlag) {
- boolean startFlag = initialStartFlag;
- nsIDOMNode visualNode = domMapping.getVisualNode(sourceNode);
- boolean directFlag = visualNode != null;
- while (sourceNode != null && visualNode == null) {
- Node sourcePrevNode = sourceNode.getPreviousSibling();
- if (sourcePrevNode != null) {
- sourceNode = sourcePrevNode;
- startFlag = false;
- } else {
- sourceNode = sourceNode.getParentNode();
- startFlag = true;
- }
- visualNode = domMapping.getVisualNode(sourceNode);
- }
- if (visualNode != null) {
- return new VisualSelectionInfo(visualNode, startFlag, directFlag);
- } else {
- return null;
- }
- }
-
- private VisualSelectionInfo getEndSelectionInfo(Node sourceNode, boolean initialStartFlag) {
- boolean startFlag = initialStartFlag;
- nsIDOMNode visualNode = domMapping.getVisualNode(sourceNode);
- boolean directFlag = visualNode != null;
- while (sourceNode != null && visualNode == null) {
- Node sourceNextNode = sourceNode.getNextSibling();
- if (sourceNextNode != null) {
- sourceNode = sourceNextNode;
- startFlag = true;
- } else {
- sourceNode = sourceNode.getParentNode();
- startFlag = false;
- }
- visualNode = domMapping.getVisualNode(sourceNode);
- }
- if (visualNode != null) {
- return new VisualSelectionInfo(visualNode, startFlag, directFlag);
- } else {
- return null;
- }
- }
-
- private nsIDOMElement getVisualCommonElement(nsIDOMNode nodeA, nsIDOMNode nodeB) {
- nsIDOMNode[] nodesA = getVisualPath(nodeA);
- nsIDOMNode[] nodesB = getVisualPath(nodeB);
- int len = Math.min(nodesA.length, nodesB.length);
- int index = len;
- for (int i = 0; i < len; i++) {
- if (!nodesA[i].equals(nodesB[i])) {
- index = i;
- break;
- }
- }
- if (index == -1) {
- index = len;
- }
-
- if (index > 0) {
- nsIDOMNode commonNode = nodesA[index - 1];
- if (commonNode.getNodeType() == Node.TEXT_NODE) {
- nsIDOMNode parent = commonNode.getParentNode();
- commonNode = parent;
- }
- return queryInterface(commonNode, nsIDOMElement.class);
- } else {
- return null;
- }
- }
-
- private nsIDOMNode[] getVisualPath(nsIDOMNode node) {
- return getVisualPath(node, 0);
- }
-
- private nsIDOMNode[] getVisualPath(nsIDOMNode node, int height) {
- height++;
- nsIDOMNode[] path;
- nsIDOMNode parent = node.getParentNode();
- if (parent != null) {
- path = getVisualPath(parent, height);
- } else {
- path = new nsIDOMNode[height];
- }
- path[path.length - height] = node;
- return path;
- }
-
- private static class VisualSelectionInfo {
- nsIDOMNode node;
- boolean startFlag;
- boolean directFlag;
-
- private VisualSelectionInfo(nsIDOMNode node) {
- this.node = node;
- }
-
- private VisualSelectionInfo(nsIDOMNode node, boolean startFlag) {
- this(node, startFlag, true);
- }
-
- private VisualSelectionInfo(nsIDOMNode node, boolean startFlag, boolean directFlag) {
- this(node);
- this.startFlag = startFlag;
- this.directFlag = directFlag;
- }
-
- private boolean isPseudoElement() {
- return VpeVisualDomBuilder.isPseudoElement(node);
- }
- }
-
- public VpeVisualCaretInfo getVisualCaretInfo(nsIDOMEvent event) {
- nsIDOMNSUIEvent nsuiEvent = queryInterface(event, nsIDOMNSUIEvent.class);
-
- return new VpeVisualCaretInfo(this, nsuiEvent.getRangeParent(), nsuiEvent.getRangeOffset());
- }
-
-//this method is never used
-// void showVisualDragCaret(nsIDOMNode node, int offset) {
-// visualBuilder.showDragCaret(node, offset);
-// }
-
-//this method is never used
-// void hideVisualDragCaret() {
-// visualBuilder.hideDragCaret();
-// }
-
- int getSourcePosition(nsIDOMNode visualInitNode, int visualInitOffset) {
- int position = 0;
- VisualSelectionInfo info = getVisualSelectedInfo(visualInitNode, visualInitOffset);
- if (info != null) {
- nsIDOMNode visualNode = info.node;
- Node sourceNode = domMapping.getNearSourceNode(visualNode);
- nsIDOMNode visualSelectedNode = domMapping.getVisualNode(sourceNode);
- if (visualSelectedNode == null) {
- visualSelectedNode = visualNode;
- }
- if (sourceNode != null) {
- switch (visualSelectedNode.getNodeType()) {
- case Node.TEXT_NODE:
- if (visualInitNode.getNodeType() != Node.TEXT_NODE) {
- visualInitOffset = info.startFlag ? 0 : visualSelectedNode.getNodeValue().length();
- }
-// int ofset = DataHelper.textPos(visualSelectedNode.getNodeValue(), visualInitOffset);
- int ofset = visualInitOffset;
- position = sourceBuilder.getPosition(sourceNode, ofset, false);
-
-
- try{
- IndexedRegion region = (IndexedRegion)sourceNode;
- int start = region.getStartOffset();
- String text = sourceBuilder.getStructuredTextViewer().getDocument().get(start, region.getEndOffset() - start);
- position = start + TextUtil.sourcePosition(text, visualSelectedNode.getNodeValue(), visualInitOffset);
- }catch(BadLocationException ex){
- VpePlugin.reportProblem(ex);
- }
-
-
-
- break;
- case Node.ELEMENT_NODE:
- int offset = info.startFlag ? 0 : ((IndexedRegion)sourceNode).getEndOffset() -
- ((IndexedRegion)sourceNode).getStartOffset();
- if (info.startFlag && info.isPseudoElement()) {
- position = sourceBuilder.getPosition(sourceNode, 0, true);
- } else {
- position = sourceBuilder.getPosition(sourceNode, offset, false);
- }
- break;
- }
- }
- }
- return position;
- }
-
- private Point getSourceSelectionRangeAtVisualNode(nsIDOMNode visualInitNode, int visualInitOffset) {
- if (visualInitNode.getNodeType() == Node.TEXT_NODE) {
- Node sourceNode = domMapping.getSourceNode(visualInitNode);
- if (sourceNode == null) {
- sourceNode = domMapping.getNearSourceNode(visualInitNode);
- if (sourceNode != null && sourceNode.getNodeType() == Node.ELEMENT_NODE) {
- Point outputAttributesPositions = sourceBuilder.getOutputAttributesPositions((Element)sourceNode);
- if (outputAttributesPositions != null) {
- return new Point(outputAttributesPositions.x, outputAttributesPositions.y - outputAttributesPositions.x);
- }
- }
- }
- }
- Point range = sourceBuilder.getSelectionRange();
- int pos = getSourcePosition(visualInitNode, visualInitOffset);
- if (pos >= range.x && pos <= range.x + range.y) {
- return range;
- } else {
- return new Point(pos, 0);
- }
- }
-
-
- void setVisualElementSelection(nsIDOMMouseEvent mouseEvent) {
- nsISelection selection = visualSelectionController.getSelection(nsISelectionController.SELECTION_NORMAL);
- nsIDOMNode visualNode = visualBuilder.getOriginalTargetNode(mouseEvent);
- if (selection.containsNode(visualNode, false) || VpeVisualDomBuilder.isAnonElement(visualNode)) {
- return;
- }
- if (!selection.containsNode((nsIDOMNode)visualNode, false)) {
- if (visualNode.getNodeType() == Node.ELEMENT_NODE && !VpeVisualDomBuilder.isAnonElement(visualNode)) {
- nsIDOMNode visualParent = visualNode.getParentNode();
- long offset = VisualDomUtil.getOffset(visualNode);
- selection.removeAllRanges();
- selection.collapse(visualParent, (int)offset);
- selection.extend(visualParent, (int)offset + 1);
- setSelection(selection);
- }
- }
-
- }
-
-//this method is never used
-// nsIDOMElement getDragElement(nsIDOMMouseEvent mouseEvent) {
-// nsIDOMElement dragElement = visualBuilder.getDragElement(mouseEvent);
-// if (dragElement != null) {
-// return dragElement;
-// }
-//
-// nsIDOMNode visualNode = VisualDomUtil.getTargetNode(mouseEvent);
-// //FIX FOR JBIDE-1468 added by Sergey Dzmitrovich
-// if (visualNode != null
-// && visualNode.getNodeType() == Node.ELEMENT_NODE
-// && (HTML.TAG_INPUT.equalsIgnoreCase(visualNode.getNodeName())
-// || HTML.TAG_OPTION.equalsIgnoreCase(visualNode
-// .getNodeName())
-// || HTML.TAG_BUTTON.equalsIgnoreCase(visualNode
-// .getNodeName()) || HTML.TAG_SELECT
-// .equalsIgnoreCase(visualNode.getNodeName()))
-// /*&& !selection.containsNode(visualNode, false)*/
-// && visualBuilder.canInnerDrag((nsIDOMElement) visualNode
-// .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID))) {
-// return (nsIDOMElement) visualNode
-// .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
-// }
-// return null;
-// }
-
- nsIDOMElement getAppropriateElementForSelection(nsIDOMEvent event) {
- nsISelection selection = visualSelectionController.getSelection(nsISelectionController.SELECTION_NORMAL);
- nsIDOMNode visualNode = VisualDomUtil.getTargetNode(event);
- if (visualNode != null) {
- if (!HTML.TAG_INPUT.equalsIgnoreCase(visualNode.getNodeName())) {
- visualNode = visualBuilder.getOriginalTargetNode(event);
- }
- if (visualNode != null && visualNode.getNodeType() == Node.ELEMENT_NODE && !selection.containsNode((nsIDOMNode)visualNode, false)) {
- VpeElementMapping elementMapping = domMapping.getNearElementMapping(visualNode);
- if (elementMapping != null) {
- return elementMapping.getVisualElement();
- }
- }
- }
- return null;
- }
-
- void setVisualElementSelection(nsIDOMElement visualElement) {
- nsISelection selection = visualSelectionController.getSelection(nsISelectionController.SELECTION_NORMAL);
- visualElement.removeAttribute(XulRunnerEditor.VPE_INVISIBLE_ELEMENT);
- nsIDOMNode visualParent = visualElement.getParentNode();
- int offset = (int) VisualDomUtil.getOffset(visualElement);
- selection.removeAllRanges();
- selection.collapse(visualParent, offset);
- selection.extend(visualParent, offset + 1);
-
- setSelection(selection);
- }
-
- void setMouseUpSelection(nsIDOMMouseEvent mouseEvent) {
- }
-
- void printVisualSelection() {
- nsISelection selection = visualSelectionController.getSelection(nsISelectionController.SELECTION_NORMAL);
- boolean collapsed = selection.getIsCollapsed();
- System.out.println(" ## VisualSelection"); //$NON-NLS-1$
- System.out.println(" ## collapsed: " + collapsed); //$NON-NLS-1$
- if (!collapsed) {
- nsIDOMNode anchorNode = selection.getAnchorNode();
- if (anchorNode != null) {
- System.out.println(" ## anchorNode: " + anchorNode.getNodeName() + " (" + anchorNode + ") offset: " + selection.getAnchorOffset()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- } else {
- System.out.println(" ## anchorNode: null"); //$NON-NLS-1$
- }
- }
- nsIDOMNode focusNode = selection.getFocusNode();
- if (focusNode != null) {
- System.out.println(" ## focusNode: " + focusNode.getNodeName() + " (" + focusNode + ") offset: " + selection.getFocusOffset()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- } else {
- System.out.println(" ## focusNode: null"); //$NON-NLS-1$
- }
- }
-
-// this method is never used
-// void setCaretAtMouse(nsIDOMMouseEvent mouseEvent) {
-// nsIDOMNode visualNode = VisualDomUtil.getTargetNode(mouseEvent);
-// boolean isAnonElement = VpeVisualDomBuilder.isAnonElement(visualNode);
-// if (isAnonElement) return;
-// VpeVisualInnerDropInfo visualDropInfo = getInnerDropInfo(mouseEvent);
-// nsIDOMNode visuaDropContainer = visualDropInfo.getDropContainer();
-// if (visuaDropContainer.getNodeType() == Node.TEXT_NODE) return;
-// int visualDropOffset = (int)visualDropInfo.getDropOffset();
-// if (visualDropOffset > 0) {
-// nsIDOMNodeList visualChildren = visuaDropContainer.getChildNodes();
-// nsIDOMNode visualChild = visualChildren.item(visualDropOffset - 1);
-// boolean isText = visualChild.getNodeType() == Node.TEXT_NODE;
-// if (isText) return;
-// }
-// nsISelection selection = visualSelectionController.getSelection(nsISelectionController.SELECTION_NORMAL);
-// if (!VisualDomUtil.isSelectionContains(selection, visuaDropContainer, visualDropOffset)) {
-// setVisualCaret(visuaDropContainer, visualDropOffset);
-// // TODO Sergey Vasilyev figure out with nsIFrameSelection
-//// nsIFrameSelection frameSelection = presShell.getFrameSelection();
-//// if (frameSelection != null) {
-//// frameSelection.setMouseDownState(true);
-//// }
-//
-// // was commented by Max Areshkau (with this code scrolling doesn't works)
-// //
-//// mouseEvent.preventDefault();
-//// mouseEvent.stopPropagation();
-// }
-// }
-
- void setVisualCaret(nsIDOMNode visualNode, int offset) {
- nsISelection selection = visualSelectionController.getSelection(nsISelectionController.SELECTION_NORMAL);
- if (visualNode != null) {
- if (visualNode.getNodeType() == Node.TEXT_NODE && offset > visualNode.getNodeValue().length()) {
- offset = visualNode.getNodeValue().length();
- }
- selection.collapse(visualNode, offset);
- } else {
- selection.removeAllRanges();
- }
- visualSelectionController.setCaretEnabled(true);
- setSelection(selection);
- }
-}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualCaretInfo.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualCaretInfo.java 2011-02-01 15:26:27 UTC (rev 28827)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualCaretInfo.java 2011-02-01 15:46:25 UTC (rev 28828)
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.editor;
-
-import org.eclipse.swt.graphics.Point;
-import org.w3c.dom.Node;
-
-import org.mozilla.interfaces.nsIDOMNode;
-
-public class VpeVisualCaretInfo {
- private VpeSelectionBuilder selectionBuilder;
- private nsIDOMNode rangeParent;
- private int rangeOffset;
-
- public VpeVisualCaretInfo(VpeSelectionBuilder selectionBuilder, nsIDOMNode rangeParent, int rangeOffset) {
- this.selectionBuilder = selectionBuilder;
- this.rangeParent = rangeParent;
- this.rangeOffset = rangeOffset;
-
- }
-
- public boolean exist() {
- return rangeParent != null;
- }
-
- public int getRageOffset(){
- return rangeOffset;
- }
-
-//this method is never used
-// public void showCaret() {
-// selectionBuilder.showVisualDragCaret(rangeParent, rangeOffset);
-// }
-
-//this method is never used
-// public void hideCaret() {
-// selectionBuilder.hideVisualDragCaret();
-// }
-
- public int getSourcePosition() {
- return selectionBuilder.getSourcePosition(rangeParent, rangeOffset);
- }
-}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2011-02-01 15:26:27 UTC (rev 28827)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2011-02-01 15:46:25 UTC (rev 28828)
@@ -29,23 +29,12 @@
import org.jboss.tools.vpe.xulrunner.browser.XulRunnerBrowser;
import org.jboss.tools.vpe.xulrunner.util.XPCOM;
import org.mozilla.interfaces.nsIBaseWindow;
-import org.mozilla.interfaces.nsIClipboardDragDropHookList;
-import org.mozilla.interfaces.nsIComponentManager;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.mozilla.interfaces.nsIDOMDocumentRange;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
-import org.mozilla.interfaces.nsIDOMRange;
import org.mozilla.interfaces.nsIDOMWindow;
-import org.mozilla.interfaces.nsIDocShell;
-import org.mozilla.interfaces.nsIDragService;
-import org.mozilla.interfaces.nsIDragSession;
-import org.mozilla.interfaces.nsIInterfaceRequestor;
-import org.mozilla.interfaces.nsISelection;
-import org.mozilla.interfaces.nsIServiceManager;
import org.mozilla.interfaces.nsISupports;
import org.mozilla.interfaces.nsITooltipListener;
-import org.mozilla.interfaces.nsITransferable;
import org.mozilla.xpcom.XPCOMException;
/**
@@ -92,7 +81,6 @@
* xpcom flasher component which used to draw lines
*/
private Flasher flasher;
- private nsIDocShell docShell = null;
/**
* RegExp for find expression 'display : none' in style string
@@ -213,32 +201,6 @@
}
- public boolean isMozillaDragFlavor() {
-
- nsIDragSession dragSession = getCurrentDragSession();
- if (dragSession != null) {
- nsITransferable transferable = createTransferable();
- if (transferable != null) {
- // transferable.flavorsTransferableCanImport();
-
- transferable.addDataFlavor(TRANS_FLAVOR_kURLDataMime);
- transferable.addDataFlavor(TRANS_FLAVOR_kFileMime);
- transferable.addDataFlavor(TRANS_FLAVOR_kURLMime);
- transferable.addDataFlavor(TRANS_FLAVOR_kUnicodeMime);
- dragSession.getData(transferable, 0);
-
- // transferable.flavorsTransferableCanImport();
- String[] flavors = new String[] { null };
- nsISupports[] data = new nsISupports[] { null };
- long[] length = new long[] { 0 };
- transferable.getAnyTransferData(flavors, data, length);
-
- return length[0] > 0;
- }
- }
- return false;
- }
-
public void onElementResize(nsIDOMElement element, int handle, int top,
int left, int width, int height) {
}
@@ -279,79 +241,12 @@
addResizerListener();
}
- public nsIDragSession getCurrentDragSession() {
- nsIServiceManager serviceManager = getServiceManager();
- nsIDragService dragService = (nsIDragService) serviceManager
- .getServiceByContractID(XPCOM.NS_DRAGSERVICE_CONTRACTID,
- nsIDragService.NS_IDRAGSERVICE_IID);
-
- return dragService.getCurrentSession();
- }
-
- public nsIClipboardDragDropHookList getClipboardDragDropHookList() {
- nsIDocShell docShell = getDocShell();
-
- if (docShell != null) {
- nsIClipboardDragDropHookList hookList = XPCOM.queryInterface(docShell, nsIClipboardDragDropHookList.class);
- return hookList;
- }
- return null;
- }
-
- public nsIDocShell getDocShell() {
- if (docShell == null) {
- nsIInterfaceRequestor interfaceRequestor = XPCOM.queryInterface(getWebBrowser(), nsIInterfaceRequestor.class);
- docShell = (nsIDocShell) interfaceRequestor
- .getInterface(nsIDocShell.NS_IDOCSHELL_IID);
- }
-
- return docShell;
- }
-
public nsIDOMDocument getDOMDocument() {
nsIDOMWindow domWindow = getWebBrowser().getContentDOMWindow();
return domWindow.getDocument();
}
- public nsIDOMDocumentRange getDOMDocumentRange() {
- return XPCOM.queryInterface(getDOMDocument(), nsIDOMDocumentRange.class);
- }
-
- public nsIDOMRange createDOMRange() {
- return getDOMDocumentRange().createRange();
- }
-
- public void showDragCaret(nsIDOMNode node, long offcet) {
- // TODO Sergey Vasilyev figure out with caret
- System.out
- .println("Show drag caret for " + node.getNodeName() + ":" + offcet); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void hideDragCaret() {
- // TODO Sergey Vasilyev figure out with caret
- System.out.println("Hide drag caret"); //$NON-NLS-1$
- }
-
- public nsITransferable createTransferable() {
- nsIComponentManager componentManager = getComponentManager();
- return (nsITransferable) componentManager.createInstanceByContractID(
- XPCOM.NS_TRANSFERABLE_CONTRACTID, this,
- nsITransferable.NS_ITRANSFERABLE_IID);
- }
-
/**
- * Returns selection controller which used in selection functionality
- *
- * @return
- */
- public nsISelection getSelection() {
-
- nsIDOMWindow domWindow = getWebBrowser().getContentDOMWindow();
- nsISelection selection = domWindow.getSelection();
- return selection;
- }
-
- /**
* Function created to restore functionality of MozillaBrowser
*
* @return
13 years, 10 months
JBoss Tools SVN: r28827 - branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2011-02-01 10:26:27 -0500 (Tue, 01 Feb 2011)
New Revision: 28827
Modified:
branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/BrowserPlugin.java
Log:
https://issues.jboss.org/browse/JBIDE-8298
Modified: branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/BrowserPlugin.java
===================================================================
--- branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/BrowserPlugin.java 2011-02-01 15:17:59 UTC (rev 28826)
+++ branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/BrowserPlugin.java 2011-02-01 15:26:27 UTC (rev 28827)
@@ -83,9 +83,11 @@
public void earlyStartup() {
/* init xulrunner path for */
try {
- String xulRunnerPath = XulRunnerBrowser.getXulRunnerPath();
+ /* init xulrunner path */
+ XulRunnerBrowser.getXulRunnerPath();
+// String xulRunnerPath = XulRunnerBrowser.getXulRunnerPath();
// if ("true".equals(Platform.getDebugOption(PLUGIN_ID + "/debug/earlyStartup"))) { //$NON-NLS-1$ //$NON-NLS-2$
- logInfo(MessageFormat.format("earlyStartup: XULRunner path is: {0}",xulRunnerPath)); //$NON-NLS-1$
+// logInfo(MessageFormat.format("earlyStartup: XULRunner path is: {0}",xulRunnerPath)); //$NON-NLS-1$
// }
} catch (XulRunnerException e) {
logError(e);
13 years, 10 months