Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Show current branch - Enable branch switching - Use a client-side proxy for the server-side state to prevent excessive client-server network requests
- Loading branch information
Showing
21 changed files
with
585 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/gwt/src/org/rstudio/core/client/WidgetHandlerRegistration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* WidgetHandlerRegistration.java | ||
* | ||
* Copyright (C) 2009-11 by RStudio, Inc. | ||
* | ||
* This program is licensed to you under the terms of version 3 of the | ||
* GNU Affero General Public License. This program is distributed WITHOUT | ||
* ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT, | ||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the | ||
* AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details. | ||
* | ||
*/ | ||
package org.rstudio.core.client; | ||
|
||
import com.google.gwt.event.logical.shared.AttachEvent; | ||
import com.google.gwt.event.shared.HandlerRegistration; | ||
import com.google.gwt.user.client.ui.Widget; | ||
|
||
/** | ||
* Automatically registers and unregisters a handler as a widget | ||
* becomes attached and detached from the DOM. | ||
* | ||
* To use, create a concrete subclass and override the doRegister | ||
* method to do the actual addHandler call. | ||
*/ | ||
public abstract class WidgetHandlerRegistration | ||
{ | ||
public WidgetHandlerRegistration(Widget widget) | ||
{ | ||
widget.addAttachHandler(new AttachEvent.Handler() | ||
{ | ||
@Override | ||
public void onAttachOrDetach(AttachEvent event) | ||
{ | ||
unregister(); | ||
if (event.isAttached()) | ||
register(); | ||
} | ||
}); | ||
|
||
if (widget.isAttached()) | ||
register(); | ||
} | ||
|
||
public void register() | ||
{ | ||
registration_ = doRegister(); | ||
} | ||
|
||
protected abstract HandlerRegistration doRegister(); | ||
|
||
private void unregister() | ||
{ | ||
if (registration_ != null) | ||
{ | ||
registration_.removeHandler(); | ||
registration_ = null; | ||
} | ||
} | ||
|
||
private HandlerRegistration registration_; | ||
} |
2 changes: 1 addition & 1 deletion
2
src/gwt/src/org/rstudio/core/client/widget/LeftRightToggleButton.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
.container { | ||
display: inline-block; | ||
height: 20px; | ||
margin-right: 12px; | ||
margin-right: 3px; | ||
} | ||
|
||
.container td { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+115 Bytes
src/gwt/src/org/rstudio/studio/client/common/icons/empty_command.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions
33
src/gwt/src/org/rstudio/studio/client/common/vcs/BranchesInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* BranchesInfo.java | ||
* | ||
* Copyright (C) 2009-11 by RStudio, Inc. | ||
* | ||
* This program is licensed to you under the terms of version 3 of the | ||
* GNU Affero General Public License. This program is distributed WITHOUT | ||
* ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT, | ||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the | ||
* AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details. | ||
* | ||
*/ | ||
package org.rstudio.studio.client.common.vcs; | ||
|
||
import com.google.gwt.core.client.JavaScriptObject; | ||
import com.google.gwt.core.client.JsArrayString; | ||
|
||
public class BranchesInfo extends JavaScriptObject | ||
{ | ||
protected BranchesInfo() | ||
{ | ||
} | ||
|
||
public native final String getActiveBranch() /*-{ | ||
if (this.activeIndex === null) | ||
return null; | ||
return this.branches[this.activeIndex]; | ||
}-*/; | ||
|
||
public native final JsArrayString getBranches() /*-{ | ||
return this.branches; | ||
}-*/; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.